EXAM IN MODELING AND SIMULATION (TSRT62) SAL: ISY:s datorsalar TID: Monday 21st August 2017, 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 (English title Modeling and Identification of Dynamical Systems ) 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 2017-09-06 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!
COMPUTER TIPS: To open Matlab: open a terminal (right-click on the background and choose open terminal) type module add prog/matlab matlab & Print out the model description and the plots requested Remember to write your AID number on each printed page you include In the identification exercise using the System Identification toolbox: To print the model description: Right-click on the icon of the model you have computed and then click Present. The model description appears then on the matlab main window. Copy it into a file and print it. the SysId plots cannot be directly printed. You have to choose File Copy figure, which gives an ordinary matlab plot you can print. Printing in Linux: A file called file.pdf can be printed out for instance typing in a terminal lp -d printername file.pdf (replace printername with the name of the printer in the room you sit in). It is possible to print using File Print in a matlab plot, but one must select the printer name writing -Pprintername in the Device option (again printername is the name of your printer). 2
1. (a) What is a Runge-Kutta method in numerical integration? (b) Consider the system y(t) = G(p)u(t) + e(t), G(p) = 1 p + 1 where u(t) and e(t) are both white noise with zero-mean and variance 1, uncorrelated with each other. Compute the spectrum of y. [3p] (c) What element (C, I, R, S f or S e ) can you have in the position X of Fig. 1 if you want the bond graph to have conflict-free causality? Figure 1: Bond graph of Ex. 1(c) (d) A system of DAEs F (ẋ, x, t) = 0 is solved via the backward difference scheme ( ) (xn x n 1 ) F, x n, t n = 0 h If the DAE system is ẋ 1 = x 2 x 1 = t 2 what is the corresponding local integration error? [3p] 3
2. Consider the model y(t) = αy(t 1) + βu(t 1) + e(t) where u(t) and e(t) are uncorrelated white noises (of zero mean and variances λ u and λ e ). Assume the true system is y(t) = 2u(t 1) + w(t) with w(t) a (zero mean, λ w variance) white noise uncorrelated with u(t). (a) use least-squares to estimate the asymptotic value of the two parameters when N [5p] (b) Is the estimation biased or unbiased? Motivate your answer [1p] (c) Which of the two parameters of the model has the largest variance in the asymptotic estimate? [4p] 4
3. The data for this exercise are in a file called sysid_data_20170821.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_20170821.mat copy the file to your current directory and then load it into your Matlab workspace (typing load sysid_data_20170821.mat at the Matlab prompt). Inside sysid_data_20170821.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 hydraulic-mechanical system of Fig. 2. A force F influ- Figure 2: Exercise 4 ences, via a massless piston and an hydraulic cylinder, a piston with mass m 1. This is then connected via a spring (with spring constant k 1 ) to a friction-free moving mass m 2. The mass m 2 in its turn is attached to another mass m 3 through a frictionless pulley and a spring of spring constant k 2. The mass m 3 is connected to the surface through a linear damper, with damping constant b. Gravitational force acts on m 3.The cross section of the pistons are A 1 and A 2. (a) Set up a bond graph of the system and mark its causality. (b) Translate the bond graph into state space equations. [4p] [4p] (c) Is there any difference in the causality if the motion of the mass m 2 has instead a friction? 6
5. A system is modeled by the following DAE: ẋ 1 + aẋ 2 = t x 1 + x 2 = sin t (a) For which values of a is the system solvable? answer. (b) What is the solution for x 1 (0) = 0? Motivate your [3p] (c) What is the index of the system? (It is enough to discuss the value of the index for generic values of x 1, x 2 and a, avoiding the singularities one may encounter for isolated values of these variables.) (d) How is the index changing if the equation x 1 + x 2 = sin t is replaced with sin x 1 + tan x 2 = sin t Motivate your answer. (same suggestion as above, only look at generic values of x 1, x 2 and a.) (e) What do these values of the index say concerning the possibility of solving the DAE system numerically? [1p] 7