Example: bankruptcy

Lecture 2 - Modeling and Simulation - Stanford University

EE392m - Winter 2003 Control Engineering2-1 Lecture 2 - Modeling and Simulation Model types: ODE, PDE, State Machines, Hybrid Modeling approaches: physics based (white box) input-output models (black box) Linear systems Simulation Modeling uncertaintyEE392m - Winter 2003 Control Engineering2-2 Goals Review dynamical Modeling approaches used for controlanalysis and Simulation Most of the material us assumed to be known Target audience people specializing in controls - practicalEE392m - Winter 2003 Control Engineering2-3 Modeling in Control Engineering Control in asystemperspectivePhysical syst emMeasurementsystemSensorsControlcomputi ngControlhandlesActuatorsPhysicalsystem Control analysisperspectiveControlcomputing System modelControlhandlemodelMeasurementmodelE E392m - Winter 2003 Control Engineering2-4 Models

computational dynamics (pencil & paper computations) – deterministic model-based prediction 1749-1827 1643-1736 v r. EE392m - Winter 2003 Control Engineering 2-7 Orbital mechanics example ... – fluid dynamics – structural deformations • Example: sideways heat equation 1 2 2

Tags:

  Lecture, Computational, Fluid, Modeling, Simulation, Lecture 2 modeling and simulation

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Lecture 2 - Modeling and Simulation - Stanford University

1 EE392m - Winter 2003 Control Engineering2-1 Lecture 2 - Modeling and Simulation Model types: ODE, PDE, State Machines, Hybrid Modeling approaches: physics based (white box) input-output models (black box) Linear systems Simulation Modeling uncertaintyEE392m - Winter 2003 Control Engineering2-2 Goals Review dynamical Modeling approaches used for controlanalysis and Simulation Most of the material us assumed to be known Target audience people specializing in controls - practicalEE392m - Winter 2003 Control Engineering2-3 Modeling in Control Engineering Control in asystemperspectivePhysical syst emMeasurementsystemSensorsControlcomputi ngControlhandlesActuatorsPhysicalsystem Control analysisperspectiveControlcomputing System modelControlhandlemodelMeasurementmodelE E392m - Winter 2003 Control Engineering2-4 Models

2 Model is a mathematical representations of a system Models allow simulating and analyzing the system Models are never exact Modeling depends on your goal A single system may have many models Always understand what is the purpose of the model Large libraries of standard model templates exist A conceptually new model is a big deal Main goals of Modeling in control engineering conceptual analysis detailed simulationEE392m - Winter 2003 Control Engineering2-5),,(),,(tuxgytuxfx==&Model ing approaches Controls analysis uses deterministic models. Randomness anduncertainty are usually not dominant. White box models: physics described by ODE and/or PDE Dynamics, Newton mechanics Space flight: add control inputs u and measured outputs y),(txfx=&EE392m - Winter 2003 Control Engineering2-6vrtFrrmvpert=+ =&&)(3 Orbital mechanics example Newton s mechanics fundamental laws dynamics =321321vvvrrrx),(txfx=& Laplace computational dynamics(pencil & paper computations) deterministic model-basedprediction1749-18271643-1736r vEE392m - Winter 2003 Control Engineering2-7 Orbital mechanics example Space flight mechanics Control problems: u - ?

3 =321321vvvrrrx),,(),,(tuxgytuxfx==& =)()(rry vrtutFrrmvpert=++ =&&)()(3 Thruststatemodelobservations /measurementscontrolEE392m - Winter 2003 Control Engineering2-8 GeneexpressionmodelEE392m - Winter 2003 Control Engineering2-9),,(),,()(tuxgytuxfdtx==+S ampled Time Models Time is often sampled because of the digital computer use computations, numerical integration of continuous-time ODE digital (sampled time) control system Time can be sampled because this is how a system works Example: bank account balance x(t) - balance in the end of day t u(t) - total of deposits and withdrawals that day y(t) - displayed in a daily statement Unit delay operator z-1.

4 Z-1 x(t) = x(t-1)()kdttuxfdtxdtx= + +),,,()(xytutxtx=+=+)()()1(EE392m - Winter 2003 Control Engineering2-10 Finite statemachines TCP/IP State MachineEE392m - Winter 2003 Control Engineering2-11 Hybrid systems Combination of continuous-time dynamics and a state machine Thermostat example Tools are not fully established yetoffon72=x75=x70=x70 =xKxx&75)( =xxxhKx&EE392m - Winter 2003 Control Engineering2-12 PDE models Include functions of spatial variables electromagnetic fields mass and heat transfer fluid dynamics structural deformations Example: sideways heat equation1220)1(;)0(= === = xxTyTuTxTktTyheat fluxxToutside=0 Tinside=uEE392m - Winter 2003 Control Engineering2-13 Black-box models Black-box models - describe P as an operator AA, ME, Physics - state space, ODE and PDE EE - black-box, ChE - use anything CS - state machines, probablistic models, neural networksPxuinput datayoutput datainternal stateEE392m - Winter 2003 Control Engineering2-14 Linear Systems Impulse response FIR model IIR model State space model Frequency domain Transfer functions Sampled vs.

5 Continuous time LinearizationEE392m - Winter 2003 Control Engineering2-15 Linear System (black-box) Linearity Linear Time-Invariant systems - LTI)()(11 yuP)()(TyTuP )()()()(2121 + + byaybuauP)()(22 yuP PutytEE392m - Winter 2003 Control Engineering2-16 Impulse response Response to an input impulse Sampled time: t = 1, 2, .. Control history = linear combination of the impulses system response = linear combination of the impulse responses())(*)()()()()()(00tuhkukthtyku kttukk= = = = = )()( hP utytEE392m - Winter 2003 Control Engineering2-17 Linear PDE System Example Heat transfer equation, boundary temperature input u heat flux output y Pulse response and step ER ATURECOORDINATE0)1()

6 0(22== = TTuxTktT1= =xxTy0204060801000246x 1 0-2 TIMEHEAT FLUXPULSE F LUXSTEP RESPONSEEE392m - Winter 2003 Control Engineering2-18 FIR model FIR = Finite Impulse Response Cut off the trailing part of the pulse response to obtain FIR FIR filter state x. Shift register),(),()1(uxgyuxftx==+h0h1h2h3u(t )x1=u(t-1)y(t)x2=u(t-2)x3=u(t-3)z-1z-1z- 1())(*)()()(0tuhkukthtyFIRNkFIR= = =EE392m - Winter 2003 Control Engineering2-19 IIR model IIR model: Filter states: y(t-1), .., y(t-na ), u(t-1), .., u(t-nb ) == + =bankknkkktubktyaty01)()()(u(t)b0b1b2 u(t-1) u(t-2) u(t-3)z-1z-1z-1-a1-a2 y(t-1) y(t-2)y(t-3)z-1z-1z-1y(t)b3-a3EE392m - Winter 2003 Control Engineering2-20 IIR model Matlab implementation of an IIR model: filter Transfer function realization: unit delay operator z-1()( ))(.)

7 (.. )()()()()()()(110)(111111011110tuzbzbbty zazaazazbzbzbzazazbzbbzAzBzHtuzHtyzBNNzA NNNNNNNNNNNN44443444421444344421 +++=+++++++++=++++++=== FIR model is a special case of an IIR with A(z) =1 (or zN )EE392m - Winter 2003 Control Engineering2-21 IIR approximation example Low order IIR approximation of impulse response:(pronyin Matlab Signal Processing Toolbox) Fewer parameters than a FIR model Example: sideways heat transfer pulse response h(t) approximation with IIR filter a = [a1 a2 ], b=[b0 b1 b2 b3 b4 ] RESPONSE22114433221101)( ++++++=zazazbzbzbzbbzHEE392m - Winter 2003 Control Engineering2-22 Linear state space model Generic state space model: LTI state space model another form of IIR model physics-based linear system model Transfer function of an LTI model defines an IIR representation Matlab commands for model conversion.)

8 Help ltimodels()[]()DBAIzzHuDBAIzy+ = + = 11)()()()()()()1(tDutCxtytButAxtx+=+=+), ,(),,()1(tuxgytuxftx==+EE392m - Winter 2003 Control Engineering2-23 Frequency domain description Sinusoids are eigenfunctions of an LTI system:LTIP lanttiititieeeez ==)1(1 Frequency domain analysisuzHy)(= = = deueHydeuutiyiti43421)(~)(~)()(~)(~ uetiuPacketofsinusoids)(~ yetiPacketofsinusoids)( ieHyEE392m - Winter 2003 Control Engineering2-24 Frequency domain description Bode plots:tiitieeHyeu )(== Example: )(arg)()()( iieHeHM== )( =zzHBode Dia gramFrequency (rad/sec)Phase (deg)Magnitude (dB)-505101510-210-1100-180-135-90-450 |H| is often measuredin dBEE392m - Winter 2003 Control Engineering2-25 Black-box model from data Linear black-box model can be determined from the data, , step response data This is called model identification Lecture 8EE392m - Winter 2003 Control Engineering2-26z-transform, Laplace transform Formal description of the transfer function: function of complex variable z analytical outside the circle |z| r for a stable system r 1kkzkhzH = =0)()( Laplace transform.

9 Function of complex variable s analytical in a half plane Re s a for a stable system a 1 =dtethsHst)()()( )()( susHsy=EE392m - Winter 2003 Control Engineering2-27 Stability analysis Transfer function poles tell you everything about stability Model-based analysis for a simple feedback example:)()(dyyKuuzHy ==ddyzLyKzHKzHy)()(1)(=+= If H(z) is a rational transfer function describing an IIRmodel Then L(z) also is a rational transfer function describing anIIR modelEE392m - Winter 2003 Control Engineering2-28 Poles and Zeros <=> System ..not quite so! )( == )(z . +++++==Impulse Re sponseTime (sec)Am p lit u d Re sponseTi me ( s e c )Am p litud FIR model - truncated IIR EE392m - Winter 2003 Control Engineering2-29 IIR/FIR example - cont d Feedback control: Closed loop:)()( )(ddyyyyKuzzuzHy = = ==Impulse Re sponseTime (sec) )()(1)(=+=uzLuzHzHyFIRFIRFIR)()(1)(=+=EE 392m - Winter 2003 Control Engineering2-30-0.

10 8-0 .6-0 .4-0 . example - cont dPoles and zeros Blue: Loopwith IIRmodel poles xand zeros o Red: Loopwith FIRmodel poles xand zeros oEE392m - Winter 2003 Control Engineering2-31 LTI models - summary Linear system can be described by impulse response Linear system can be described by frequency response =Fourier transform of the impulse response FIR, IIR, State-space models can be used to obtain closeapproximations of a linear system A pattern of poles and zeros can be very different for asmall change in approximation error. Approximation error <=> model uncertaintyEE392m - Winter 2003 Control Engineering2-32 Nonlinear map linearization Nonlinear - detailedmodel Linear - conceptualdesign model Static map, gainrange, sectorlinearity Differentiation,secant method)()(0uuufufy =EE392m - Winter 2003 Control Engineering2-33 Nonlinear state space modellinearization Linearize the map Secant method Or.


Related search queries