EXAM IN MODELING AND SIMULATION (TSRT62) SAL: ISY:s datorsalar TID: Monday 22nd August 2016, kl. 8.00 12.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. 9 och kl. 10 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 2016-09-02 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. 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) Describe what cross-validation is and why it is important in system identification. (b) What does it mean that a system of differential equations is stiff? Describe what kind of complications can stiffness induce when simulating a system. (c) Consider the system ẋ(t) = 3x(t) + u 2 (t) y(t) = x 3 (t) What is the static relationship between u and y? (You can assume u(t) = u 0 = const). (d) The system ẋ = [ ] 1 0 x 0 2 must be simulated with the Euler method x n+1 = x n + hf(x n ) For which values of h is the Euler method stable for the system? (e) Can the differential equation 3ẏ + 2y = 0.2 become 3ż + z = 1 through time and amplitude scaling? 3
2. The ARX model y(t) ay(t 1) = bu(t 1) + e(t) where e(t) is a white noise independent from u, is used to identify the true system y(t) = u(t 1) + w(t) where w(t) is a white noise of variance λ w independent from u. (a) Write the one-step ahead predictor for the ARX model (b) Use minimization of the prediction error V N = 1 N (ŷ(t θ) y(t)) 2 N t=1 [ ] a to estimate the asymptotic value of the parameters θ = of b the model, assuming that the input u is a white noise of variance λ u independent from w. (4p) (c) compute the variance of the estimates (assuming N sufficiently large and no bias error) (4p) 4
3. The data for this exercise are in a file called sysid_data_20160822.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_20160822.mat copy the file to your current directory and then load it into your Matlab workspace (typing load sysid_data_20160822.mat at the Matlab prompt). Inside sysid_data_20160822.mat you will find the sampled signals u and y (the sample time is T s = 0.1). 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 poles and zeros placement Discuss and comment your choices and results. (10p) 5
4. Consider the funicular system in Fig. 1, consisting of a cart of total mass m equipped with an electrical motor and a winch, moving on a railway inclined of an angle α. The lifting of the cart happens through a pulley fixed to a wall. One end of the rope is on the winch, the other is attached to the cart itself. Fig. 2 shows the details of the Figure 1: Funicular system Figure 2: Details of the motor + winch on the cart for the funicular system of Fig. 1 motor+winch in the cart. The torque from the motor is proportional to the current: M = βi. The transmission between motor and winch has a torsional spring of coefficient k. The inertia of the winch is J, its radius r, and there is a friction acting on it, of constant b. (a) Draw a bond graph. Is its causality conflict-free? (b) Construct a state space model. (5p) (5p) 6
5. Consider the system where Eẋ + F x = Gu 1 0 1 0 1 0 1 0 E = 1 α 0, F = 0 0 1, G = 1 1. 0 1 1 1 0 0 0 1 (a) Show that there is a value α o such that for all α α o the system can be written as ẋ = Ax + Bu What is α o? What is the expression for A and B as a function of E, F, and G? (3p) (b) What is the index of the system? (3p) (c) For α = α o (value computed at item (a)), show that the system can be written as [ ] [ ] d x1 x1 = A dx x 1 + B 2 x 1 u + B 2 u 2 [ ] x1 x 3 = C 1 + D x 1 u 2 and compute the expressions for the matrices A 1, B 1, C 1 and D 1. (4p) 7