cs:4980 foundaons of embedded systemstinelli/classes/4980/spring16/notes/...q is there in fact a way...

25
CS:4980 Founda/ons of Embedded Systems Copyright 20014-16, Rajeev Alur and Cesare Tinelli. Created by Cesare Tinelli at the University of Iowa from notes originally developed by Rajeev Alur at the University of Pennsylvania. These notes are copyrighted materials and may not be used in other course settings outside of the University of Iowa in their current form or modified form without the express written permission of one of the copyright holders. During this course, students are prohibited from selling notes to or being paid for taking notes by any person or commercial firm without the express written permission of one of the copyright holders. Dynamical Systems Part III

Upload: lekhuong

Post on 07-May-2019

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

CS:4980Founda/onsofEmbeddedSystems

Copyright 20014-16, Rajeev Alur and Cesare Tinelli. Created by Cesare Tinelli at the University of Iowa from notes originally developed by Rajeev Alur at the University of Pennsylvania. These notes are copyrighted materials and may not be used in other course settings outside of the University of Iowa in their current form or modified form without the express written permission of one of the copyright holders. During this course, students are prohibited from selling notes to or being paid for taking notes by any person or commercial firm without the express written permission of one of the copyright holders.

DynamicalSystemsPartIII

Page 2: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

ControlDesignProblem

PlantmodelasCon/nuous-/meComponentH

UncontrolledInputs ObservableOutputs

q WewanttodesignacontrollerCsothatC||Hisstableq  Isthereamathema/calwaytocheckwhenasystemisstable?

q  IsthereinfactawaytodesignCsothatC||Hisstable?q  Yes,iftheplantmodelislinear

ControllerC

ControllableInputs

Page 3: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

LinearComponent

Alinearexpressionovervariablesx1,x2,…xnisoftheforma1x1+a2x2+…+anxn

wherea1,a2,…arera/onalconstants

Acon/nuous-/mecomponentHwithstatevariablesS,inputvariablesI,andoutputvariablesOislinearif

§  foreverystatevariablex,thedynamicsisgivenbydx=fx(S,I),wherefxisalinearexpression

§  foreveryoutputvariabley,yisdefinedbyy=hy(S,I),wherehyisalinearexpression

Examples

§  linear:heaYlow,car,helicopter§  nonlinear:pendulum

Page 4: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Con/nuous-/meComponentCar2

v

F

dx=vdv=(F–kv–mgsin(θ))/m

realxL<=x<=xUvL<=v<=vU

q  Right-handsideofdvequa/onnotlinear

q  Easyfix:replacedisturbanceθbyanothervariablesθ=sinθ

real[–π/6,π/6]θ

Page 5: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Con/nuous-/meComponentCar2

v

F

dx=vdv=(F–kv–mgsθ)/m

realxL<=x<=xUvL<=v<=vU

real[sin(–π/6),sin(π/6)]sθ

Rewri/ngtonormalform:

dx/dt=0x+1v+0F+0sθdv/dt=0x+(–k/m)v+(1/m)F+(–g)sθ

v=0x+1v+0F+0sθ

Matrix-basedrepresenta/on:

S=(xv)TI=(Fsθ)TO=(v)

dS/dt=AS+BI

O=CS+DI

A=01B=000-k/m1/m-g

C=(01)D=(00)

Page 6: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

(A,B,C,D)Representa/onofLinearComponents

Supposealinearcon/nuous-/mecomponenthas§  nstatevariablesS={x1,x2,…xn}§  minputvariablesI={u1,u2,…um}§  koutputvariablesO={y1,y2,…yk}

Thenthedynamicsisgivenby

dS/dt=AS+BIandO=CS+DIwhere

Aisann×nmatrix Cisak×nmatrix

Bisann×mmatrix Disak×mmatrix

Therateofchangeofi-thstatevariableandthevalueofj-thoutputare

dxi/dt=Ai,1x1+Ai,2x2+…+Ai,nxn+Bi,1u1+Bi,2u2+…+Bi,mum

yj=Cj,1x1+Cj,2x2+…+Cj,nxn+Dj,1u1+Dj,2u2+…+Dj,mum

Page 7: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Input-OutputLinearity

Con/nuous-/meComponentH

InputsI OutputsO

Withafixedini/alstate,acon/nuous-/mecomponentHmapsinputsignalsI(t)tooutputsignalsO(t)

Theorem:IfHislinear,thenbothofthefollowinghold.§  Scaling:IftheoutputresponseofHtotheinputsignalI(t)is

O(t),thenforeveryconstantα,theoutputresponseofHtotheinputsignalαI(t)isαO(t)

§  Addi,vity:IftheoutputresponsesofHtotheinputsignalsI1(t)andI2(t)areO1(t)andO2(t),thentheoutputresponseofHtotheinputsignal(I1+I2)(t)is(O1+O2)(t)

Page 8: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

ResponseofLinearSystems

Consideraone-dimensionallinearsystemwithnoinputs:dx/dt=ax;ini/alstatex0

Itsexecu/onisgivenbythesignalx(t)=x0eat

§  Recallthatea=1+∑n>0an/n!

§  Verifythatsolu/onx(t)sa/sfiesthedifferen/alequa/on§  Seetextbookonhowsolu/onisfound

Page 9: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

ResponseofLinearSystems

GeneralCase(noinputs)

q  StatesetS

q  Dynamicsisgivenby dS/dt=AS

ini/alstates0

q  ForeachinputsignalI(t),execu/onisgivenbythesignal S(t)=eAts0

§  At=scalarproductofAandt§  eM=I+∑n>0Mn/n!§  I=iden/tymatrix(Ii,j=if(i=j)then1else0)

Page 10: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

GeneralCase(withinputs)

q  StatesetS,inputsetI

q  Dynamicsisgivenby dS/dt=AS+BI

ini/alstates0

q  ForeachinputsignalI(t),execu/onisgivenbythesignal S(t)=eAts0+∫0t(eA(t–τ)BI(τ)dτ)

ResponseofLinearSystems

Page 11: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

MatrixExponen/al

q Matrixexponen/aleA=I+A+A2/2+A3/3!+A4/4!+…

q  Eachterminthesumisann×nmatrix

q  HowdowecomputeeA?

q  IfAk=0forsomek,thesumisfiniteandcanbecomputeddirectly

q  IfAisadiagonalmatrixD(a1,a2,…,an)(Aij=if(i=j)thenaielse0),theneA=D(ea1,ea2,…,ean)

q  Ingeneral,thesumofthefirstktermswillgiveanapproxima/on(whosequalityispropor/onaltok)

q Otherwise,wecanuseanaly/calmethodsbasedoneigenvaluesandsimilaritytransforma/ons

Page 12: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

EigenvaluesandEigenvectors

q  LetAbeann×nmatrix,λ ascalarvalueandxann-dimensionalnon-zerovector.Iftheequa/onAx=λxholds,thenxisaneigenvectorofA,andλisthecorrespondingeigenvalue

q  Howtocomputeeigenvaluesandeigenvectors?

q Wesolvethecharacteris,cequa,onofA:

det(A–λI )=0

q  Recall:thedeterminantdet(M)ofa2×2matrixMisM1,1M2,2–M1,2M2,1

Page 13: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Theeigenvaluesofann×nmatrixAaretherootsofthecharacteris/cpolynomialp=det(A–λI)

Note:

q  Themul/plicityofaneigenvalue(asarootofp)canbe>1

q  Aneigenvaluecanbeacomplexnumberq  IfAisadiagonalmatrixthenthediagonalentriesarethe

eigenvaluesq  Foragiveneigenvalueλ,wecancomputethecorresponding

eigenvector(s)bysolvingthelinearsystemAx=λ x,withunknownvectorx

q  IfalleigenvaluesofareAdis/nct,thenthesetofcorrespondingeigenvectorsislinearlyindependent

EigenvaluesandEigenvectors

Page 14: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

SimilarityTransforma/on

q  ConsiderdynamicalsystemHwithdynamicsgivenby:

dS/dt=AS;ini/alstates0q  LetPbeaninver/blen×nmatrix

q  ConsidersystemH’withstatevectorS’=P-1Sanddynamics

d/dtS’=d/dt(P-1S)=P-1dS/dt=P-1AS=P-1APS’=JS’

q  ThematrixJ=P-1APissaidtobesimilartoA

q  Theini/alstateoftransformedsystemH’isS’(0)=P-1s0

q  TheresponseofthetransformedsystemH’isgivenby

S’(t)=eJtP-1s0

q  TheresponseoftheoriginalsystemisS(t)=PeJtP-1s0

q Whenisallthisuseful?

q WhenwecanchoosePsothatJisdiagonal!

Page 15: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

SimilarityTransforma/onusingEigenvectors

q  ConsidersystemHwithdynamicsgivenby: dS/dt=AS;ini/alstates0

q  Calculateeigenvaluesλ1,…,λnandsupposetheyarealldis/nct

q  Calculatecorrespondingeigenvectorsx1,…,xn(whichmustbelinearlyindependent)

q  Considerthen×nmatrixP=(x1x2…xn)

q  FinditsinverseP-1(whichmustexistinthiscase)

q  Claim:ThematrixJ=P-1APisthediagonalmatrixD(λ1,…,λn)

q  Execu/onofthesystemisgivenby

S(t)=PD(eλ1t,…,eλnt)P-1s0

Page 16: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Example:ResponseofLinearSystemsConsider2-dimensionalsystemwithdynamicsgivenby

ds1=4s1+6s2 ini/alstate(s1,s2)=(1,1)T

ds2=s1+3s2

1.  Computeeigenvaluesλ1andλ2ofA=((41)T(63)T)§  λ1=6andλ2=1

2.  Computeeigenvectorsx1andx2§  x1=(31)Tandx2=(2-1)T

3.  Choosethesimilaritytransforma/onmatrixP=(x1x2)=((31)T(2-1)T)

4.  ComputetheinverseP-1ofP§  P-1=((-1-1)T(-23)T)/(-3-2)=((1/51/5)T(2/5-3/5)T)

5.  VerifythatJ=P-1APisdiagonalmatrixD(λ1,λ2)=((60)T(01)T)§  J=P-1AP=((6/51/5)T(12/5-3/5)T)((31)T(2-1)T)=((60)T(01)T)

6.  Desiredsolu/onisS(t)=PD(eλ1t,eλ2t)P-1(1,1)T§  S(t)=((31)T(2-1)T)((e6t0)T(0et)T)((1/51/5)T(2/5-3/5)T)(1,1)T=…

Page 17: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

BacktoEquilibriaandStability

q  ConsideraclosedlinearsystemHwithdynamicsgivenby: dS/dt=AS

q  Recall:astatesisanequilibriumstateofHifAs=0

q  Howtocomputeequilibria:solvesystemoflinearequa/ons

q  Claim1:State0isanequilibrium

q  Claim2:IfAisinver/ble,then0isthesoleequilibrium

q  Ifstatesisanon-zeroequilibriumofH,considerthetransformedsystemH’withstateS’=S–s§  Theequilibria0ofH’andsofHhavethesameproper/es

Page 18: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

BacktoEquilibriaandStability

Henceforth,wewillfocusonclosedlinearsystemsHandtheirequilibriumstate0

Defini;on:

1.  Hisstableifstate0isstable2.  Hisasympto,callystableifstate0isasympto/callystable

Page 19: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Stability:One-DimensionalSystem

q  Consideraone-dimensionallinearsystemHwithdynamicsgivenby:dx/dt=axwithsomeini/alstates0

q  Recall:Hisasympto/callystableiff1.  (Stable)Foreveryε >0,thereisaδ >0suchthatforallini/alstates

swith||s||<δandforall/mest,||eats||<ε

2.  (Asympto/cally)Thereisaδ >0suchthatforallini/alstatesswith||s||<δ,||eats||goesto0astgoesto∞

q  Casea<0:eatsconvergesexponen/allyto0astgoesto∞,regardlessofs.Asympto/callystable

q  Casea=0:dynamicsisdx/dt=0.Thestatestaysequaltotheini/alstates.Stablebutnotasympto/callystable

q  Casea>0:eatsgrowsexponen/allyastincreases,andthus,statedivergesawayfrom0.Unstable!

Page 20: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Stability:DiagonalStateDynamics

q  Considern-dimensionallinearsystemHwithdynamicsgivenbydS/dt=AS,whereAisthediagonalmatrixD(a1,…,an)

q  Eachdimensionevolvesindependently:thei-thcomponentofS(t)iseaits0iwheres0istheini/alstatevector

q  Allcoefficientsai<0:Stateconvergestotheequilibrium0nomasertheini/alstate.Asympto/callystable

q  Allcoefficientsai<=0:Stablebutnotasympto/callystableifsomecoefficientaj=0(j-thstatecomponentstaysunchanged)

q  Somecoefficientai>0:Somestatecomponentgrowsunboundedlyawayfromequilibrium0.Unstable!

Page 21: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

SimilarityTransforma/onsandStability

q  ConsidersystemHwithdynamicsgivenby:dS/dt=ASq  LetPbeaninver/blen×nmatrix,andconsiderJ=P-1AP

q  ConsidersystemH’withstateS’=P-1S(andnotethatS=PS’)

q  ResponsesignaloftransformedsystemH’: S’(t)=eJtP-1s0q  ResponsesignaloforiginalsystemH: S(t)=PeJtP-1s0

q  Note:responseofH’isalineartransforma/onofresponseofH

q Ifasignalisbounded,soisitslineartransforma/on

q Ifasignalconvergesto0,sodoesitslineartransforma/on

q  Claim:HisstableiffH’isstable

q  Claim:Hisasympto/callystableiffH’isasympto/callystable

Page 22: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

EigenvaluesandStability

q  ConsiderHwithdynamicsisgivenby:dS/dt=ASq  Supposealleigenvaluesλ1,…,λnarerealanddis/nctq  Thenthesetofeigenvectors,x1,…,xnisguaranteedtobe

linearlyindependent

q  Choosen×nmatrixP=(x1x2…xn)forsimilaritytransforma/on

q  ThematrixJ=P-1APisthediagonalmatrixD(λ1,…,λn)

q  Ifalleigenvaluesarenega/ve,thenthetransformedsystemH’isasympto/callystable,andsoisH

q  Ifalleigenvaluesarenon-posi/ve,thenH’isstable,andsoisH

Theorem:AlinearsystemHwithdynamicsdS/dt=ASisasymptot-icallystableiffeacheigenvalueofAhasanega/verealpart

Page 23: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Con/nuous-/meComponentCar

vF dx=v

dv=(F–kv)/m

q  LetS=(xv)Tq  ThematrixAis((00)T(1-k/m)T)

q  Eigenvalues:0and-k/mq  Stablebutnotasympto/callystable

q  Ifweconsideronlythedimensionv,thenasympto/callystable

Exercise:SetF(t)=0forallt,andanalyzewhathappensifweperturbthesystemfromtheequilibrium(00)T

Page 24: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

LyapunovStabilityvsBIBOStability

q  ConsiderlinearcomponentHwithdynamicsgivenby dS/dt=AS+BIO=CS+DI

q  BIBOstability:Star/ngfromini/alstate0,iftheinputisaboundedsignal,outputmustbeaboundedsignal

q  Theorem:Forlinearcomponents,asympto/cstabilityimpliesBIBOstability

q Note:Asympto/cstabilitydependsonlyontheproper/esofmatrixA

q  Proofofthetheoremreliesofanalysisofdynamicalsystemsusingtransferfunc/ons

Page 25: CS:4980 Foundaons of Embedded Systemstinelli/classes/4980/Spring16/notes/...q Is there in fact a way to design C so that C || H is stable ? q Yes, if the plant model is linear Controller

Credits

NotesbasedonChapter6ofPrinciplesofCyber-PhysicalSystemsbyRajeevAlurMITPress,2015