03_transfer_functions_laplace
03_transfer_functions_laplace
Automatic Control 1
Transfer functions
University of Trento
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 1 / 28
Lecture: Transfer functions Laplace transform
Laplace transform
Consider a function f (t), f : R → R, f (t) = 0 for all t < 0.
Definition
1.5
f(t)
0.5
Z∞
−st
F(s) = e f (t)dt 0
0
−0.5
−1 0 1 2 3 4 5
t
for all s ∈ C for which the integral exists
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 2 / 28
Lecture: Transfer functions Laplace transform
Unit step
Z +∞ ∞
0 if t < 0 −st
1 1
f (t) = 1I(t) = ⇒ F(s) = e dt = − =
1 if t ≥ 0 s s
0 0
1
The function δ(t) is can be considered as the limit of the sequence of functions fε (t) for
ε→0 ¨
1
ε
se 0 ≤ t ≤ ε
fε (t) =
0 otherwise
To be mathematically correct, Dirac’s δ is a distribution, not a function
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 3 / 28
Lecture: Transfer functions Laplace transform
2
Example: f (t) = δ(t) − 2 1I(t) ⇒ L [f ] = 1 − s
Time delay
L [f (t − τ)] = e−sτ L [f (t)]
3e−2s
Example: f (t) = 3 1I(t − 2) ⇒ L [f ] = s
Exponential scaling
L [eat f (t)] = F(s − a), where F(s) = L [f (t)]
1
Example: f (t) = eat 1I(t) ⇒ L [f ] = s−a
jωt −jωt
e +e s
Example: f (t) = cos(ωt) 1I(t) = 2
1I(t) ⇒ L [f ] = s2 +ω2
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 4 / 28
Lecture: Transfer functions Laplace transform
Time derivative2 :
d
L[ f (t)] = sL [f (t)] − f (0+ )
dt
ω
Example =⇒ f (t) = sin(ωt) 1I(t) ⇒ L[f ] = s2 +ω2
Multiplication by t
d
L [tf (t)] = − L [f (t)]
ds
1
Example =⇒ f (t) = t 1I(t) ⇒ L[f ] = s2
2
f (0+ ) = limt→0+ f (t). If f is continuos in 0, f (0+ ) = f (0)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 5 / 28
Lecture: Transfer functions Laplace transform
1 1
Example: f (t) = 1I(t) − t 1I(t) ⇒ F(s) = s
− s2
f (0+ ) = 1 = lims→∞ sF(s)
1 1
Example: f (t) = 1I(t) − e−t 1I(t) ⇒ F(s) = s
− s+1
f (+∞) = 1 = lims→0 sF(s)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 6 / 28
Lecture: Transfer functions Laplace transform
Convolution
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 7 / 28
Lecture: Transfer functions Laplace transform
1
1
s
δ 1
δ (k) sk
In MATLAB use
1
t F = LAPLACE(f)
s2
k
t 1
,k≥0
k! sk+1 MATLAB
eat
1 » syms t
s−a » f=exp(2*t)+t-tˆ2
cos ωt
s
=
1/2
+
1/2 » F=laplace(f)
s2 + ω 2 s − jω s + jω
sin ωt
ω
=
1/2j
−
1/2j F =
s2 + ω 2 s − jω s + jω
s cos φ − ω sin φ 1/(s-2)+1/sˆ2-2/sˆ3
cos(ωt + φ)
s2 + ω 2
s+a
e−at cos ωt
(s + a)2 + ω 2
ω
e−at sin ωt
(s + a)2 + ω 2
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 8 / 28
Lecture: Transfer functions Laplace transform
f +g F +G
αf (α ∈ R) αF
df
sF (s) − f (0)
dt
k
d f df dk−1 f
sk F (s) − sk−1 f (0) − sk−2 (0) − · · · − k−1 (0)
dtk dt dt
! t
F (s)
g(t) = f (τ ) dτ G(s) =
0 s
1
f (αt), α > 0 F (s/α)
α
eat f (t) F (s − a)
dF
tf (t) −
ds
dk F (s)
tk f (t) (−1)k
dsk
f (t) ! ∞
F (s) ds
t s
"
0 0≤t<T
g(t) = ,T ≥0 G(s) = e−sT F (s)
f (t − T ) t ≥ T
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 9 / 28
Lecture: Transfer functions Transfer functions
Transfer function
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 10 / 28
Lecture: Transfer functions Transfer functions
Transfer function
Definition
The transfer function of a continuous-time linear system (A, B, C, D) is the ratio
between the Laplace transform Y(s) of output and the Laplace transform U(s) of
the input signals for the initial state x0 = 0
MATLAB
»sys=ss(A,B,C,D);
»G=tf(sys)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 11 / 28
Lecture: Transfer functions Transfer functions
Transfer function
u(t) y(t) U(s) Y(s)
A,B,C,D G(s)
x0=0
For initial conditions y(0) = ẏ(0) = y(n−1) (0), we obtain immediately the transfer
function from u to y
bm sm + bm−1 sm−1 + · · · + b1 s + b0
G(s) =
sn + an−1 sn−1 + · · · + a1 s + a0
Example
MATLAB
»G=tf([2 22],[1 11 10])
ÿ + 11ẏ + 10y = 2u̇ + 22u
Transfer function:
2 s + 22
2s + 22 ----------
G(s) = sˆ2 + 11 s + 10
s2 + 11s + 10
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 13 / 28
Lecture: Transfer functions Transfer functions
Example
Differential equation
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 14 / 28
Lecture: Transfer functions Transfer functions
Double integrator
ZZ t
ẋ1 (t) = x2 (t) u(t) 1 y(t)
ẋ (t) = u(t) y(t) = u(τ)dτ s2
2 0
y(t) = x1 (t)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 15 / 28
Lecture: Transfer functions Transfer functions
Impulse response
Remember that an input signal u(t) produces an output signal y(t) whose
Laplace transform Y(s) is
Y(s) = G(s)U(s)
where U(s) = L [u], for initial state x(0) = 0
Speciale case: impulsive input u(t) = δ(t), U(s) = 1. The corresponding
output y(t) is called the impulse response
G(s) is the Laplace transform of the impulse response y(t)
Y(s) = G(s) · 1 = G(s)
0.4
0.35
Example:
2 0.25
G(s) = 0.2
s2 + 3s + 1 0.15
0.1
−1 −2t 0.05
L [G(s)] = 2te
0
0 1 2 3 4 5 6
t
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 16 / 28
Lecture: Transfer functions Transfer functions
The impulse response y(t) is therefore the inverse Laplace transform of the
transfer function G(s), y(t) = L −1 [G(s)]
The general formula for computing the inverse Laplace transform is
Z σ+j∞
1
f (t) = F(s)est ds
2πj σ−j∞
MATLAB
In MATLAB use » syms s
» F=2*s/(sˆ2+1)
» f=ilaplace(F)
f = ILAPLACE(f)
f = 2*cos(t)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 17 / 28
Lecture: Transfer functions Transfer functions
Examples
Integrator
u(t) = δ(t) u(t) 1 y(t)
y(t) = L −1 [ 1s ] = 1I(t) s
Double integrator
u(t) = δ(t) u(t) 1 y(t)
y(t) = L −1 [ s12 ] = 1I(t)t s2
Undamped oscillator
u(t) = δ(t) u(t) 1 y(t)
y(t) = L −1 [ s21+1 ] = 1I(t) sin t s2 + 1
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 18 / 28
Lecture: Transfer functions Transfer functions
u(t) y(t)
G(s)
The roots pi of D(s) are called the poles of the linear system G(s)
The roots zi of N(s) are called the zeros of G(s)
G(s) is often written in zero/pole/gain form
(s − z1 ) . . . (s − zm )
G(s) = K
(s − p1 ) . . . (s − pn )
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 19 / 28
Lecture: Transfer functions Transfer functions
Examples
Example 1
s+2 s+2
G(s) = =
s3 + 2s2 + 3s + 2 (s + 1)(s2 + s + 2)
p p
poles: {−1, − 21 + j 2
7
, − 21 −j 2
7
}, zeros: {−2}
Example 2
MATLAB
» G=tf([2 22],[1 11 10])
2s + 22 2(s + 11) » zpk(G)
G(s) = =
s2 + 11s + 10 (s + 10)(s + 1) Zero/pole/gain:
2 (s+11)
poles: {−10, −1}, zeros: {−11} --------
(s+10) (s+1)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 20 / 28
Lecture: Transfer functions Transfer functions
Adj A
A−1 =
det A
The adjugate matrix is the transpose of the cofactor matrix C of A
Numerical caveat
MATLAB MATLAB
» tic; x=inv(A)*b; toc » tic; x=A\ b; toc
elapsed_time = elapsed_time =
2.2190 0.8440
First A is inverted, an operation that The linear system is solved using Gauss
costs O(n3 ) arithmetic operations method, an operation that costs O(n2 )
arithmetic operations
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 23 / 28
Lecture: Transfer functions Linear algebra recalls
Linear system
ẋ(t) = Ax(t) + Bu(t)
NG (s)
y(t) = Cx(t) + Du(t) G(s) = C(sI − A)−1 B + D ¬
x(0) = 0 DG (s)
C Adj(sI − A)B
C(sI − A)−1 B + D = C +D
det(sI − A)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 24 / 28
Lecture: Transfer functions Linear algebra recalls
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 25 / 28
Lecture: Transfer functions Linear algebra recalls
yr = (−CA−1 B + D) ur
| {z }
DC gain
DC gain - Example
− 21 − 12 2
ẋ(t) = 1 x(t) + u(t)
0 0
2
1 3
y(t) = 4 4
x(t)
−1
− 21 − 12 2
DC gain: − [ 14 3
4 ] 1
0 0 =3
2
2s+3
Transfer function: G(s) = 4s2 +2s+1
. G(0)=3
6 6
Output y(t) for different initial
5 5
conditions and input u(t) ≡ 1
4 4
MATLAB
y(t)
u(t)
3 3
»sys=tf([2 3],[4 2 1]);
2 2 »dcgain(sys)
1 1 ans =
0 0 3
0 10 20 30 0 10 20 30
t t
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 27 / 28
Lecture: Transfer functions Linear algebra recalls
English-Italian Vocabulary
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 28 / 28