Sei sulla pagina 1di 28

Lecture: Transfer functions

Automatic Control 1

Transfer functions

Prof. Alberto Bemporad

University of Trento

Academic year 2010-2011

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 1/1
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

The Laplace transform L [f ] of f is the function


F : C C of complex variable s C defined by 1

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

Once F(s) is computed using the integral, its


extended to all s C for which F(s) makes sense

Laplace transforms convert integral and differential


Pierre-Simon Laplace equations into algebraic equations. Well see how ...
(1749-1827)

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 2/1
Lecture: Transfer functions Laplace transform

Examples of Laplace transforms

Unit step
Z + +
if t < 0 1 1

0 st
f (t) = 1I(t) = F(s) = e dt = =
1 if t 0 s 0 s
0

Diracs delta (or impulse function1 )


Z +
if t 6= 0

0
f (t) = (t) such that (t) = 1
+ if t = 0

Z +
F(s) = (t)est dt = es0 = 1, s C
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, Diracs is a distribution, not a function


Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 3/1
Lecture: Transfer functions Laplace transform

Properties of Laplace transforms


Linearity
L [k1 f1 (t) + k2 f2 (t)] = k1 L [f1 (t)] + k2 L [f2 (t)]

2
Example: f (t) = (t) 2 1I(t) L [f ] = 1 s

Time delay
L [f (t )] = es L [f (t)]

3e2s
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 ] = sa
e jt
+ejt
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/1
Lecture: Transfer functions Laplace transform

Properties of Laplace transforms

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+ ) = limt0+ 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/1
Lecture: Transfer functions Laplace transform

Initial and final value theorems

Initial value theorem

lim f (t) = lim sF(s)


t0+ s

1 1
Example: f (t) = 1I(t) t 1I(t) F(s) = s s2
f (0+ ) = 1 = lims sF(s)

Final value theorem

lim f (t) = lim sF(s)


t+ s0

1 1
Example: f (t) = 1I(t) et 1I(t) F(s) = s s+1
f (+) = 1 = lims0 sF(s)

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 6/1
Lecture: Transfer functions Laplace transform

Convolution

The convolution h = f g of two signals f and g is the signal


Z t
h(t) = f ()g(t )d
0

Its easy to see that h = f g = g f


The Laplace transform of the convolution:

L [f (t) g(t)] = L [f (t)]L [g(t)]

Laplace transforms turn convolution into multiplication !

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 7/1
Lecture: Transfer functions Laplace transform

Common Laplace transforms


ecific

1
1
s
1

(k) sk
In MATLAB use
1
t F = LAPLACE(f)
s2
k
t 1
,k0
k! sk+1 MATLAB
eat
1 syms t
sa f=exp(2*t)+t-t2
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/s2-2/s3
cos(t + )
s2 + 2
s+a
eat cos t
(s + a)2 + 2

eat sin t
(s + a)2 + 2

courtesy of S. Boyd, http://www.stanford.edu/~boyd/ee102/

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 8/1
Table of Laplace Transforms
Lecture: Transfer functions Laplace transform

Remember that we consider all functions (signals) as defined only on t 0.


Properties of Laplace transforms
General
!
f (t) F (s) = f (t)est dt
0

f +g F +G

f ( R) F

df
sF (s) f (0)
dt
k
d f df dk1 f
sk F (s) sk1 f (0) sk2 (0) k1 (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 0t<T
g(t) = , T 0 G(s) = esT F (s)
f (t T ) t T

courtesy of S. Boyd, http://www.stanford.edu/~boyd/ee102/

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 9/1
Lecture: Transfer functions Transfer functions

Transfer function

Lets apply the Laplace transform to continuous-time linear systems

= Ax(t) + Bu(t)

x(t)
y(t) = Cx(t) + Du(t)
x(0) = x0

Define X(s) = L [x(t)], U(s) = L [u(t)], Y(s) = L [y(t)]


Apply linearity and time-derivative rules

= AX(s) + BU(s)

sX(s) x0
Y(s) = CX(s) + DU(s)

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 10 / 1
Lecture: Transfer functions Transfer functions

Transfer function

X(s) = (sI A)1 x0 + (sI A)1 BU(s)


Y(s) = C(sI A)1 x0 + (C(sI A)1 B + D)U(s)
| {z } | {z }
Laplace transform Laplace transform
of natural response of forced response

Definition
The transfer function of a continuous-time linear system (A, B, C, D) is the ratio

G(s) = C(sI A)1 B + D

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 / 1
Lecture: Transfer functions Transfer functions

Transfer function
u(t) y(t) U(s) Y(s)
A,B,C,D G(s)

x0=0

Example: The linear system



x(t) = 10 1 0
x(t) + u(t)
0 1 1
 
= 2 2 x(t)

y(t)

has the transfer function


MATLAB
sys=ss([-10 1;
2s + 22
G(s) = 2 0 -1],[0;1],[2 2],0);
s + 11s + 10 G=tf(sys)

Note: The transfer function does not depend on the Transfer function:
2 s + 22
input u(t)! Its only a property of the linear system. ----------
s2 + 11 s + 10

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 12 / 1
Lecture: Transfer functions Transfer functions

Transfer functions and linear ODEs


Consider the nth -order differential equation with input
dy(n) (t) dy(n1) (t)
n
+ an1 + + a1 y(t) + a0 y(t) =
dt dtn1
du(m) (t) du(m1) (t)
bm + b m1 + + b1 u(t) + b0 u(t)
dtm dtm1

For initial conditions y(0) = y(0) = y(n1) (0) = 0, we obtain immediately the transfer
function from u to y

bm sm + bm1 sm1 + + b1 s + b0
G(s) =
sn + an1 sn1 + + a1 s + a0

Example
MATLAB
G=tf([2 22],[1 11 10])
y + 11y + 10y = 2u + 22u
Transfer function:
2 s + 22
2s + 22 ----------
G(s) = s2 + 11 s + 10
s2 + 11s + 10
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 13 / 1
Lecture: Transfer functions Transfer functions

Example

Differential equation

y(t) + 3y(t) + y(t) = u(t) + u(t)

The transfer function is


s+1
G(s) =
s2 + 3s + 1
The same transfer function G(s) can be obtained through a state-space
realization
x(t) = 0 1 0
x(t) + u(t)
1 3 1
 
y(t) = 1 1 x(t)

from which we compute


1
 1 s+1

 0 0 1 0
G(s) = 1 1 s =
0 1 1 3 1 s2 + 3s + 1

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 14 / 1
Lecture: Transfer functions Transfer functions

Some common transfer functions

Integrator
Z t
u(t) 1 y(t)
=

x(t) u(t) y(t) = u()d s
y(t) = x(t) 0

Double integrator
t
x1 (t) = x2 (t)
ZZ
u(t) 1 y(t)
x2 (t) = u(t) y(t) = u()d s2
0
y(t) = x1 (t)

Damped oscillator with frequency 0 rad/s and damping factor

0

x(t) = 0 0 k02
x(t) + u(t) u(t) y(t)
0 20 k0 s2 + 20s + 02
 
y(t) = 1 0 x(t)

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 15 / 1
Lecture: Transfer functions Transfer functions

Inverse Laplace transform

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
2j j

where is large enough that F(s) is defined for s


This formula is not used very often

MATLAB
In MATLAB use syms s
F=2*s/(s2+1)
f=ilaplace(F)
f = ILAPLACE(f)
f = 2*cos(t)

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 16 / 1
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:

impulse response y(t)


0.3

0.25
2
G(s) = 2 0.2
s + 3s + 1 0.15

0.1

1 2t
L [G(s)] = 2te 0.05

0
0 1 2 3 4 5 6
t

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 17 / 1
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 / 1
Lecture: Transfer functions Transfer functions

Poles and Zeros

u(t) y(t)
G(s)

Rewrite the transfer function as the ratio of polynomials (m < n)

bm sm + bm1 sm1 + + b1 s + b0 N(s)


G(s) = =
s + an1 s
n n1 + + a1 s + a0 D(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 )

In MATLAB use ZPK to transform to zero/pole/gain form

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 19 / 1
Lecture: Transfer functions Transfer functions

Examples

Example 1
s+2 s+2
G(s) = =
s3 + 2s + 3s + 2
2 (s + 1)(s2 + s + 2)
p p
poles: {1, 21 + j 7 1
2 ,2 j 7
2 }, 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 / 1
Lecture: Transfer functions Transfer functions

Partial fraction decomposition


The partial fraction decomposition of a rational function G(s) = N(s)/D(s) is
(assuming pi 6= pj )3
1 n
G(s) = + +
s p1 s pn
i is called the residue4 of G(s) in pi C
i = lim (s pi )G(s)
spi

The inverse Laplace transform of G(s) is easily computed by inverting each


term
L 1 [G(s)] = 1 ep1 t + + n epn t
3
For multiple poles pi with multiplicity k we have the terms
i1 ik 1 d(kj)
+ + , ij = lim [(s pi )k G(s)]
(s pi ) (s pi )k (k j)! spi ds(kj)
and the inverse Laplace transform is
tk1 pi t
i1 epi t + + ik e
(k 1)!
4
Residues of conjugate poles are conjugate of each other: pi = pj i = j
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 21 / 1
Lecture: Transfer functions Linear algebra recalls

Linear algebra recalls


The inverse of a matrix A Rnn

a11 a12 ... a1n
a
21 a22 ... a2n
A = ..

. .
. .
. . ... .
an1 an2 ... ann

is the matrix A1 such that A1 A = AA1 = I


The inverse A1 can be computed using the adjugate matrix Adj A

Adj A
A1 =
det A
The adjugate matrix is the transpose of the cofactor matrix C of A

Adj A = CT , Cij = (1)i+j Mij

where Mij is the (i, j) cofactor of A, that is the determinant of the


(n 1) (n 1) matrix that results from deleting row i and column j of A
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 22 / 1
Lecture: Transfer functions Linear algebra recalls

Numerical caveat

Consider the linear system of n equalities Ax = b in the unknown vector


x Rn (A Rnn , b Rn )
If det A 6= 0, the unique solution is x = A1 B
However, computing A1 is not a smart thing to do for finding x !
Numerical example: n=1000; A=rand(n,n)+10*eye(n); b=rand(n,1);

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 / 1
Lecture: Transfer functions Linear algebra recalls

Poles, eigenvalues, modes

Linear system

x(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)

Use the adjogate matrix to represent the inverse of sI A

C Adj(sI A)B
C(sI A)1 B + D = +D
det(sI A)

The denominator DG (s) = det(sI A) !

The poles of G(s) coincide with the eigenvalues of A

Well, not always ...

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 24 / 1
Lecture: Transfer functions Linear algebra recalls

Poles, eigenvalues, modes

Some eigenvalues of A may not be poles of G(s) in case of pole/zero


cancellations
Example:
1 0 0  
A= , B= , C= 0 1
0 1 1
det(sI A) = (s 1)(s + 1)
1
 
1

  0 0
G(s) = 0 1 s1
1 =
0 s+1
1 s+1

The pole s = 1 has no influence on the input/output behavior of the system


(but it has influence on the free response x1 (t) = et x10 )
Well better understand cancellations when investigating reachability and
observability properties

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 25 / 1
Lecture: Transfer functions Linear algebra recalls

Steady-state solution and DC gain


Let A asymptotically stable. Natural response vanishes asymptotically
Assume constant u(t) ur . What is the asymptotic value xr = limt x(t) ?

Impose 0 = xr (t) = Axr + Bur and get xr = A1 Bur

The corresponding steady-state output yr = Cxr + Dur is

yr = (CA1 B + D) ur
| {z }
DC gain

Cf. final value theorem:

yr = lim y(t) = lim sY(s)


t+ s0
ur
= lim sG(s)U(s) = lim sG(s)
s0 s s0
1
= G(0)ur = (CA B + D)ur

G(0) is called the DC gain of the system


Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 26 / 1
Lecture: Transfer functions Linear algebra recalls

DC gain - Example

21 12
 
2
x(t) = 1 x(t) + u(t)
2 0 0
1 3
 
=

y(t) 4 4 x(t)
i1  
12 21
h
DC gain: [ 14 3
4 ] 1
0
2
0 =3
2
2s+3
Transfer function: G(s) = 4s2 +2s+1 . We have 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 / 1
Lecture: Transfer functions Linear algebra recalls

English-Italian Vocabulary

transfer function funzione di trasferimento


Laplace transform trasformata di Laplace
unit step gradino unitario
delay ritardo
damped oscillator oscillatore smorzato
impulse response risposta allimpulso
inverse Laplace transform antitrasformata di Laplace
partial fraction decomposition decomposizione in fratti semplici
DC gain guadagno in continua
steady-state regime stazionario

Translation is obvious otherwise.

Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 28 / 1

Potrebbero piacerti anche