U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group TLTE.3120 Computer Simulation in Communication and Systems (5 ECTS) Lecture 5 – Timo Mantere Professor, Communications & systems University of Vaasa 1
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES 2 Model structures relates on mathematical modelling and system identification, see additional information e.g. from: Mathematical model: Dynamical system: System that changes over time, e.g. pendulum, quite often they might have unpredictable behavior due that the system parts interact with each others
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES Static models Linear Nonlinear Dynamic models Continuous differential equations Continuous time-delay equations Difference equations Partial differential equations Transfer functions SIMULINK – starters Stochastic processes Parameterized models – Curve fitting 3
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES STATIC MODELS Linear, scalar y = k u + b y, u real numbers y output; u input; k gain; b bias EXAMPLE: OHM’s Law U=RI U = voltage (output) I = current (input) R = resistor 4 Interferece etc. b Output y Input u System k
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES STATIC MODELS Nonlinear, scalar y = f(u; a), a is a parameter EXAMPLE: OHM’s Law with nonlinear resistor R = R(I) = R 0 I 2 ; Resistor depends on current
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES STATIC MODELS Linear, multi-input multi-output (MIMO) y = Au + b y is output vector (m elements) u input vector (n elements) b constant vector (m elements) A matrix (n*m)
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES EXAMPLE Linear, multi-input multi-output (MIMO) y = Au 7
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES MATLAB - EXAMPLE >> A=[2 0;3 6] A = >> u=[0.5; 0.4] u = >> y=A*u y =
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Linear, scalar If the system input changes as a function of time we need dynamic model a and b are constants 9
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS - EXAMPLE 1798: Model of population dynamics (Malthus, ) : Assume that the growth is directly proportional to population size. Population at year 1960 was and its growth 2%. Compute how population evolved up to year
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group Year Population Average annual growth rate (%) Average annual population change 19603,039,669, ,792, ,632,780, ,286, ,708,067, ,587, ,785,654, ,694, ,862,348, ,183, ,938,532, ,547, ,085,478, ,220, ,159,699, ,002, ,232,702, ,442, ,305,144, ,496, ,377,641, ,578, ,450,219, ,540, ,522,760, ,466, ,595,226, ,442, ,667,669, ,368, ,740,037, ,210,364
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES 12
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES 13
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES MATLAB – SIMULINK SOLUTION Consider the left-hand side of the equation – integrate it: In SIMULINK, the integral operator is – in goes out comes x(t). x(t)
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES MATLAB – SIMULINK SOLUTION What about x(t 0 )? Click the integrator block open. In the Initial condition type 3.04*10^9. Until now, we have handled the left-hand side of the equation. In order to have balance in the equation, we need to complete the SIMULINK diagram with the term 0.02x(t).
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES MATLAB – SIMULINK SOLUTION x(t) 0.02x(t)
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES MATLAB – SIMULINK SOLUTION – SOLUTION DISPLAYED WITH A SCOPE x(t) 0.02x(t) Simulation result
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES Logistic population model Population cannot grow without limit. One way to restrict the growth is to introduce a negative quadratic term (Verhulst). 18
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES Logistic population model Verhulst used the model to predict quite accurately the population growth in USA with the following model. The initial population is from year
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES SIMULINK configuration of Verhulst logistics equation Simulation result 20
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group Model Structures, nonlinearity Non-parametric models Weight- and frequency functions can be measured directly from the process A prior knowledge about the model structure is not required Polynomial models Based on preliminary prior knowledge about the model structure Nonlinear systems m ay be simplified such that the parameter estimation problem becomes linear Linearization Simplification have its risks and it is not always possible Computation programs In-build optimization and estimation routines (Matlab etc.) 21
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Nonlinear, multi-input multi-output (MIMO) Vector differential equation is in form: Where x, u, f, and x(dot) are column vectors, X 0 is the start value at time point 0 In dynamic systems often part of the states are measured, so y is measurement data 22
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Nonlinear, multi-input multi-output (MIMO)
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Nonlinear, multi-input multi-output (MIMO) 24
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Nonlinear, multi-input multi-output (MIMO) 25
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Linear, multi-input multi-output (MIMO) A (nxn), B (nxm), C (pxn) and D (pxm) real, constant 26
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Delay equations, multi-input multi-output (MIMO) Initial datahistory 27
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Delay equations L QiQi Input mass flow QoQo Output mass flow vSpeed Length 28
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Delay equations
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group MODEL STRUCTURES DYNAMIC MODELS Discrete time or 30
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group ELLIPTICAL membrane PARTIAL DIFFERENTIAL EQUATIONS 31 PARABOLIC
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group HYPERBOLIC PARTIAL DIFFERENTIAL EQUATIONS 32 DISCRETIZATION
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group Discretization w.r.t. space variable PARTIAL DIFFERENTIAL EQUATIONS where 33
U NIVERSITY of V AASA Communications and Systems Engineering Group U NIVERSITY of V AASA Communications and Systems Engineering Group Discretization w.r.t. space variable leads to PARTIAL DIFFERENTIAL EQUATIONS 34