A summary of Modeling and Simulation Text-book: Modeling of dynamic systems Lennart Ljung and Torkel Glad
Content What re Models for systems and signals? Basic concepts Types of models How to build a model for a given system? Physical modeling Experimental modeling How to simulate a system? Matlab/Simulink tools Case studies
Systems and models Part one Models, p13-78 System is defined d as an object or a collection of objects whose properties we want to study A model of a system is a tool we use to answer questions about the system without having to do an experiment Mental model Verbal model Physical model Mathematical model
How to build and validate models Physical modeling: laws of nature Experimental modeling: Identification Any models have a limited domain of validation
Types of mathematical models Deterministic & stochastic Dynamic & static Continuous time & discrete time Lumped & distributed Change oriented & discrete event driven
Models for systems and signals (Chapter 3) Block diagram models: logical decomposition of the functions of the system and show how the different parts(blocks) influence each other u(t) h(t) u(t) q(t) Tank model (1) h(t) q(t) Bernoulli s law: v(t)=sqrt(2gh(t))
Example of Flow dynamic u(t) h(t) q(t) dh () t a 2 h 1 ht () ut () dt = A + A qt () = a 2 ght ()
Parameters & Signals Parameters: system parameters & design parameters Signals (variables): external signals: input and disturbance Output signals Internal variables
Description of systems stems Differential/difference equations High-order DE Transfer functions Linearization equilibrium point (stationary), Taylor expansion Laplace transform/z-transform First-order DE (define internal variables) state space models Linearization equilibrium point, Taylor expansion State variables
Signal descriptions: Time-domain i Deterministic & analytic: u(t)=sin(200t) Deterministic & sampled: {u(n)} Non-deterministic & analytic: u(t)= sin(2t)+w(t) Non-deterministic & sampled: {u(n)} of random variable u(t) stochastic processes (DE sem6)
Signal descriptions: Frequency domain Concept of frequency harmonic signals High freq. & low freq. Signals Fourier transform Amplitude spectrum Power Spectrum of a signal is the sqaure of the absolute value of its Fourier transform FFT algorithms (DE 6sem)
System descriptions: Time-domain i Deffierential/differenece equations ODE (lumped) & PDE (distributed) Linear & nonlinear
Effects of system to input signal
System descriptions: frequency domain Laplace transform/z-transform Transfer functions for linear lumped ODE Bode plot/nyquist plot
Link between time and frequency domain systems Response to input Bode plot Stability pole locations Performance (overshoot, settling time, resonance freq.) pole locations Bandwidth robustness
Example Effects of Group Delay The filter has considerable attenuation at ω=0.85π. The group delay at ω=0.25π is about 200 steps, while at ω=0.5π, the group delay is about 50 steps
Connection of systems and signals Time-domain: ODE && yt () + 2 yt & () + yt () = ut & () + ut () yk ( ) yk ( 1) + 2 yk ( 2) = uk ( ) uk ( 1) Xt & () = AXt () + BUt () X ( k ) = AX ( k 1) + BU ( k 1) Yt () = CXt () Yk ( ) = CXk ( ) Frequency domain: Y () s s+ + 1 Gs () = = 2 TF U s s s U(s) G(s) Y(s) () + 2 + 1 1 Y( z) 1 z Gz ( ) = = 1 2 U( z) 1 z + 2z 1 Gs () = CsII ( A) B
Link betwen continuous time and discrete time models Sampling mechanism Aliasing problem See more from Digital control course.
Content What re Models for systems and signals? Basic concepts Types of models How to build a model for a given system? Physical modeling Experimental modeling How to simulate a system? Matlab/Simulink tools Case studies
Physical modeling Part II in textbook pp.79-121
Principle and Phases Use the knowledge of physics that is relevant to the considered system Phase 1: structure t the problem: decomposition (cause and effect, variables) block diagram Phase 2: formulate subsystems Phase 3: get system model via simplification E l d li th h d b f Example: modeling the head box of a paper machine (pp.85-95)
Formulation of physical modeling Conservation laws Mass balance Energy balance Electronics (Kirchhoff s laws) Constitutive relationships
Simplification of modeling Principles Neglect small effects (approximation) Separate time constants (T_max/T_min<=10~100, stiffness problem) Aggerate state variables: to merge several similar variables into one variable, which often plays the role of average or total value
Some relationships in physics Electrical circuits Mechanical translation Mechanical rotation Flow systems Thermal systems Lagrange modeling method For more, see BRP s lectures.
Newton s 2law m a = F 27
Newton s 2 law for Rotation J dω/dt = τ
DC motor with Permanent Magnet 29
Electro-Mechanical Energy Conversion Chassis or basket Voice coil S N Cone Force produced by current: F = Bl I (ved fastholdt svingspole) F: Kraften på membranen B: magnetfelt L: svingspolens trådelængde I: strømmen Surround Input Dust cap Electro Magnetic force (EMF) and back EMF S N Magnet Suspension Current produced by membrane velocity: emf = Bl v emf: modelektromotorisk kraft v: membranens hastighed
Block Diagram: Loudspeaker U in (t) + 1/L i(t) F(t) + a(t) v(t) x(t) e Bl 1/m m - - R e + + v(t) Bl + + r m 1/c m
Thermal systems, Head flow, modelling of geometric problems (for DE5); mm4 2007 DE5.ppt Time and Frequency Response of 1. and 2. order systems (for M5); mm4 2007 M5.ppt Linearization; mm5 2006.ppt Linearization: solution of exercise; mm5 soulution.ppt
Lagrange modeling method Generalized coordinate Kinetic energy T Potential energy V External forces along ggerneralized coordinator Q
Experimental modeling (nonparametric identification) Part III in textbook pp.189-223 Estimation of transient response Estimation of transfer function
Estimation of transient response (direct method) Transient responses: impulse response, step response Arrange experiment (input signal) Curve fitting, range scaling, time constant Transient analysis is easy and most widely used Potential problem: poor accuracy due to disturbances and measurement errors etc.
Estimation of transient response (Correlation analysis) Need knowledge of stochastic processes(sem6) Procedure: Collect data y(k), u(k), k=1,2,.,n Substract sample means from each signal: N N 1 1 y( k) = y( k) y( t), u( k) = u( k) u( t), N N t= 1 t= 1 yt () = gut ( k) + vt () Form signal via whitening filter L(q) (polynomial, lease square): Impulse response: y ( k) = L( q) y( k), u ( k) = L( q) u( k) F F Rˆ ( τ ) 1 1 g where R y tu t u t N N N N yfuf ˆ N ˆ 2 ˆ τ = y ˆ ( τ ) = ( ) ( τ), λ = ( ) FuF yf F N F λ N t 1 N N = t= 1 k = 0 k
Estimation of transient response Basic properties: (Correlation analysis) Quick insight into time constants and time delays Mo special inputs are required. Poor SNR can be compensated by longer dtata recordes Limitation: input u(t) is uncorrelated with disturbance v(t). This method won t work properly when the dtata are collected from a system under output feedback y () t = g kut ( k) + vt () k = 0
Estimation of transfer functions (frequency analysis -1) Direct frequency analysis (Bode plot) H(ejω) = H(ejω) e<h(ejω) Input x(n) and output y(n) relationship Y(ejω) = H(ejω) X(ejω) <Y(ejω) = <H(ejω) + <X(ejω)
Estimation of transfer functions Advantages (frequency analysis -2) Easy to use and requires no complicated data processing Requires no strustural t assumptions other than it being linear Easy to concentrate on freq. Ranges of special interest Disadvantages Graphic result (Bode plot) Need long time of experimentation
Estimation of transfer functions (Fourier analysis -1) Principle: Y( jω) N N jωkt T ω k= 1 k= 1 Y ( jω) = T y( kt) e, U ( j ) = T u( kt) e T G N Y ( jω) = U T T ( jω ) ( jω) jωkt G( jω ) = U ( j Ω ) T T jωt jωt 0 T 0 Y ( jω ) = y( t) e dt, U ( jω ) = u( t) e dt T ˆ Y ( ) ( ) T jω G jω = U ( jω) T Evaluation: 2 cc u g VN ( jωω ) GN ( jω) G( jω) +, U ( jω) U ( jω) where system y() t = g( τ) u( t τ) dτ + v() t input lim itation : u( t) cu 0 system property : τ g( τ) dτ = cg 0 N N
Estimation of transfer functions Advantages: (Fourier analysis -2) Easy and efficient to use (FFT) Good estimation of G(jw) at frequencies where the input has pure sinusoids Disadvantages: The estimation is wildly fluctuating graph, which only gives a rough picture of the true frequency domain (see Fig8.13, pp.209)
Estimation of transfer functions (Spectra analysis -1) Principle: R ( k) = g( k)* R ( k) R ( k) = g( k)* g( k)* R ( k) yu uu yy uu Φ ω = ω Φ ω Φ ω = ω Φ ω +Φ ω 2 yu ( ) G( ) uu ( ) yy ( ) G( ) uu ( ) vv( ) Spectra estimation (Black-Tukey s spectral estimate) - Window function N N 1 Ryu ( k ) = yt ( + k ) ut ( ) N γ t= 1 γ N Φ yu ( ω ) = wγ ( k ) Ryu ( k ) e k = γ Estimation: jωk 1 N N Ruu ( k) = u( t+ k) u( t) N Φ γ uu γ t= 1 N ( ω ) = wγ ( kr ) uu ( ke ) k = γ γ γ ˆ Φyu ( ω) Φyu ( ω) N ( ) γ γ G jω = Φ γ vv =Φyy ( ω ) γ Φ ( ω ) Φ ( ω ) uu uu 2 j ω k
Estimation of transfer functions Advantages: (Spectra analysis -2) Common method for signals and systems Only assume system is linear, and requires no specific input Adjusting the window size usually leads to a good picture Disadvantages: Graphic result (Bode plot) This method won t work properly when the dtata are collected from a system under output feedback
Experimental modeling (parametric identification) Chapter 9 in textbook pp.227-257 Estimation of Tailor-made model Estimation of ready-made model
Parametric models Tailor-made model: constructed from basic physical principles. i Unknown parameters have physical interpretation (grey-box) Ready-made model: describe the properties of the input-output t t relationships without any physical interpretation (black- box)
Tailor-made model identification Can be done by conventional physical experimentation ti and measurement methods, e.g., Estimate the time constant using step response Esitmate the DC-gain usinf steady response
Ready-made models Box-Jenkins (BJ) model Output error (OE) model B(q)/F(q) B(q)/F(q) C(q)/D(q) ARMAX model C(q) ARX model B(q) 1/A(q) B(q) 1/A(q)
Ready-made model identification System identification (IRS7) P.236-252 Summary on p.252-253 Chapt 10 system identification as a tool for model building...
Content What re Models for systems and signals? Basic concepts Types of models How to build a model for a given system? Physical modeling Experimental modeling How to simulate a system? Matlab/Simulink tools Case studies
Part IV Simulation and model use Simulation Block diagram Matlab/Simulink, Labview Numerical methods (DE 6sem), p.318-327 Model validation and use
Content What re Models for systems and signals? Basic concepts Types of models How to build a model for a given system? Physical modeling Experimental modeling How to simulate a system? Matlab/Simulink li tools Case studies BeoSound 9000 sledge control