0% found this document useful (0 votes)
96 views14 pages

Lab 1

Lab 1

Uploaded by

nawarmustafa5011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views14 pages

Lab 1

Lab 1

Uploaded by

nawarmustafa5011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Control Engineering Laboratory

Third Stage
Experiment No. 1
Laplace Transform using MATLAB
Asst. Lect. Yaseen H. Ali

2023
LECTURE OUTLINE
➢ Introduction
➢ Laplace Transform
➢ Inverse Laplace Transform
➢ Report Instructions
INTRODUCTION
❖ MATLAB is a programming environment that is interactive and is used in scientific
computing. It is extensively used in many technical fields where problem-solving, data
analysis, algorithm development, and experimentation are required. The software which is
discipline-specific is extensively written using MATLAB.

❖ Here, we will study the MATLAB function used to calculate the Laplace transform. Before
we get into details of how the Laplace function works in MATLAB, let us refresh our
understanding of the Laplace transform.

❖ Laplace transformation is used to solve differential equations. In Laplace transformation,


the time domain differential equation is first converted into an algebraic equation in the
frequency domain. Next, this algebraic equation is solved and the result is transformed
into the time domain.
Laplace Transform
❑ Syntax
Let us understand the Syntax of Laplace function in MATLAB
>> laplace (f)
• Laplace (f) returns the Laplace transform of the input ‘ f '.
Example: In this example, we will compute Laplace transform of a sine function using
laplace (f): Let us take a sine signal defined as f(t) = 4sin (5t)

f(t) = 4* sin (5*t) In MATLAB

Mathematically, the output of this signal using laplace transform will be:
F(S) = 20 / (s²+25)
Considering that transform is taken with 's' as transformation variable and 't' as
independent variable.
Laplace Transform
❑ Code
➢ To make the expression more readable, one can use the commands: simplify & pretty.

>> clear all %clear the workspace


>> close all %close other windows
>> clc %clear the command window
>> syms t %Initializing the variable
>> f = 4*sin (5*t); %Input sine function
>> F = laplace (f) %Using laplace function
>> simplify (F) %simplify function
>> pretty (F) %make it as a fraction

As we can see, the transform is in terms of the


variable 's' and the output is as expected by us.
Laplace Transform
❑ Example 1
Use MATLAB to find the Laplace transform for the following function:
f(t)= - 1.25 + 3.5 t 𝒆−𝟐𝒕 +4 sin(2t)
❑ Code ❑ Outcome

>> clear all


>> close all
>> clc
>> syms t
>> f= (-1.25+3.5*t*exp(-2*t)+4*sin(2*t));
>> F=laplace(f);
>> pretty(F)
Laplace Transform
❑ Example 2
Use MATLAB to find the Laplace transform for the flowing function:
f(t)= 𝒕𝒆−𝟒𝒕
❑ Code ❑ Outcome

>> clear all


>> close all
>> clc
>> syms t s
>> f(t)= t*exp(-4*t);
>> F(s)=laplace(f(t));
>> pretty (F(s))
Inverse Laplace Transform
❑ Syntax
Let us understand the Syntax of Inverse Laplace function in MATLAB
>> ilaplace (F)
• ilaplace (F) returns to the inverse laplace transform of the input ‘ F '.
𝟏
Example: Lets calculate the inverse laplace of the previous function F(s) =
(𝒔+𝟒)𝟐

>> clear all


>> close all
>> clc
>> syms s
>> F= (1/(s+4)^2);
>> f=ilaplace(F);
>> pretty (f)
Inverse Laplace Transform
❑ Example 1
Use MATLAB to find the inverse Laplace transform for the following function:
𝒔(𝒔+𝟔)
𝑭(𝒔) =
❑ Code (𝒔+𝟑)(𝒔𝟐+𝟔𝒔+𝟏𝟖) ❑ Outcome

>> clear all


>> close all
>> clc
>> syms s
>> F= (s*(s+6)/((s+3)*(s^2+6*s+18)));
>> f= ilaplace(F)
Inverse Laplace Transform
❑ Example 2
Use MATLAB to find the inverse Laplace transform for the following function:
𝟖 𝟑
Y(S) = +
❑ Code 𝟑𝒔𝟐 +𝟏𝟐 𝑺𝟐−𝟒𝟗 ❑ Outcome

>> clear all


>> close all
>> clc
>> syms s
>> Y=((8/(3*s^2+12))+(3/(s^2-49)));
>> y= ilaplace(Y);
pretty(y)
Homework
Q1/ Use MATLAB to find the Laplace Q2/ Use MATLAB to find the Inverse
transform for the following functions: Laplace transform for the following
functions:

𝑆−3
1. 𝑓 𝑡 = 𝑠𝑖𝑛 4𝑡 1. F(S) =
𝑆 2+5
2. 𝑓 𝑡 = 𝑡 4 𝑠 2+12𝑠+44
2. F(s) =
3. f(t) = 𝑡 3𝑒 −2𝑡 (𝑠+2)(𝑠+4)(𝑠+6)

4. 𝑓 𝑡 = 𝑠𝑖𝑛ℎ( 𝑡) 3. F(S) =
(𝑆−2)
𝑆(𝑆+1)3

25
4. G(S) =
𝑠 3(𝑠 2+4𝑠+5)
Report Instructions
❑ Report Guidelines

❖ This is an Individual report.


❖ You are encouraged to use information from internet, books and articles to help you.
❖ A well-written report with in depth analysis (include graphs, figures etc.) are required.
❖ You are allowed to discuss with other students, but you are not allowed to COPY the
student’s work. If a student disobeys this instruction, ZERO marks will be given to
the student.
❖ Cite what you write. (References in the end of this report are compulsory).
❖ Use your creativity in preparing this report.
❖ The solution for the Homework must be a MATLAB photograph for the code and the
outcome.
Report Instructions
❑ Technical Report Outline

1. The first page must be the cover page of the report.


2. Title of the report will be (Laplace Transform using MATLAB)
3. Introduction of the report (Write about Control Engineering & Laplace Transform)
4. Implementation procedure (your answers to the Homework).
5. Conclusion (Conclude the report and what have you learned?).
6. References (in the end of the report)
Report Instructions
❑ Report Marks

1. Technical report writing is 5%


2. Practical Exam is 5%
❑ Report Dates
1- Report submission 4/12/2023 – 18/12/2023
2- Practical Exam 4/12/2023 – 18/12/2023

❑ Report Submission
1- Hardcopy form.
2- Manually submission to Eng. Hadeer.

You might also like