cs:4980 foundaons of embedded systemstinelli/classes/4980/spring16/notes/...q is there in fact a way...
TRANSCRIPT
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
ControlDesignProblem
PlantmodelasCon/nuous-/meComponentH
UncontrolledInputs ObservableOutputs
q WewanttodesignacontrollerCsothatC||Hisstableq Isthereamathema/calwaytocheckwhenasystemisstable?
q IsthereinfactawaytodesignCsothatC||Hisstable?q Yes,iftheplantmodelislinear
ControllerC
ControllableInputs
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
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]θ
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)
(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
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)
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
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)
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
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
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
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
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!
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
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=…
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
BacktoEquilibriaandStability
Henceforth,wewillfocusonclosedlinearsystemsHandtheirequilibriumstate0
Defini;on:
1. Hisstableifstate0isstable2. Hisasympto,callystableifstate0isasympto/callystable
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!
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!
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
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
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
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
Credits
NotesbasedonChapter6ofPrinciplesofCyber-PhysicalSystemsbyRajeevAlurMITPress,2015