Modeling & Simulation 2018, Fö 1 Claudio Altafini Automatic Control, ISY Linköping University, Sweden
Course information Lecturer & examiner Claudio Altafini (claudio.altafini@liu.se) Teaching assistants A. Måns Klingspor B. Fredrik Ljungberg Credits 6 HP = 4.5 (exam) + 1.5 (lab) Course home page http://www.control.isy.liu.se/student/tsrt62 slides, exercise and lab material link for lab sign-up old exams, tips for computer exam
Organization of the course 12 lectures 12 exercise sessions (5 in compute rooms) 3 labs: Identification lab (written report + peer-review) Modeling 1 & 2 Course literature Swedish English
Program of the course
Lab 1 (Identification): important dates lab in pairs max 8 students per session 8 sessions available report due: 2 weeks after lab peer review due: one week revised report due: one week
Feedback from students: lectures The first half of the lectures was very intense and quite hard to comprehend, not only because the subject is new but also because there weren t many headlines (on the blackboard) telling you what you were looking at. Need more structure on the lectures. This was only the first part of the course, the second parts lectures were great. Lectures must finish on time. NEVER go overtime! Hade varit bra med lite mer bakgrund till vissa saker, t.ex vad en stokastisk process är, AKF etc. är. Lite mycket handviftning alltså. Studenterna skulle vilja ha mer teori och härledning av matematiken [Y students] There could be more explaining of practice during the lectures, and not so much focus on theory. Indeed, theory is needed, but the fraction was too large. [I students]
Feedback from students: exercises and labs Eleverna tyckte att lärarna var bra, att exempel i början av lektionen var bra, att lektionerna innehöll lagom många uppgifter samt att datorlektionen var kul och givande med mycket fokus på laborationen. The report for lab 1 with peer review was a nice way of examining that part. The level of the peer review varied greatly between the students. We did not get any feedback on lab 1 before the exam, which is strange, especially since it contains problems central to the exam. Improve the integration with openconf or change system, it is not user friendly at all.
Feedback from students: exam Exam is a 4h computer exam (1/5 exercises to be solved with Matlab) Det var i min upplevelse lite tajt med tid. Det rådde stor förvirring kring tentan: -Vart man skulle befinna sig inför tentan -Hur inloggningen på datorn skulle ske -Hur utskrifter skulle göras (AID_Nummer mm.) Tycker det är onödigt att det är en data denta. Delen som dator behövs för examineras ändå med en laboration.
Feedback from students: overall evaluation 2015 2016 2017
Feedback from students: students satisfaction 2015 2016 2017
Lecture 1: Models and model building Why modeling? Approaches to modeling: examples Review of linear systems theory In the book: Chapter 1 3, Appendix A.
Why models and simulations? Aircraft performances photo: Stefan Kalm, Copyright: Saab AB Building a new airplane is a costly and lengthy process How to evaluate the performance of aircraft before it is built? Computer simulations & Mathematical models = project and prototype Project
Why models and simulation? Biology Drug development: computer models used to discover new drug molecules and their targets Post-genome sequencing era complexity has scaled up: = 20.000 genes can be measured simultaneously need models to understand genome-wide data need models to understand behavior of complex networks Discovery photo: Nature publ.
Why models and simulation? Process industry Process control Optimization of production Monitoring, Control, Optimization
Why models and simulation? Climate Next day predictions: model-based Long term predictions: how much will the sea level rise by 2100 if a certain amount of CO 2 is released into the atmosphere? At the same time: beware of extrapolations! Foto: NASA Prediction
Course objectives Objectives of the course Provide the basis of the methods and principles needed to build mathematical models of dynamical systems from experimental data. Domains of application all engineering sciences physics, chemistry, biology, finance many industrial domains Approaches to modeling: 1. nonparametric modeling impulse response frequency function 2. parametric modeling modeling from measurement data: Black-box modeling modeling from basic physical principles: Physical modeling
Example: buffer tank Characteristics of the water tank: Inflow (input signal): u Outflow (measured output): y (and/or h) Internal variable (state): h Production of formic acid, Perstorp
Method 1: Black-box Identification Basic principle: enter an input, measure an output 2 1.5 u 1 0.5 Simple identification experiments Step response Impulse response Sinusoidal input y 1.2 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 9 10 time 1 0 0.2 0 1 2 3 4 5 6 7 8 9 10 time
Method 1: Black-box Identification Simple, linear first order model y(t) = k(1 e t/t ) Using the Laplace transform: u 2 1.5 1 0.5 where Y (s) = G(s)U(s) = G(s) 1 s Parameters G(s) = k 1 + st k = static gain = 1 T = time constant = 1 y 1.2 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 9 10 time 1 0 true model 0.2 0 1 2 3 4 5 6 7 8 9 10 time
Method 2: Physical principles Basic principle: physical laws = dynamical model mass-balance for incompressible fluids d dt (Ah) = u y A = area of the cross-section of the tank (parameter) Bernoulli law: y = a 2gh a = area of the cross-section of the hole (parameter)
Method 2: Physical principles 2 Resulting (nonlinear) dynamical model for the tank system: dh dt = a u 2gh + A A y = a 2gh u y 1.5 1 0.5 1.2 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 9 10 time 1 0 true lin. model physical model 0.2 0 1 2 3 4 5 6 7 8 9 10 time... provided you get the right values of a and A!
Impulse response for mixing tanks 1. impulse response g(t) known experimentally = non-parametric model 2. parametric model (e.g. black-box): Litiumkoncentration (mg/liter) 1 x x x x x x x x x x x x 0.8 x x x x x x x x x 0.6 x x x x x 0.4 xxx xx 0.2 xxx xx 0xx 0 100 200 300 400 500 600 tid (min) 4 x10-3 Impulssvar x x x x x x x x x x x x 3 x x x x x x x x x x x x x x 2 xxx xx 1 xxx xx 0xx 0 100 200 300 400 500 600 tid (min) G(s) = ( 1 ) 3 st + 1
Example: pupil dynamics 0.4 Ljusflode (mlm) 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 8 9 10 Tid (sek) 25 Pupillarea (kvadrat mm) 20 15 10 0 2 4 6 8 10 12 14 16 18 20 Tid (sek)
Example: pupil dynamics To represent amplitude and phase of the response: frequency function (points on a Bode plot ) non-parametric model 10 0 Amplitud 10-1 * * * * * * * * 10-2 10 0 10 1 10 2 Frekvens (rad/sek) 0 Fas * * * -200 * fit a black-box model: G(s) = e 0.28s 0.19 (1 + 0.09s) 3 * -400 * * * * * -600 10 0 10 1 10 2 Frekvens (rad/sek)
An example from Ecology Example: Hare - Lynx cycles autonomous system: no external input system oscillates, without need of a sinusoidal input predator-prey
Population model N 1 = n. of linx, N 2 = n. of hare d dt N 1(t) = λ 1 N 1 (t) γ 1 N 1 (t) + α 1 N 1 (t)n 2 (t) d dt N 2(t) = λ 2 N 2 (t) γ 2 N 2 (t) α 2 N 1 (t)n 2 (t) 3 2.5 tusental individer 2 1.5 1 0.5 0 0 5 10 15 20
Main characteristics of mathematical models Dynamic Continuos time ODE Deterministic Uncertainty is absent Lumped spatial distribution is not an issue Static Discrete time DAE Stochastic Uncertainty in model and/or measurements Distributed spatial distribution is important
Claudio Altafini www.liu.se