EXAM IN MODELING AND SIMULATION (TSRT62) SAL: ISY:s datorsalar TID: Tuesday 25th October 2016, 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. 16 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-11-09 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 white noise? (b) An unknown system can be tested only with sinusoidal inputs at a given frequency ω, and input-output measurements can be used to understand its structure. Assume for instance that an input of amplitude 2 is applied. What kind of information can we obtain on the system if we vary the amplitude of the input, for instance to 5? (c) The system ẋ(t) = 3x(t) is discretized using an Euler method. For which values of the step length both the forward and backward Euler method give a stable numerical scheme? (d) Draw the bond graphs for the 4 circuits in Fig. 1. Which of them have conflict-free causality? (4p) (a) (b) (c) (d) Figure 1: The 4 circuits of Ex. 1(d) 3
2. (a) The model ( ) y(t) = K u(t) + u(t 1) + u(t 2) + e(t) where e(t) is a white noise, is used for the identification of the true system y(t) = 0.5u(t) + u(t 1) + w(t) (1) where w(t) is a white noise, and also u(t) is a white noise uncorrelated with w(t). Compute the value of K which minimizes the prediction error when the number of data points N tends to. (b) Consider now the model y(t) = b 1 u(t) + b 2 u(t 1) + e(t) (5p) with e(t) again a white noise. Compute the variance of the estimates of b 1 and b 2 as a function of N when the true system (1) is driven by an input u(t) whose autocovariance is 1 if τ = 0 R u (τ) = 0.5 if τ = 1 0 if τ > 1 (5p) 4
3. The data for this exercise are in a file called sysid_data_20161025.mat located in the directory /site/edu/rt/tsrt62/exam/. To load it into your Matlab workspace use one of the following: type in the Matlab window load /site/edu/rt/tsrt62/exam/sysid_data_20161025.mat copy the file to your current directory and then load it into your Matlab workspace (typing load sysid_data_20161025.mat at the Matlab prompt). Inside sysid_data_20161025.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 Bode plots poles and zeros placement Discuss and comment your choices and results. (10p) 5
?(v) 4. Consider the hydromechanical system of Fig. 2. A flow pump acts as external input. Assume the fluid is frictionless and call C f the capacitance of the tank. Denote A the area of the section of the pipe near the piston, m the mass of the cart, k the linear spring constant and φ(v) = v 3 the nonlinear damping (v = velocity of the cart). Figure 2: Hydromechanical system of Ex. 4. (a) Draw a bond graph. Is its causality conflict-free? (4p) (b) Construct a state space model. (4p) (c) Is the causality different if instead the nonlinear law for the damping we have the law v 1 if v > 1 φ(v) = 0 if 1 v 1 v + 1 if v < 1 represented in Fig. 3? 1 0.5 0-0.5-1 -2-1 0 1 2 v Figure 3: Nonlinear function φ of Ex. 4(c) 6
5. Consider the DAE equation ẋ 1 = 2x 1 + x 2 0 = x 1 + x 1 x 2 + u (2) (a) Compute the differentiability index. (Obs: if at some point you reach a differentiability index 2 then you can stop calculations; no need to go further). (5p) (b) Assume that in the DAE (2) you apply the feedback law u = x 2 x 1 x 2 Is the differentiability index for the closed loop system different from the one at the previous point? (3p) (c) Assume you can choose u as a PD (P=proportional, D=derivative) controller from the state of the DAE (2). What would you choose in order to have a closed loop system with the lowest possible differentiability index? 7