# Course Details

#### Name:

**Modellistica E Simulazione / Modelling and Simulation**

##### Type:

Course

The course profile, written following the Tuning international methodology, is available here.

### Basic information

##### Code:

I2I036

##### Sector:

ING-INF/04

##### Credits:

*Laurea Magistrale in Ingegneria Informatica e Automatica:*9 Ects (b)

##### Term:

1

^{st}semester##### Degree(s):

Elective 2

Compulsory 2

^{nd}year Laurea Magistrale in Ingegneria Informatica e Automatica curriculum GeneraleCompulsory 2

^{nd}year Laurea Magistrale in Ingegneria Informatica e Automatica curriculum Automatica##### Language:

Italian

##### Teacher(s):

##### Schedule:

### Course Objectives

Ability of designing several kinds of mathematical models representing different phenomena, with the aim of prediction and control. Ability of software implementation and simulation of the aforementioned models.

### Course Content

- Introduction to modeling and simulation. Classifications of systems. Basic examples. Black box, gray box and white box modeling. Modeling steps: model structure definition, calibration, validation and implementation. The role of data. Simulation in Matlab-Simulink and Excel: basic commands.
- Linear static (deterministic and stochastic) models. Examples. Introduction to the estimation theory. Generalized solution of linear algebraic systems. (Weighed) least squares estimation. Geometric interpretation. Models linear and linearizable in the parameters. Multiple regression. Exercises and implementation in Matlab and Excel. Review on continuous random variables. Introduction to stochastic parametric estimation. Properties of the estimators. Maximum likelihood estimation. Examples. Gauss-Markov estimator. Elements of Bayesian estimation. Minimum variance estimator. Best Linear Estimation in the Gaussian case.
- Nonlinear static models, optimization and data fitting. Common nonlinear phenomena: polynomial, trigonometric, exponential, saturation functions, dead band, quantization, magic formula, examples. Hysteresis. Maximum likelihood weighed least-squares estimator in the non-linear case. Overview of numerical optimization algorithms: iterative methods, gradient descent, Newton and quasi-Newton, trust-region, Gauss-Newton methods. Curve fitting by optimization in Matlab: fminsearch and fminunc. Solving nonlinear least squares problems: lsqnonlin. Fitting in Matlab and graphical analysis of errors.
- Linear dynamical models. State space representations. Review: explicit and implicit forms, natural modes, approach in the frequency domain, steady state response, stability theory, extension to the nonlinear case. Elements of realization theory. Exact and approximate discretization of continuous-time systems.
- Modeling, qualitative and quantitative analysis of linear dynamical systems. Model of river pollution, mass-spring-damper model, car pollution model, work and pension system model, population models, elements of stochastic matrices and their properties, mass balance, uniqueness of the equilibrium with fixed initial condition. Radioactive decay models. Interconnections of linear dynamical systems. Block diagrams. Computation of time constants for discrete-time and continuous-time systems.
- Simulation of linear dynamical systems. State-space representations of linear systems in Matlab: ss, tf, zpk. Model conversions and interconnections. Stability, reachability and observability tests. Reachable and observable realization. Minimal realization. Kalman decomposition. Bode diagrams. Review of synthesis methods: eigenvalue assignment with static state feedback, state observer and separation theorem, stabilization by Nyquist criterion and by root locus. Simulation of continuous-time systems by exact discretization. Simulation of discrete-time systems. Continuous-time simulation in Simulink.
- Estimation theory for linear dynamical systems. Maximum likelihood estimator and minimum variance estimator. Parameter estimation: identification of continuous-time linear systems. Identifiability. Bayesian estimation: Kalman Filter. Parameter identification for linear systems with discrete-time observations in Matlab. Kalman Filter implementation for discrete-time time-invariant systems, asymptotically optimal Kalman Filter, Kalman Filter for time-varying systems.
- Modeling, qualitative and quantitative analysis of nonlinear dynamical systems. Study of local stability by linearization. Planar systems: qualitative analysis, phase plane, characterization of equilibria (nodes, saddles, focuses, centers). Structural stability. Oscillating behaviors and limit cycles, Bendixon criterion. Examples: nonlinear mass-spring-damper model; bank loan model and Napier's number interpretation. Poincarè-Bendixon criterion for planar systems. Prey-predator Lotka-Volterra model. Poincarè theorem of existence of cycles. Bifurcations and catastrophic transitions. Epidemiological models. Evolution model of a forest with exploitation. Logistic growth equation. Examples of joint application of Poincarè theorem and Bendixon criterion to study the equilibrium behavior of planar systems. Hybrid model of rain accumulation.
- Simulation of nonlinear dynamical systems. Numerical methods for solving ordinary differential equations. Explicit/implicit, one-step and multi-step, adaptive, fixed/variable step methods. Euler and Runge-Kutta methods. Integration of non-rigid equations in Matlab using ode45 (Dormand-Prince). Simulation and numerical integration (Euler and 4th-order fixed-step Runge-Kutta) in Excel of previously treated examples. Implementation of the Extended Kalman Filter in Matlab using symbolic calculation functions. Case study: vehicle single-track model with nonlinear tires and its implementation in Simulink. Use of Simulink libraries: modeling of the steering system, calculation of the spatial trajectory. Implementation of a vehicle attitude control system in Simulink by means of Control Lyapunov Functions.
- Time-driven and event-driven (deterministic and stochastic) discrete-state models. Stochastic discrete-state systems. Discrete-Time Markov Chains (DTMC) and Continuous-Time Markov Chains (CTMC). Master Equation. Drawing samples with arbitrary distributions in the case of discrete and continuous random variables. Inverse sampling theorem. Geometric characterization of the CTMC equilibria. Graph theory interpretation. Ergodic CTMCs. The Gillespie Algorithm (SSA) and its Matlab implementation, in Monte-Carlo and ergodic versions, elements of double time-scale simulation.
- Advanced topics. Black-box [N]AR[MA][X] prediction models, in discrete time and in continuous time, with examples. Overview of machine learning and artificial neural networks: modeling perspectives. Sherman-Morrison formula. Recursive least squares. Modeling and simulation via neural networks of a farm automation process. Elements of Stochastic Differential Equations and Euler-Maruyama integration. Elements of Partial Differential Equations, continuity equation. Solution of the one-dimensional transport equation. Elements of modeling and simulation of cooperative multi-agent systems: consensus/agreement problems. Overview of randomized algorithms: randomized calculation of pi; randomized consensus via gossiping.
- Seminars: Systems/Synthetic Biology; models of the glucose-insulin system; traffic models, simulation and control; modeling and control of nuclear processes.

### Learning Outcomes (Dublin Descriptors)

On successful completion of this course, the student should

- approach the modeling and quantitative/qualitative analysis of complex phenomena by means of different mathematical frameworks, as well as implement and simulate such models in software.

### Prerequisites and Learning Activities

Basics of linear algebra and mathematical analysis. Basics of systems and control theory and computer science (programming).

### Teaching Methods

**Language**: Italian

90 hours, including lectures, laboratory, exercises and seminars.

### Assessment Methods and Criteria

Oral exam with possible use of laptop, in order to discuss models and software developed in the course.

### Textbooks

- C. Cassandras, S. Lafortune,
**Introduction to discrete event systems**. Springer. 2008. - M. Dalla Mora, A. Germani, C. Manes,
**Introduzione alla teoria dell'identificazione dei sistemi**. EURoma-La Goliardica. 1997. - J. P. Hespanha,
**Linear Systems Theory**. Princeton University Press. 2009. - G. Guariso, E. Weber,
**Modellistica e simulazione. Esercizi svolti e laboratorio in excel**. Esculapio. 2016. - H. K. Khalil,
**Nonlinear Systems**. Prentice Hall. 2001. - A. Ruberti, A. Isidori,
**Teoria della stabilità - appunti dalle lezioni**. Siderea. 1977.

### Notes

- Web page: http://www.ing.univaq.it/cdl/scheda_corso.php?codice=I2I036

### Online Teaching Resources

### Course page updates

This course page is available (with possible updates) also for the following academic years:*Course information last updated on: 03 gennaio 2018, 19:14*