EXAM IN MODELING AND SIMULATION (TSRT62) SAL: ISY:s datorsalar TID: Tuesday 27th October 2015, kl. 14.00 18.00 KURS: TSRT62 Modeling and Simulation PROVKOD: DAT1 INSTITUTION: ISY ANTAL UPPGIFTER: 5 ANTAL BLAD (inkl försättsblad): 10 ANSVARIG LÄRARE: Claudio Altafini, 013-281373, 073-9931092 BESÖKER SALEN: cirka kl. 15 och kl. 17 KURSADMINISTRATÖR: Ninna Stensgård 013-282225, ninna.stensgard@liu.se TILLÅTNA HJÄLPMEDEL: 1. L. Ljung & T. Glad Modellbygge och Simulering 2. T. Glad & L. Ljung: Reglerteknik. Grundläggande teori 3. Tabeller (t ex L. Råde & B. Westergren: Mathematics handbook, C. Nordling & J. Österman: Physics handbook, S. Söderkvist: Formler & tabeller ) 4. Miniräknare Normala inläsningsanteckningar i läroböckerna är tillåtet. Notera att kommunikation med andra personer och informationshämtning via nätverket eller Internet inte är tillåtet under tentamen. LANGUAGE: you can write your exam in both English (preferred) or Swedish LÖSNINGSFÖRSLAG: Finns på kursens websida efter skrivningens slut. VISNING av tentan äger rum 2015-11-10 kl 12.30-13:00 i Ljungeln, B-huset, ingång 25, A-korridoren, room 2A:514. PRELIMINÄRA BETYGSGRÄNSER: betyg 3 23 poäng betyg 4 33 poäng betyg 5 43 poäng OBS! Lösningar till samtliga uppgifter ska presenteras så att alla steg (utom triviala beräkningar) kan följas. Bristande motiveringar ger poängavdrag. Lycka till!
TIPS FÖR UTSKRIFTER: Spara kommandosekvenser i filer. Skriv ut filer, simulinkscheman och figurer regelbundet under tentan. Kom ihåg att signera alla utskrifter så att det syns vem de tillhör. Man kan lägga in text i matlabplottar med kommandona title och gtext. I scopeplottar i Simulink kan text läggas till genom att högerklicka i dem och välja Axes properties. I simulinkscheman kan man dubbelklicka på något blankt ställe och sedan skriva in text. Vid identifiering med hjälp av användargränssnittet: Högerklicka på de modeller du skattat och kopiera koden som står under Diary and Notes till en m-fil som du sedan skriver ut. Då kan man lätt återskapa modellerna och det framgår vad ni gjort. Plottar i användargränssnittet går inte att direkt skriva in text i, utan först får man välja Copy Figure under File, vilket ger en vanlig matlabplott som går att editera enligt ovan. Utskrifter i Linux: Vanliga filer kan skickas till en viss skrivare genom att man skriver kommandon som till exempel lp -d printername file.pdf i ett terminalfönster. skrivarens namn.) (Byt ut printername mot den aktuella Om man väljer File/Print i ett simulinkschema kan man ange en viss skrivare genom att lägga till -Pprintername i rutan vid Device option. 2
1. (a) Consider the two ODEs ẋ 1 = x 1 2 ẋ 2 = 5000x 2 Write down a numerical approximation of the two ODEs using the same method and the same constant step size h. The method should preserve the stability properties of the original ODE. Having to choose between the forward and backward Euler methods, which one would allow a longer step size? Motivate your answer. [3p] (b) You are asked to collect measurements from a mechanical system whose transfer function is known and is given in Fig. 1. Which of the following sample times T 1 = 0.02, T 2 = 0.2, T 3 = 2 is an acceptable choice for this system and why? 0 Bode Diagram -50 Magnitude (db) -100-150 -200-250 0 Phase (deg) -90-180 -270-360 10-1 10 0 10 1 10 2 10 3 Frequency (rad/s) Figure 1: (c) In a black-box model, what is the minimal order of the denominator of the input-output transfer function that you should use to identify the model of Fig. 1? What can you say for the order of the numerator? [3p] 3
(d) What is the linearization of ẋ = 1 e x+u y = tan x around x = 0, u = 0? 4
2. Consider the true system y(t) 0.5y(t 1) = u(t 1) + e(t) (1) where u(t) and e(t) are independent white noises of zero mean and variance λ u and λ e. (a) Compute the autocorrelation R y (1) = E ( y(t)y(t 1) ) of the system as a function of the variance of y. (b) To identify the system (1), we use the ARX model structure y(t) a 1 y(t 1) a 2 y(t 2) = bu(t 1) + e(t) (2) where e(t) is a white noise independent from u(t). Assuming the value of R y (1) computed above is available, if you use the principle of minimization of the prediction error, which parameters of (2) have an asymptotic estimate that is guaranteed to converges to the exact value? Motivate your answer. [5p] (c) Assume the system (2) is controlled via a proportional gain u(t) = k y(t m) (3) where m = delay (in number of steps, i.e., m = 1, 2, 3...). Under the assumption that k is known, for what values of the delay m is the system (2)-(3) identifiable? [3p] 5
3. The data for this exercise are in a file called sysid_data_20151027.mat located in the directory /site/edu/rt/tsrt62/exam/. To load it into your Matlab workspace use any of the following: type in the Matlab window load /site/edu/rt/tsrt62/exam/sysid_data_20151027.mat copy the file to your current directory and then load it into your Matlab workspace (typing load sysid_data_20150824.mat at the Matlab prompt). Inside sysid_data_20151027.mat you will find the sampled signals u and y (the sample time is 0.1). Notice that the data are not produced with a closed loop system (hence disregard the feedback command in the SysId toolbox) (a) Consider first the non-parametric models. What can you deduce from them in this case? (b) Construct one or more appropriate black-box models. For one or more of these models report plot of the fitted model vs. validation data parameter values and uncertainty quality of the fit Bode plots poles and zeros placement Discuss and comment your choices and results. [8p] 6
4. Consider the transmission system illustrated in Fig. 2. A torque M is applied to a rotating mass of moment of inertia J 1. This is connected through an elastic shaft (of torsion constant k 1 ) to a rotationaltranslational gear. The geared wheel has radius r and its moment of inertial is J 2. The geared wheel drives a (mass-less) geared bar, anchored to a wall through a spring constant k 2 and a damping of constant b. The distance of the bar from the wall is the output y. (a) Show that the rotational-translational gear can be represented as a transformer and write down the relationship between its effort and flow variables [1p] (b) Draw a bond graph and check its causality [4p] (c) Construct a state space model describing the relation from the input M to the output y. [5p] Figure 2: 7
5. For the DAE system Eż + F z = Gu consider the following 3 cases: 0 0 0 0 0 1 1 Case 1: E = 1 0 0, F = 1 1 0, G = 0 0 1 0 2 1 0 2 1 2 0 0 2 1 1 Case 2: E = 0 1 0, F = 1 0 3, G = 1 1 0 1 0 1 0 3 0 0 1 0 1 0 1 Case 3: E = 0 0 0, F = 0 0 1, G = 1 1 0 0 2 0 0 1 (a) compute the differentiability index of the system in the 3 cases [5p] (b) which of the 3 systems is uniquely solvable? (På svenska: lösbarhet, p. 155 of the book) (c) what is the standard form I for the 3 cases? (you can neglect the output equation in (7.22) of the book) [Hint: in all cases the standard form can be computed without making use of Appendix 7.7 of the book] [3p] 8