Posted: October 27th, 2022
I need help on Process Control and Instrumentation homework for Chemical Engineering. There is a small part of the homework contain MatLab. Can you help please!
I have attached the book and the assignment.
CBE 43
0
Week 0
3
Reading
โข Ch. 3
Laplace Transforms
Mathematical models of real processes often result in systems of linear ODEs.
The Laplace transform can reduce the time required to find a solution, by
converting ODEs to equations.
Letโs review Laplace transforms!
โ ๐ ๐ก
= เถฑ
0
โ
๐ ๐ก ๐โ๐ ๐ก๐๐ก = ๐น
๐
โโ1 ๐น ๐ = ๐
๐ก
Laplace Domain
๐(๐ก) ๐น(๐ )
Time Domain
Slide 03.0
1
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of
โ[ ]
โข Example
3.6
โข MATLAB
CBE 430
Week 03
Reading
โข Ch. 3
Laplace Transforms
Constant function:
Unit step function:
Exponential:
Rectangular
Pulse:
โ ๐ = เถฑ
0
โ
๐๐โ๐ ๐ก๐๐ก = โ
๐
๐
๐โ๐ ๐ก
0
โ
=
๐
๐
โ ๐ ๐ก
=
1
๐
Notice, the Laplace transform
doesnโt care what happens at ๐ก < 0!
So the unit step at ๐ก = 0 is the same
as the constant with ๐ = 1.
โ ๐(๐ก) = เถฑ
0
โ
๐โ๐๐ก๐โ๐ ๐ก๐๐ก = เถฑ
0
โ
๐โ(๐ +๐)๐ก๐๐ก = โ
๐โ ๐ +๐ ๐ก
๐ + ๐
0
โ
=
1
๐ + ๐
๐ ๐ก = แ
0 ๐ก < 0
โ 0 โค ๐ก <
๐ก๐ค
0 ๐ก โฅ ๐ก๐ค
โ ๐(๐ก) = เถฑ
0
๐ก๐ค
โ๐โ๐ ๐ก๐๐ก = โ
โ
๐
๐โ๐ ๐ก แ
0
๐ก๐ค
=
โ
๐
1 โ ๐โ๐ก๐ค๐
๐ ๐ก = ๐
๐ ๐ก = ๐ ๐ก = แ
0 ๐ก < 0
1 ๐ก โฅ 0
๐ ๐ก = ๐โ๐๐ก
Slide 03.0
2
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
CBE 430
Week 03
Reading
โข Ch. 3
How About a Time Delay (Lag).
In chemical and biological processes, one function is often related to another by
a time delay (lag). The simplest example is:
๐๐ ๐ก = ๐ ๐ก โ ๐ ๐ ๐ก โ ๐ ๐ ensures that ๐๐ = 0 before the lag
time. This can happen when ๐ and ๐
๐
measure the same thing (e.g. a
temperature or concentration) at
different points in a , for
example.
What is the Laplace transform of ๐๐(๐ก)?
Slide 03.03
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
CBE 430
Week 03
Reading
โข Ch. 3
How About a Time Delay (Lag).
๐๐ ๐ก = ๐ ๐ก โ ๐ ๐ ๐ก โ
๐
โ ๐๐ ๐ก = โ ๐ ๐ก โ ๐ ๐ ๐ก โ ๐
= เถฑ
0
โ
๐ ๐ก โ ๐ ๐ ๐ก โ ๐ ๐โ๐ ๐ก
๐๐ก
= เถฑ
0
๐
๐ ๐ก โ ๐ 0 ๐โ๐ ๐ก๐๐ก + เถฑ
๐
โ
๐ ๐ก โ ๐ ๐โ๐ ๐ก๐๐ก
= เถฑ
๐
โ
๐ ๐ก โ ๐ ๐โ๐ ๐กโ๐ ๐โ๐ ๐ ๐ ๐ก โ ๐
= ๐โ๐ ๐เถฑ
0
โ
๐ ๐กโ ๐โ๐ ๐ก
โ
๐๐กโ
โ[๐๐ ๐ก ] = ๐
โ๐ ๐๐น ๐
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.04
CBE 430
Week 03
Reading
โข Ch. 3
Now you try one:
Use the property:
and the Euler formula for the cosine:
To find
โ ๐ฅ ๐ก + ๐ฆ ๐ก = โ ๐ฅ ๐ก + โ ๐ฆ ๐ก
=
1
2
1
๐ โ ๐๐
+
1
๐ + ๐๐
cos ๐๐ก =
๐๐๐๐ก + ๐โ๐๐๐ก
2
; ๐ โก โ1
โ[cos ๐๐ก ] =
1
2
โ ๐๐๐๐ก +
1
2
โ ๐โ๐๐๐ก
=
1
2
๐ + ๐๐ + ๐ โ ๐๐
๐ 2 +๐2
=
๐
๐ 2 +๐2
โ[cos ๐๐ก ]
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.05
CBE 430
Week 03
Reading
โข Ch. 3
What about this one?
๐ข = ๐ก ๐๐ฃ = ๐โ ๐ +๐ ๐ก๐๐ก
๐๐ข = ๐๐ก ๐ฃ
= โ
1
๐ + ๐
๐โ ๐ +๐ ๐ก
โ ๐ก๐๐๐ก = โ
๐ก๐โ ๐ +๐ ๐ก
๐ + ๐
๐ก=0
๐ก=โ
+เถฑ
0
โ ๐โ ๐ +๐ ๐ก
๐ + ๐
๐๐ก
= 0 โ 0 โ
๐โ ๐ +๐ ๐ก
๐ + ๐ 2
๐ก=0
๐ก=โ
=
1
๐ + ๐ 2
โ ๐ก๐โ๐๐ก
Integration by parts! เถฑ
0
โ
๐ข๐๐ฃ = ๐ข๐ฃ โเถฑ
0
โ
๐ฃ๐๐ข
= เถฑ
0
โ
๐ก๐โ๐๐ก๐โ๐ ๐ก๐๐ก = เถฑ
0
โ
๐ก๐โ ๐+๐ ๐ก๐๐ก
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.06
CBE 430
Week 03
Reading
โข Ch. 3
One more important exampleโฆ
The impulse (with area ๐): ๐ ๐ก = ๐๐ฟ ๐ก
โ ๐(๐ก) = lim
๐ก๐คโ0
๐
๐ก๐ค๐
1 โ ๐โ๐ก๐ค๐
Where ๐ฟ ๐ก is the function. ๐ฟ ๐ก has an area of 1, a
height of infinity, and a width of 0. This can be modeled as a pulse
of โ = 1/๐ก๐ค as ๐ก๐ค โ 0. Using the result for the pulseโฆ
Apply lโHรดpitalโs rule (differentiate by ๐ก๐ค):
โ ๐๐ฟ ๐ก = lim
๐ก๐คโ0
๐ 1 โ ๐โ๐ก๐ค๐
๐ก๐ค๐
= lim
๐ก๐คโ0
๐๐ ๐โ๐ก๐ค๐
๐
= ๐
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.07
CBE 430
Week 03
Reading
โข Ch. 3
Why is this useful?
Finding Laplace transforms is fun and easy, but thatโs not
why we use them. In fact, we usually donโt bother finding
them at allโฆ we in a table (like Table 3.1
on pp. 40-41 of Seborg).
Laplace transforms are useful because they
help us to find solutions to differential
equations.
โฆhereโs howโฆ โ
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.08
CBE 430
Week 03
Reading
โข Ch. 3
Time-Derivatives
What is the Laplace transform of the time-derivative?
How about the second
time derivative?
For the ๐๐กโ derivative:
โ
๐๐
๐๐ก
= เถฑ
0
โ๐๐
๐๐ก
๐โ๐ ๐ก๐๐ก = ๐๐โ๐ ๐ก แ
0
โ
โเถฑ
0
โ
๐ ๐ก
๐ ๐โ๐ ๐ก
๐๐ก
๐๐ก
= โ๐ 0 + เถฑ
0
โ
๐ ๐ก ๐ ๐โ๐ ๐ก๐๐ก
= โ๐ 0 + ๐ โ ๐ ๐ก
โ
๐2๐
๐๐ก2
= โ
๐๐
๐๐ก
; where ๐ =
๐๐
๐๐ก
= โ๐ 0 + ๐ ๐ ๐น ๐ โ ๐ 0
= โ๐ 0 + ๐ ๐น ๐
= ๐ 2๐น ๐ โ แค
๐๐
๐๐ก
๐ก=0
โ ๐ ๐ 0
This is awesome!
Now we can use
Laplace transforms
to replace first
derivatives!
๐๐ ๐ ๐ก
๐๐ก๐
= ๐ ๐๐น ๐ โ เท
๐=0
๐โ1
๐ ๐ เธญ
๐๐โ1โ๐๐ ๐ก
๐๐ก๐โ1โ๐
๐ก=0
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.09
CBE 430
Week 03
Reading
โข Ch. 3
A First-Order ODE Example
5
๐๐ฆ
๐๐ก
+ 4๐ฆ = 2; ๐ฆ 0 = 1
5โ
๐๐ฆ
๐๐ก
+ 4โ ๐ฆ = โ 2
5 ๐ ๐ ๐ โ ๐ฆ 0 + 4
๐ ๐ =
2
๐
5๐ ๐ ๐ โ 5 1 + 4๐ ๐ =
2
๐
5๐ + 4 ๐ ๐ =
2
๐
+ 5
๐ ๐ =
2
๐
5๐ +
4
+
5
5๐ + 4
โ[ ]
Solve
for ๐ ๐
Now invert using Table
3.1. Notice that entries 5
and 6, and 9 and 10 are
equivalent alternative
representations.
๐ ๐ =
2
5
1
๐ + 0
๐ +
4
5
+
1
๐ +
4
5
๐ฆ ๐ก = โ0.5 ๐โ0.8๐ก โ 1 + ๐โ0.8๐ก
= 0.5 1 โ ๐โ0.8๐ก
Transform
equation
โโ1[ ]
Notice the gets
used here!
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.10
CBE 430
Week 03
Reading
โข Ch. 3
A Higher-Order ODE Example
๐3๐ฆ
๐๐ก3
+ 6
๐2๐ฆ
๐๐ก2
+ 11
๐๐ฆ
๐๐ก
+ 6๐ฆ = 1;
๐ ๐ =
1
๐ (๐ 3 + 6๐ 2 + 11๐ + 6)
เธญ
๐2๐ฆ
๐๐ก2
0
= 0; แค
๐๐ฆ
๐๐ก
0
= 0; ๐ฆ 0 = 0
How many ICโs do we need?
โ
๐3๐ฆ
๐๐ก3
+ 6โ
๐2๐ฆ
๐๐ก2
+ 11โ
๐๐ฆ
๐๐ก
+ 6โ ๐ฆ = โ 1
๐ 3๐ ๐ + 6๐ 2๐ ๐ + 11๐ ๐ ๐ + 6๐ ๐ =
1
๐
Find the (4) roots of the (4th-order)
polynomial in the denominator, so it
can be factored!
Roots are ๐ = 0, -1, -2, and -3. ๐ ๐ =
1
๐ (๐ + 1)(๐ + 2)(๐ + 3)
Perform .
๐ ๐ =
๐ผ1
๐
+
๐ผ2
๐ + 1
+
๐ผ3
๐ + 2
+
๐ผ4
๐ + 3
๐ผ1 =
1
6
; ๐ผ2 = โ
1
2
; ๐ผ3 =
1
2
; ๐ผ4 = โ
1
6
Perform
Heaviside
expansion.
๐ฆ ๐ก =
1
6
โ
1
2
๐โ๐ก +
1
2
๐โ2๐ก โ
1
6
๐โ3๐ก
When did we
use the ICโs?!?!
โ[ ]
โโ1[ ]
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.11
CBE 430
Week 03
Reading
โข Ch. 3
What was that Heaviside thing?
๐ ๐ =
๐ ๐
๐ท ๐
=
1
๐ (๐ + 1)(๐ + 2)(๐ + 3)
=
๐ผ1
๐
+
๐ผ2
๐ + 1
+
๐ผ3
๐ + 2
+
๐ผ4
๐ + 3
Find the coefficients ๐ผ๐ using .
1. Multiply the whole equations by one of the terms in the denominator (for
example, the second one).
2. Choose ๐ so that all the remaining ๐ผ๐ are . In this case, we
set ๐ = โ1. Compute ๐ผ2.
๐ + 1
๐ ๐ + 1 ๐ + 2 ๐ + 3
= ๐ผ2 + ๐ + 1
๐ผ1
๐
+
๐ผ3
๐ + 2
+
๐ผ4
๐ + 3
1
โ1 โ1 + 2 [ โ1 + 3]
= ๐ผ2 =
1
โ1 ร 1 ร
2
= โ
1
2
In generalโฆ ๐ผ๐ = แค๐ + ๐
๐
๐ ๐
๐ท ๐
๐ =โ๐๐
What about
repeated roots?…
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.12
CBE 430
Week 03
Reading
โข Ch. 3
An example with repeated roots
๐2๐ฆ
๐๐ก2
+ 4
๐๐ฆ
๐๐ก
+ 4๐ฆ = 1; เธญ
๐2๐ฆ
๐๐ก2
0
= 0; แค
๐๐ฆ
๐๐ก
0
= 1; ๐ฆ 0 = 0
๐ 2๐ ๐ โ ๐ ๐ฆ 0 โ แค
๐๐ฆ
๐๐ก
0
+ 4 ๐ ๐ ๐ โ ๐ฆ 0 + 4๐ ๐ =
1
๐
๐ 2๐ ๐ โ 1 + 4๐ ๐ ๐ + 4๐ ๐ =
1
๐
๐ 2 + 4๐ + 4 ๐ ๐ =
1
๐
+ 1 =
๐ + 1
๐
๐ ๐ =
๐ + 1
๐ ๐ 2 + 4๐ + 4
Use the Heaviside method
to find ๐ผ1 and ๐ผ3
๐ ๐ =
๐ + 1
๐ ๐ 2 + 4๐ + 4
=
๐ผ1
๐
+
๐ผ2
๐ + 2
+
๐ผ3
๐ + 2 2
Canโt use the Heaviside
method for ๐ผ2 because
multiplication by ๐ + 2 ,
and setting
doesnโt eliminate the ๐ผ3
term; it blows up.
๐ผ1 =
0 + 1
02 + 4 0 + 4
=
1
4
; ๐ผ3 =
โ2 + 1
โ2
=
1
2
Then just choose another ๐
to find ๐ผ2; choose ๐ = โ1
๐ผ2 =
๐ + 1
๐ (๐ 2 + 4๐ + 4)
โ
1
4๐
โ
1
2 ๐ + 2 2
; ๐ผ2 =
1
4
โ
1
2
= โ
1
4
The denominator is a 3rd-order
polynomial, so there must be 3 constants.
ICโs used here!
โ[ ]
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.13
CBE 430
Week 03
Reading
โข Ch. 3
Or, you can take the derivative
๐ ๐ =
๐ + 1
๐ ๐ 2 + 4๐ + 4
=
๐ผ1
๐
+
๐ผ2
๐ + 2
+
๐ผ3
๐ + 2 2
For multiple repeated roots, or roots repeated several times, the derivative
method helps ensure you have to solve for all of the
unknown ๐ผ๐. The general formula that you can use in this case is:
๐ผ๐ =
1
๐ โ ๐ !
lim
๐ โโ๐
๐๐โ๐
๐๐ ๐โ๐
๐ + ๐ ๐
๐ ๐
๐ท ๐
๐ผ3 = แค๐ + 2
2
๐ ๐
๐ท ๐
๐ =โ2
; ๐ผ2 = เธญ
๐
๐๐
๐ + 2 2
๐ ๐
๐ท
๐
s=โ2
; ๐ผ1 = แค๐
๐ ๐
๐ท ๐
๐ =0
๐ผ3 =
1
2
; ๐ผ2 = แค
๐
๐๐
1 +
1
๐
s=โ2
= โ
1
โ2 2
= โ
1
4
; ๐ผ1 =
1
4
๐ ๐ =
๐ผ1
(๐ + ๐)
+
๐ผ2
๐ + ๐ 2
+โฏ
๐ผ๐
๐ + ๐ ๐
+โฏ =เท
๐
๐
๐ผ๐
๐ + ๐ ๐
+โฏ
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.14
CBE 430
Week 03
Reading
โข Ch. 3
What about complex roots?
Heaviside expansion will
give complex ๐ผ1,2 = โ
1
3
๐
๐ ๐ =
1
๐ 2 + ๐ + 2.5
=
๐ผ1
๐ + ๐1
+
๐ผ2
๐ + ๐2
๐ ๐ =
๐ ๐
๐ท ๐
; ๐ท ๐ = ๐๐ 2 + ๐๐ + ๐; ๐2 < 4๐๐ โ ๐๐๐๐๐๐๐ฅ ๐๐๐๐ก๐
๐1, ๐2 =
โ1 ยฑ 12 โ 4 1 2.5
2 1
= โ
1
2
ยฑ
โ9
2
= โ
1
2
ยฑ
3
2
๐
Find ๐1 and ๐2 from the roots of ๐ท ๐
Instead, lets put ๐(๐ ) in the form of one of the entries in the Table 3.1
on p. 42. โ How about number 17?
๐ ๐ = ๐
๐
๐ + ๐ 2 + ๐2
=
1
๐ 2 + ๐ + 2.5
This term has to give both
๐ 2 and ๐ . So ๐ =
1
2
.
Now the denominator is:
๐ท ๐ = ๐ +
1
2
2
+ ๐2 = ๐ 2 + s +
1
4
+ ๐2 = ๐ 2 + s + 2.5
๐2 = 2.25; ๐ =
1.5
๐๐ = 1; ๐ =
2
3
๐ ๐ =
2
3
1.5
๐ +
1
2
2
+ 1.52
๐ฆ ๐ก =
2
3
๐โ0.5๐กsin(1.5๐ก)
Find ๐:
Complex roots will always give in the time domain.
Find ๐:
โโ1[ ]
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.15
CBE 430
Week 03
Reading
โข Ch. 3
Some Properties of Laplace Transforms
1. The transform and reverse transform are both linear operations, allowing you to use superposition:
2. The theorem:
3. The initial value theorem:
4. The theorem:
5. Convolution:
6. When ๐น ๐ has positive real denominator roots (๐๐ < 0), ๐(๐ก) will grow exponentially.
7. When ๐น(๐ ) has complex denominator roots (๐๐
2< 0), ๐ ๐ก will oscillate .
8. When ๐น(๐ ) has an exponential in ๐ , ๐(๐ก) has a .
โ ๐ฅ ๐ก + ๐ฆ ๐ก = โ ๐ฅ ๐ก + โ ๐ฆ ๐ก
lim
๐กโโ
๐ฆ(๐ก) = lim
๐ โ0
[๐ ๐ ๐ ]
๐น ๐ = ๐บ ๐ ๐ป ๐
๐ ๐ก = โโ1 ๐บ ๐ ๐ป ๐ = เถฑ
0
๐ก
๐ ๐ โ ๐ก โ ๐ ๐๐ = เถฑ
0
๐ก
๐ ๐ก โ ๐ โ ๐ ๐๐
lim
๐กโ0
๐ฆ(๐ก) = lim
๐ โโ
[๐ ๐ ๐ ]
โ ๐ ๐ก โ ๐ก0 ๐ ๐ก โ ๐ก0 = ๐
โ๐ก0๐ ๐น(๐ )
Great for checking answers!
Weโll make use of these a lot.
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.16
CBE 430
Week 03
Reading
โข Ch. 3
Letโs do Example 3.6
Check out how the CSTR works. (Are there
recirculation zones, dead zones, or other non-ideal
mixing?)
Do an impulse test with a tracer, compare the
concentration coming out, ๐2(๐ก), to the predicted
concentration assuming .
Compare the theoretical solutions of the responses
to (perfect) impulse, and (physically realizable)
rectangular pulse test.
Find:
a) The magnitude of an impulse that would model
the total amount of material added with the
pulse shown at the right.
b) The impulse and pulse responses of the reactant
concentration leaving the reactor, ๐.
๐ = 4 ๐3
๐ = 2 ๐3 ๐๐๐๐ข๐ก๐โ1
๐๐ = 1 ๐๐๐๐๐ ๐
โ3
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.17
CBE 430
Week 03
Reading
โข Ch. 3
Example 3.6(a)
Find:
a) The magnitude of an impulse that would
model the total amount of material added
with the pulse shown at the right.
๐๐ฟ ๐ก ; ๐ด๐๐๐๐ข๐๐ ๐ = ๐
Define the ๐๐ = ๐๐ โ เดฅ๐๐ and ๐ = ๐ โ าง๐
Where เดฅ๐๐ and าง๐ are the respective values.
๐๐,๐๐ข๐๐ ๐ = เต
6 โ 1 ๐๐๐๐๐ ๐โ3 0 โค ๐ก < 0.25
0 ๐๐๐๐๐ ๐โ3 ๐ก < 0; 0.25 โค ๐ก
๐ด๐๐ข๐๐ ๐ = 1.25 ๐๐๐๐๐ ๐๐๐๐ข๐ก๐๐ ๐
โ3
โด ๐๐,๐๐๐๐ข๐๐ ๐ = 1.25 ๐ฟ(๐ก)
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.18
CBE 430
Week 03
Reading
โข Ch. 3
Example 3.6(b)
Find:
b) The impulse and pulse responses of the reactant concentration
leaving the reactor, ๐. (Letโs find ๐, instead.)
๐
๐๐
๐๐ก
= ๐ ๐๐ โ ๐
Write a species mole balance on the tracer:
๐
๐ ๐ โ าง๐
๐๐ก
= ๐ ๐๐ โ เดฅ๐๐ โ ๐ โ าง๐
Therefore, at steady
state: เดฅ๐๐ = าง๐
Convert this mole balance to a differential
equation for the ๐.
๐๐
๐๐ก
=
๐
๐
๐๐ โ ๐ =
1
๐
๐๐ โ ๐
๐ 0 = 0
Now replace the inlet
concentration (perturbation)
with ๐๐,๐๐ข๐๐ ๐ and ๐๐,๐๐๐๐ข๐๐ ๐.
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.19
๐
๐ าง๐
๐๐ก
= ๐ เดฅ๐๐ โ าง๐ = 0
CBE 430
Week 03
Reading
โข Ch. 3
Example 3.6(b) continued
Impulse:
๐๐
๐๐ก
=
1
๐
(๐๐ โ ๐)
๐๐
๐๐ก
=
1
๐
๐๐,๐๐๐๐ข๐๐ ๐ โ ๐
=
1
๐
๐๐ฟ ๐ก โ ๐
๐ ๐ ๐ โ ๐ 0 =
1
๐
๐ โ
๐ ๐
๐ ๐ = ๐
1
๐๐ + 1
๐ ๐ก =
๐
๐
๐โ ฮค๐ก ๐
Pulse:
๐๐
๐๐ก
=
1
๐
๐๐,๐๐ข๐๐ ๐ โ ๐ ๐ ๐ ๐ โ ๐ 0 =
5
๐๐
1 โ ๐โ0.25๐ โ
๐ ๐
๐1
๐ ๐ = 5
1
๐ ๐๐ + 1
โ ๐โ0.25๐
1
๐ ๐๐ + 1
๐ ๐ก = 5 1 โ ๐โ ฮค๐ก ๐ โ 5 1 โ ๐โ ๐กโ0.25 /๐ ๐(๐ก โ 0.25)
This is a time lag!
Transform this term,
then change ๐ก to ๐ก โ
0.25 and multiply by
the step function.๐ ๐ก = แ
5 1 โ ๐โ ฮค๐ก ๐ ; ๐ก < 0.25
5 ๐โ ฮค๐กโ0.25 ๐ โ ๐โ ฮค๐ก ๐ ; ๐ก โฅ 0.25
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.20
CBE 430
Week 03
Reading
โข Ch. 3
Example 3.6(b) continued
๐๐
๐๐ก
=
1
๐
(๐๐ โ ๐)
๐ ๐ก =
๐
๐1
๐โ ฮค๐ก ๐
๐ ๐ก = แ
5 1 โ ๐โ ฮค๐ก ๐ ; ๐ก < 0.25
5 ๐โ ฮค๐กโ0.25 ๐ โ ๐โ ฮค๐ก ๐ ; ๐ก โฅ 0.25
Impulse:
Pulse:
0.6
0.5
0.4
0.3
0.2
0.1
0.0
๏ฃ
1086420
Time, t (min)
impulse
pulse
๐ = 1.25
๐ =
๐
๐
= 2 ๐๐๐๐ข๐ก๐๐
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.21
CBE 430
Week 03
Reading
โข Ch. 3
Laplace transforms using MATLAB
MATLAB can really help with
Laplace transforms!
Use symbolic math toolbox
and commands
laplace
ilaplace
Consider from slide 04.06 โฆ
>>syms t f(t)
>>f =
t*exp(-t)
f =
t*exp(-t)
>> F = laplace(f)
F =
1/(s + 1)^2
>> f = ilaplace(F)
f =
t*exp(-t)
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.22
CBE 430
Week 03
Reading
โข Ch. 3
Laplace transforms using MATLAB
How about for ODEs?
Consider from slide 03.10:
>>syms t y(t)
>>dydt = diff(y,t)
dydt(t) =
diff(y(t), t)
>>laplace(5*dydt + 4*y==2)
ans =
5*s*laplace(y(t), t, s) – 5*y(0) + 4*laplace(y(t), t, s) == 2/s
Interpret this:
5
๐๐ฆ
๐๐ก
+ 4๐ฆ = 2; ๐ฆ 0 = 1
Define t and y(t) as symbolic variables. Make
sure to tell MATLAB that y is a function of t.
Next, create a symbolic variable for
the . (You can also define
higher order derivatives with diff.)
Take the Laplace transform of the defining
equation! Remember to use ==.
5๐ ๐ ๐ โ 5๐ฆ 0 + 4๐ ๐ =
2
๐
Compare to slide 03.10
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.23
CBE 430
Week 03
Reading
โข Ch. 3
Laplace transforms using MATLAB
Take care defining constants and variables!
>>syms t y1(t) a
>>Y1 = laplace(y1)
Y1 =
laplace(y(t), t, s)
>>A = laplace(a)
A = 1/s^2
Matlab didnโt know what you wanted the independent variable to be, so it a. This
is the Laplace transform of .
To take the Laplace transform of a constant, a:
>>syms a, t, s
>>laplace(a, t, s)
ans =
a/s
Expected behavior. What will happen for a?
???
What is this ?!!
y1 is a function, a is just another variable.
This tells MATLAB everything it needs to know:
โข Take the Laplace transform of a;
โข Use t as the independent variable;
โข Use s is the Laplace-domain independent variable.
(Otherwise, MATLAB has to guess what you want!)
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.24
CBE 430
Week 03
Reading
โข Ch. 3
Summary
1. Laplace transforms convert time-domain functions to equivalent functions in a Laplace
domain. The independent variable ๐ is .
2. This is useful for solving differential equations, because derivatives are converted to
algebraic equations when converting from the time domain to the Laplace domain.
3. Conversion to the Laplace domain decomposes a function helps to find characteristic ,
frequencies, and .
4. Some features of the time-domain solution can be easily identified in the Laplace domain (e.g.
an exponential decay, a sinusoidal oscillation, a time lag). Weโll get more practice at identifying
these. โWith experience you can tell a lot about time-domain dynamics without inverting the
Laplace-domain equations!
5. You can use MATLAB laplace and ilaplace
Topics
โข Laplace
transforms
โข Solving
ODEs
โข Properties
of โ[ ]
โข Example
3.6
โข MATLAB
Slide 03.25
Place an order in 3 easy steps. Takes less than 5 mins.