Chaper EEE83 EEE3 Chaper # EEE83 EEE3 Linear Conroller Design and Sae Space Analysis Ordinary Differenial Equaions.... Inroducion.... Firs Order ODEs... 3. Second Order ODEs... 7 3. General Maerial... 7 3. Roos are real and unequal... 3.4 Roos are Complex (and hence no equal)... 3 3.3 Roos are real and equal... 5 4. Tuorial Exercise I... 9 Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /9
Chaper EEE83 EEE3 Ordinary Differenial Equaions. Inroducion To undersand he propeies (dynamics) of a sysem, we can model (represen) i using differenial equaions (DEs). The response/behaviour of he sysem is found by solving he DEs. In our cases, he DE is an Ordinary DE (ODE), i.e. no a paial derivaive. The main purpose of his Chaper is o learn how o solve firs and second order ODEs in he ime domain. This will serve as a building block o model and sudy more complicaed sysems. Our ulimae goal is o conrol he sysem when i does no show a saisfacory behaviour. Effecively, his will be done by modifying he ODE. Noe for EEE83 sudens: There are foonoes hroughou he noes, which is assessed maerial!. Firs Order ODEs The general form of a firs order ODE is: d f x, () where x, Analyical soluion: Explici formula for x() (a soluion which can be found using various mehods) which saisfies f ( x, ) d The proper noaion is x() and no x bu we drop he brackes in order o simplify he presenaion. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /9
Chaper EEE83 EEE3 Example.: Prove ha x e and x e are soluions of 3x d. de 3x 3e 3e 3e d d de 3x 3e 3e 3e d d Obviously here are infinie soluions o an ODE and for ha reason he found soluion is called he General Soluion of he ODE. Firs order Iniial Value Problem : f ( x, ), x x An iniial value problem is an ODE wih an iniial condiion, hence we do no find he general soluion bu he Specific Soluion ha passes hrough x a =. d Analyical soluion: Explici formula for x() which saisfies f ( x, ) and d passes hrough x when. Example.: Prove ha x e is a soluion, while x e is no a soluion of 3, xx d Boh expressions ( x e and x e ) saisfy he 3x bu a = d x e x x e x 3 clc, clear all, syms, x=exp(-3*); =diff(x,); isequal(,-3*x) x=-*exp(-3*); =diff(x,); isequal(,-3*x) 3 clc, clear all, syms, x=exp(-3*); x=-*exp(-3*); x=; x_=double(subs(x,,)); x_=double(subs(x,,)); isequal(x,x_), isequal(x,x_), Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 3/9
Chaper EEE83 EEE3 For ha reason some books use a differen symbol for he specific soluion:,, x. You mus be clear abou he difference beween an ODE and he soluion o an IVP! From now on we will jus sudy IVP unless oherwise explicily menioned. Linear Firs Order ODEs A linear s order ODE is given by: x' b x c, a a ax' bx c, a Non auonomous Auonomous () wih a,b,c and a. In engineering books he mos common form of () is (since a ): x' kx u (3) wih k,u Noe: We say ha u is he inpu o our sysem ha is represened by (3) The soluion of (3) (using he inegraing facor) is given by: k k k x e x e e u d Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 4/9
Chaper EEE83 EEE3 k The erm e x is called ransien response, while comes k k e e u d from he inpu signal u. If we assume ha u is consan: k k k x e x e e ud x e k x u e k k Hence: lim x u u/ k, k k, k Thus we say ha if k> he sysem is sable (and he soluion converges exponenially a u/k) while if k< he sysem is unsable (and he soluion diverges exponenially o, ). Example.3: u= and k= & 5, x= x e,limx,as >.5 Transien Toal.5 Transien Toal Inpu componen Inpu componen -.5.5.5 -.5.5.5 4 4 clc, clear all, syms x(), =diff(x); dsolve(+*x, x()==) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 5/9
Chaper EEE83 EEE3 Example.4: u= and k=- & 5, x= 6 5 4 3 Toal Transien Inpu componen.5 x 4.5.5 Toal Transien Inpu componen.5.5 Example.5: u= and k=5, x= & 5.5.5 5.5 Toal Transien Inpu componen 4 3 Toal Transien Inpu componen.5.5.5 Example.6: u=- & and k=5, x=.5 Transien Inpu componen Toal -.5.5.5.5.5.8.6.4. Toal Transien Inpu componen.5.5 5 5 clc, clear all, close all, syms, x=; k=5; =; u=; =:.:; x_x=exp(-k*)*x; x_u=exp(-k*)*in(exp(k*)*u,,); x_x_=double(subs(x_x,,)); x_u_=double(subs(x_u,,)); hold on, plo(,x_x_), plo(,x_u_), plo(,x_u_+x_x_) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 6/9
Chaper EEE83 EEE3 Commens: In real sysems we canno have a sae (say he speed of a mass-spring sysem) ha becomes infinie, obviously he sysem will be desroyed when x ges o a high value. For he dynamics (seling ime, sabiliy ) of he sysem we should only focus on he homogenous ODE: x' k x 3. Second Order ODEs 3. General Maerial A second order ODE has as a general form: f x', x, d (4) A linear nd order ODE is given by: x'' A x' B x u, Non auonomous x'' Ax' Bx u, Auonomous (5) And again we focus on auonomous homogeneous sysems: x'' A x' B x (6) Again we define as an analyical soluion of (6) an expression ha saisfies i. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 7/9
Chaper EEE83 EEE3 Example.7: Given x'' x' 3x prove ha soluions: e '' e ' 3 e 9e 6e 3e e '' e ' 3 e x e and x e are wo e e 3e 6 Assume ha you have soluions for a nd order ODE x and x (we will see laer how o ge hese wo soluions), hen: x A x B x x A x B x obviously I can muliply hese wo equaions wih arbirary consans: Cx CA x CB x Cx CA x CB x and now I can add hem and collec similar erms: Cx C x '' A Cx C x ' B Cx C x Common Term Common Term Common Term which means ha Cx Cx is also a soluion of he ODE. (i.e. he linear combinaion of x and x) 6 clc, clear all, close all, syms x() Dx=diff(x); Dx=diff(x,); ODE=Dx-*Dx-3*x; subs(ode, x, exp(-)), subs(ode, x, exp(3*)) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 8/9
Chaper EEE83 EEE3 Example.8: Given x'' x' 3x prove ha e e '' e e ' 3 e e e e e e e e 9 3 3 6 9e e 6e 4e 3e 6e 9e 6e 3e e 4e 6e x e e is a soluion: 7 Now, he quesion is, if we have x and x, can ALL oher soluions of he ODE, be expressed as a linear combinaion of x and x? So assume a hird soluion : A B '' ' Now, he quesion can be wrien as, can we find consans C and C such as: Cx Cx ' C x ' C x ' This equaion can be seen as a by sysem wih unknowns C and C as: C x x x' x' C ' From linear algebra his sysem of equaions has a unique soluion if: 7 clc, clear all, close all, syms x() ; Dx=diff(x); Dx=diff(x,); ODE=Dx-*Dx-3*x; subs(ode, x, exp(3*)+exp(-)) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 9/9
Chaper EEE83 EEE3 ' ' x x x x x x ' x x ' Noe: The marix W x, x of he ODE. ' ' x x x x is called he Wronskian 8 We also know from linear algebra ha he deerminan is no zero if: ' ' x x C x x So if he wo soluions x and x are linear independen (LI) hen ANY oher soluion can be described by he linear combinaion of x and x. So now we have o look for wo LI soluions for he nd order ODE. Example.9: Prove ha wo soluions of x'' x' 3x, x e are linear independen. x e and x x e e e e Wx, x W x' x' 3e e 3e e 3 3 3 3 4 W e e e e e e e 9 8 From he Polish mahemaician Józef Maria Hoëne-Wroński 9 clc, clear all, close all, syms, x=exp(3*); x=exp(-); Dx=diff(x); Dx=diff(x); W=[x, x; Dx, Dx], de(w) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /9
Chaper EEE83 EEE3 Example.: Prove ha wo soluions of x'' x' 3x, x e are NOT linear independen. 3 x e and W x x x x e e, x' x' 3e 6e e e 6 6 6 6 W e e 3e 6e Example.: For he ODE x'' x' 3x prove ha he soluion 3 x e e canno be wrien as any combinaion of x e and x e. 3 3 3 3 x Cx Cx e e Ce Ce C C e From his expression we have ha C C (and hence we have he erm e ) bu here is no erm e for e. Bu how can we find wo LI soluions? For homogeneous s order ODEs wih k u= he soluion was: x e C so we will ry a similar approach for nd order ODEs: x '' Ax' Bx, assume x e => x' re & x' ' r e => x '' Ax' Bx r e Are Be r Ar B (7) This is called he Characerisic Equaion (CE) and we have o check is roos: r A A 4B, hese are he Characerisic values or Eigenvalues. Noice ha we do NOT know wha is he value of r. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /9
Chaper EEE83 EEE3 3. Roos are real and unequal If A 4B he sysem is called Overdamped and he wo roos are r and r wih r r, r, r. Then soluions as: ' ' r x x e e x x re re e and r x e x e re e re are wo linear independen hence he general soluion is r Cx Cx Ce Ce (8) x If r and r < hen x and he sysem is sable. If r or r > hen x and he sysem is unsable. Example.: The CE of x'' x' 3x is r r3 which means 43 r 5 ha he wo roos are: r, r 6 5 x e e and hence he LI soluions are 6 x e e 5 6 This means ha he general soluion is x Ce Ce and hence he ODE is sable. The Wronskian is x x e e 6 5 e x x e e 5 6 5 6 6 5 e e e e 5 6 ' ' 5 6 If he iniial condiion is x, x' hen: roos([ 3]) clc, clear all, close all, syms x() Dx=diff(x,); Dx=diff(x,); ODE=Dx+*Dx+3*x; dsolve(ode) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /9
Chaper EEE83 EEE3 C C C 6 x 6e 5e 5C6C C 5 5 6 3 3.4 Roos are Complex (and hence no equal) If A 4B hen he sysem is called Underdamped and he wo roos are r abj and r r abj wih r r, r, r. Then a bj and x e e are wo linear independen soluions as x e e a bj e abj e a bj e a bj e e a bj e abj abj abj e abj e a a a a abje abje e abjabje bj a bj a bj a bj a bj Hence he general soluion is x Cx Cx Ce Ce (9) bu remember ha C and C are complex now variables such as x. Example.3: The CE of x'' x' 5x is r r5 which means 6 4j r j ha he wo roos are: r, j r j j x e e and hence he LI soluions are j x e e 3 clc, clear all, close all, syms x() Dx=diff(x,); Dx=diff(x,); ODE=Dx+*Dx+3*x; dsolve(ode, x()==, Dx()==) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 3/9
Chaper EEE83 EEE3 j This means ha he general soluion is x Ce C e ODE is sable. The Wronskian is x x e j j j x ' x' j e j e j j j j j e e j e e j e j e j j e 4je If he iniial condiion is x jc e j and hence he j, x' hen: C C j C 4 jc C j x je je 4 4 j j 4 An alernaive approach is no o use x & x bu a linear combinaion of hem: y e e, y e e e e e e Noe ha re re re re Using Euler s formula: abj a e e cosb jsin b and hence: a bj a bj a a y e e e cosb jsinbcosb jsinb e cosb a bj a bj a a y e e e cosb jsinb cosb jsinb je sinb Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 4/9
Chaper EEE83 EEE3 As y and y are soluions so do y, y. So he general soluion when j we have complex roos is: a x e CcosbC sin b, CC, () Example.4: The CE of x'' x' 5x is r r5 which means 6 4j r j ha he wo roos are: r, j r j x e cos and hence he LI soluions are x e sin This means ha he general soluion is x e Ccos Csin and hence he ODE is sable. The Wronskian is x x e cos e sin e x ' x ' e cos e sin e sin e cos If he iniial condiion is x, x' hen: C C CC C.5 x e cos.5sin 3.3 Roos are real and equal If A 4Bhen he sysem is called Criically damped and he wo roos are r r r wih r. One soluion is x e bu how abou x? We can use x e and he general soluion: x C x C x Ce C e () Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 5/9
Chaper EEE83 EEE3 The Wronskian is: e e re e e e e e re e e e e e Example.5: The CE of x'' x' x is r r which means ha r he wo roos are: r, r x e and hence he LI soluions are x e This means ha he general soluion is x Ce Ce and hence he ODE is sable. The Wronskian is e e e e e e If he iniial condiion is x C C CC C x e e, x' hen: No assessed maerial To see why x e is he nd soluion go o he ODE and place e '' Ae ' Bxe r Ar B Since r is a double roo of he CE: a. So: e '' A e ' Bxe a r r Taking he ime derivaive w r: x e : r ArBa r r for some consan Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 6/9
Chaper EEE83 EEE3 '' ' d e d e d e d e a r r A B dr dr dr dr And as we can change he sequence of he differeniaion: d e ar r '' ' d e d e d e A B dr dr dr dr By using simple calculus: '' ' e Ae Beear r ear r '' ' d e d a r r e Ae Be ar r e dr dr '' ' By placing now where r=r: Which means ha e e re re e And hence e Ae Be e mus be a soluion of my ODE and: e re e e re re e re e x e is my second soluion. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 7/9
Chaper EEE83 EEE3 Roo Space jb jb a a Sable Unsable Name Oscillaions? Componens of soluion Overdamped No Two exponenials: Criically damped No k k e, e, k k, Two exponenials: k k e, e, k Underdamped Yes One exponenial and one cosine e k cos,, k Undamped Yes one cosine cos Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 8/9
Chaper EEE83 EEE3 4. Tuorial Exercise I. By using he general form of he analyic soluion ry o predic he response of he following sysems. Your answer mus describe he sysem as sable/unsable, convergen o zero/nonzero value. Crosscheck your answer by solving he DE: d 5 6x, x, x, x d 5 6x, x, x, x d 5 6x, x, x, x d 5 6x, x, x, x d 3, x, x, x. Find he soluion of x 6x 5x, x, x 3. Briefly describe how he soluion behaves for hese iniial condiions. Draw a skech of he response. 3. Find he soluion of x x 6x, x, x. Briefly describe how he soluion behaves for hese iniial condiions. Draw a skech of he response. 4. Find he soluion of x x.5x, x, x / 3. Briefly describe how he soluion behaves for hese iniial condiions. Draw a skech of he response. 5. Find he Wronskian marices of he soluions of Q-5. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 9/9