Examination WS 2002/2003 Simulation of Mechatronic Systems Prof. Dr.-Ing. K. Wöllhaf Remarks: Check if the examination is complete (9 pages) Put your name and Matr.Nr. on any sheet of paper You must not use red pen Add the question number to every solution The results of your examination will be published in the internet with your on: http://www.fh-weingarten.de/~woellhaf/ Please give me a number between 4 and 99! The note will be multiplied with that number. If no number is given, 5 will be used! Please do not ask by phone or e-mail! Question max. points a) 7 b) 3 c) 7 2 a) 0 b) 6 3 a) 5 b) 5 c) 0 d) 8 4 a) 7 b) 7 c) 5 Summe 90 Prüfer Note points remarks Version: 2/5/2003 3:46 PM file: SimecPrüfWS2002_3.doc WS 2002/2003 Examination SIMEC /9 Prof. Dr.-Ing. K. Wöllhaf
Question a) 7 P What are the advantages of using simulation models? b) 3 P What different kind of simulation models do you know? c) 7 P What are the basic steps in modeling projects? Describe them shortly! Question 2 a) 0 P Which commands do you need to produce the following plot and print it in a postscript graphic file? The plotted functions are: sin t,cos t, t, sin t i cos t t = 0.0,0.,0.2,0.0 [ ] b) 6 P What command is used to plot the bode-diagram of the transfer function below? 20 Gs = ; 4 3 2 s + 2s + 0s + 4s+ How can you check if you used the command the right way? Use your basic knowledge about complex numbers and transfer-functions! WS 2002/2003 Examination SIMEC 2/9 Prof. Dr.-Ing. K. Wöllhaf
Question 3 a) 5 P What transfer function Gs Ys = is modeled by the signal flow model? Us As a solution step, write down the first order differential equations! u sum m V X y D b) 5 P Describe, how a linear state space model = A x + B u ; (n,) (n,n) (n,) (n,m) (m,) y = C x + D u ; (k,) (k,n) (n,) (k,m) (m,) can automatically be computed out of a signal flow model? Explain in detail, how the C-matrix is calculated! Which input is needed by the user? c) 0 P The first order differential equation = 5x+ sin t is simulated using the Euler-algorithm. Describe how the solution is done and calculate the first 3 steps of the solver and write the values into the table: t xt xt sin( t ) 0,5 3,0 0,6 0,7 C d) 8 P Simulation program can be extended with c-models using the function interface: dgl( double t, /* time */ int n*, /* number of states in problem */ double dx*, /* derivation */ double x*) /* state variable */ How the differential equation : a y+ b y + c y = t sin Can be simulated using this interface? Write down the c-code! WS 2002/2003 Examination SIMEC 3/9 Prof. Dr.-Ing. K. Wöllhaf
Question 4 a) 7 P Write down the transfer function of the following electrical system! How this system can be simulated using an ODE-Solver? R U in C U out b) 7 P Write down the differential equation of the following mechanical system! Transform the model into first order differential equations! x x 3 C F m m 3 x 2 D F 3 C 2 F 2 m 2 D 2 c) 5 P Describe briefly the difference of Simulink and a component based simulation program like Dymola (Modelica)! Consider: - model construction - evaluation of the model - advantage / disadvantage WS 2002/2003 Examination SIMEC 4/9 Prof. Dr.-Ing. K. Wöllhaf
a) Simulation models make it possible to do experiments on a computer. The experiments are needed to: learn about the system gain a better inside investigate the influence of parameters see the dynamic behavior improve / optimize the system check the mathematical model The models on the computer compared with real systems have the advantages the models can be build an changed with a PC no hardware is needed or has to be build (reduce cost) the real system may be to slow/fast hazard studies can be done without danger the model contains the knowledge about the system b) Signal flow models Component bases models Virtual reality models (3D models) Finite Element Models Discrete Event Models c) I. What is the purpose of the model? II. System border: What is part of the model, which are the interfaces? III. Model construction: Which simplifications can be made to represent the real system? IV. Equations: Write down the physical equations of the system V. Estimation of the parameters VI. Construction of the simulation model using simulation software VII. Model validation. Does the model represent the real system VIII.... Problem solving WS 2002/2003 Examination SIMEC 5/9 Prof. Dr.-Ing. K. Wöllhaf
2 a) 2 b) bode(tf([20],[ 2 0 4 ])) WS 2002/2003 Examination SIMEC 6/9 Prof. Dr.-Ing. K. Wöllhaf
3 a) v = ( u Dv C x; ) m = v; y = x; Ys Gs = = ; 3 b) 2 ms + Ds+ C Us Definition of the input points u and output points y: The evaluation of the signal flow model gives the functions: = f x,u,t ; y = gx,u,t ; Calculation of the working point; = f x,u,t ; 0 0 0 0 y = gx,u,t ; 0 0 0 0 0 0 0 x x0 x ;x2 x0 x ;xn x0 x = + = + = + ; 0 0 0 0 0 0 u u0 u ;u2 u0 u ; um u0 u = + = + = + ; 0 0 0 = f x,u,t ; x = f x,u,t ; u 0 0 um 0 m 0 y = gx,u,t ; y = gx,u,t ; u 0 0 um 0 m 0 = f x,u,t ; x = f x,u,t ; x 0 0 xn n 0 0 y = gx,u,t ; y = gx,u,t ; x 0 0 xn n 0 0 T T yx y 0 yu y 0 x 0 x n 0 A = ; x x x u C = ;D ; u 0 u = m 0 T T B = ; yx y n 0 yu y m 0 u u x u WS 2002/2003 Examination SIMEC 7/9 Prof. Dr.-Ing. K. Wöllhaf
3 c) x + = x + t x t i i i t xt xt sin( t ) 0,5-4.52 3,0 0.479 0,6-7.75.548 0.565 0,7-3.508 0.8304 0.644 3 d) y = sin t b y x y a 2 ( ) = ( sin( t) b x c x 2) ; a = x; C-Code: double a =.0; double b = 2.0; double c = 3.0; n = 2 ; dx[0]=(sin(t)-b*x[0]-c*x[])/a ; dx[]=x[0]; 4 a) XC Uout = Uin = U Cs in = U in ; 2 X + R+ XC s+ R+ Cs + CRs + Cs U = U + U + U; in R C I = ( Uin UR UC) = ( Uin RI U C) ; U C = IC = I; C C U = U; out C WS 2002/2003 Examination SIMEC 8/9 Prof. Dr.-Ing. K. Wöllhaf
4 b) mx = F + C x x + D x ; 3 3 mx = F + C x x + D x ; 2 2 2 2 3 2 2 3 2 mx = F C x x D C x x D x ; 3 3 3 3 3 2 3 2 2 3 2 explicit DG: v = F+ C( x3 x) + D( v3 v ) ; m v = F + C ( x x ) + D ( v v ) ; 2 2 2 3 2 2 3 2 m2 v = F C ( x x ) D ( v v ) C ( x x ) D ( v v ) ; 3 3 3 3 2 3 2 2 3 2 m3 = v; 2 = v; 2 = v; 3 3 4 c) Model construction: Simulink: - models must be translated in signal flow models Dymola: + component models can be used directly - more effort to build a model library Evaluation of the model: Simulink: evaluation is fast, only ODE s must be solved Dymola: evaluation needs more effort to solve algebraic and differential equations Advantage / disadvantage Simulink: + easy to extend - more effort to build models - complex models are hard to understand Dymola: + model construction by using components + complex models are more easy to understand + better concept to handle hybrid systems - more effort on evaluation WS 2002/2003 Examination SIMEC 9/9 Prof. Dr.-Ing. K. Wöllhaf