Process Modelling and Simulation with Application to the MATLAB/Simulink Environment CZECH REPUBLIC František Gazdoš (gazdos@fai.utb.cz) November, 2016 Università di Cagliari, Sardinia (IT)
COUNTRIES & REGIONS Italy / Sardinia / Cagliari (60M / 1.6M / 154k ) Czech Republic / Zlín Region / Zlín (10.5M / 600k / 75k) Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš
UNIVERSITIES Università di Cagliari (more than 30.000 students) Faculty of Biology and Pharmacy Faculty of Engineering and Architecture Faculty of Medicine and Surgery Faculty of Sciences Faculty of Economic Sciences, Law and Political Sciences Faculty of Humanities Tomas Bata University in Zlín (more than 10.000 students) Faculty of Technology Faculty of Management and Economics Faculty of Multimedia Communications Faculty of Applied Informatics Faculty of Humanities Faculty of Logistics and Crisis Management Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš
Faculty of Applied Informatics Studies: Bachelor s Degree studies Follow-on Master s Degree studies Ph.D. Degree studies A number of courses in English for International students! You are Welcome! R&D in: Applied Informatics Security Technologies Automatic Control Measurement and Instrumentation Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš
Process modelling and simulation / contents CONTENTS 1 Motivation Why? 2 Approaches How? 3 Illustrative examples room heating process mass-spring-damper system tubular heat exchanger 4 Introduction to MATLAB & Simulink basics of MATLAB programming (displaying process static characteristics) basics of Simulink (solving differential equations process dynamics responses) building Simulink blocks, masking 5 Further - What else? Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 2
Process modelling and simulation / why? 1. MOTIVATION WHY? it saves time! (slow real-time experiments ) it saves costs! (expensive real-time experiments, repairs ) it saves health & lives! (hazardous real-time experiments, dangerous conditions ) Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 3
Process modelling and simulation / how..? 2. APPROACHES HOW? ANALYTICAL approach: material & energy balances mathematical description of physical, chemical, bilogical sub-processes analytical (internal, state-space) model structure & behaviour model (model variables & parameters correspond to real process variables & parameters) valid in wide range of input variables and modes (often not allowable under real conditions ) knowledge of the process + mathemathics, physics, chemistry, bilogy design stage of a new technology (real plant still does not exists ) Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 4
Process modelling and simulation / how..? 2. APPROACHES HOW? EMPIRICAL approach: real-time measurements (input output) measured data processing & evaluation (model structure choice, identification, ) experimental (external, input-output) model only behaviour model (model variables & parameters DO NOT correspond to real process variables & parameters) process must already exist (real-time measurements) usually simpler model often more accurate model (for the measured range of input signals!) usually time-demanding Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 5
Process modelling and simulation / how..? 2. APPROACHES HOW? COMBINATION analytical + empirical (basic model structure by an analysis + parameters via experiments ) what to model? mathematical model = SIMPLIFIED reality (some sub-processes unknown, some neglected ) what to neglect? how accurate model is needed? TRADE-OFF (model accuracy x model complexity) how complex the model can be? Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 6
Process modelling and simulation / how..? 2. APPROACHES HOW? schematic picture definition of variables (input, output, state) simplifying assumptions energy / material balances steady-states analysis choice / estimate / determination of model parameters process variables limits, model validity choice of initial / boundary conditions & operating point(s) for simulation implementation of the model simulation experiments experiments evaluation model verification / corrections Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 7
Process modelling and simulation / examples 3. ILLUSTRATIVE EXAMPLES schematic picture: definition of variables: inputs: - heat power P(t) in [W] ROOM heating process: simplifying assumptions: - ideal air mixing - constant process parameters (air volume V, density, heat capacity c P, overall heat transfer coefficient a, heat transfer surface area A, ) - heat accumulation in the walls neglected - - outdoor temperature T C (t) in [K] states: - room temperature T(t) in [K] outputs: - room temperature T(t) in [K] Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 8
Process modelling and simulation / examples 3. ILLUSTRATIVE EXAMPLES energy / material balances: ROOM heating process: steady-states analysis: heat input = heat output + heat accumulation (heat loss due to exchange of air and heat conduction through the walls) (steady variables) Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 9
Process modelling and simulation / examples 3. ILLUSTRATIVE EXAMPLES ROOM heating process: choice / estimate / determination of model parameters: A = 55 [m 2 ], V = 70 [m 3 ] measured a = 1.82 [W/(m 2 K)] estimated (steady-state model for P s = 2000 [W] and T s = 20 [K]) = 1.205 [kg/m 3 ], c p = 1005 [J/(kgK)] taken from the literature (for T = 20 [ C]) process variables limits, model validity - no singular states - model valid in common (reasonable chosen) conditions choice of initial / boundary conditions & operating point(s) for simulation T(0) = 25 [ C] = 298.15 [K] P = 2000 [W] Tc = 5 [ C] = 278.15 [K] Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 10
Process modelling and simulation / examples 3. ILLUSTRATIVE EXAMPLES ROOM heating process: implementation of the model (steady-state model, dynamic model ) simulation experiments experiments evaluation model verification / corrections - linear 1 st order system, - with lumped parameters, - continuous-time, - deterministic, - multivariable (MIMO), - time-invariant Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 11
Process modelling and simulation / MATLAB 4. INTRODUCTION TO MATLAB & SIMULINK basics of MATLAB programming (displaying process static characteristics) basics of Simulink (solving differential equations process dynamics responses) building Simulink blocks, masking Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 12
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES schematic picture: Mass-spring-damper system: (simplified car shock absorber) definition of variables: inputs: - forcing function F(t) in [N] simplifying assumptions: - ideal spring - well lubricated, sliding surface (wall friction modelled as viscous damper) - constant process parameters (spring constant k, friction constant b, mass of load m, ) - states: - position y(t) in [m] - velocity v(t) = dy(t)/dt in [m/s] outputs: - position y(t) in [m] Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 13
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES performing a force balance: (& utilizing Newton s 2 nd law of motion ) Mass-spring-damper system: steady-states analysis: (steady variables) spring force friction force (viscous damper) Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 14
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES Mass-spring-damper system: choice / estimate / determination of model parameters: m = 500 [kg] load of mass (measured) k = 2000 [N/m] spring constant (taken form the literature) b = 400 [N/(m/s)] friction constant / viscous damping coefficient (taken from the literature) process variables limits, model validity - no singular states - model valid in common (reasonable chosen) conditions choice of initial / boundary conditions & operating point(s) for simulation y(0) = dy(0)/dt = 0 [m] F = 50 [N] Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 15
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES Mass-spring-damper system: implementation of the model (steady-state model, dynamic model ) simulation experiments experiments evaluation model verification / corrections - linear 2 nd order system, - with lumped parameters, - continuous-time, - deterministic, - single-input single-output (SISO), - time-invariant Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 16
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES Mass-spring-damper system: transfer function description (using the Laplace transform): Gain K damping coefficient steady-state gain: time-constant T time-constant (natural period / inverse natural frequency): natural frequency: damping coefficient: Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 17
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES Mass-spring-damper system: state-space description: define states as: and input as: then output will be: then it holds: and the 2 nd order model can be rewritten into two 1 st order DE: in the matrix form: A B C D Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 18
Process modelling and simulation / examples ILLUSTRATIVE EXAMPLES state-space description: in the compact form: Mass-spring-damper system: with matrices as: and initial conditions: easy simulation in the MATLAB/Simulink using the Transfer Fcn or State-Space blocks... Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 19
Process modelling and simulation / what else..? 5. FURTHER for control engineers linearization in a chosen operating point (for nonlinear models ) deviation variables & proper scaling system analysis - state-space / transfer function description...? - controllabilty & observability...? - system degree & type (P/I/D)...? - system gain & time-constants...? - (un)stable...? - (a)periodic response...? - (non-)minimum-phase behaviour...? - with(out) time-delay? - linear / nonlinear? - with lumped / distributed parameters...? - continuous / discrete-time...? - deterministic / stochastic...? - single-variable / multi-variable...? - time-invariant / variant...? Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš 20
Process modelling and simulation / what else..? 5. FURTHER for self-study WELLSTEAD, P. Introduction to Physical Modelling. Academic Press, 1980. SEVERANCE, F.L. System Modeling and Simulation: An Introduction. Wiley, 2001. INGHAM et al. Chemical Engineering Dynamics: Modelling with PC Simulation. Wiley, 1994. LUYBEN, W.L. Process Modeling, Simulation and Control for Chemical Engineers. McGraw-Hill, 1990. HANSELMAN, D.C. & LITTLEFIELD, B.L. Mastering MATLAB. Prentice Hall, 2011. DABNEY, J.B. & HARMAN, T.L. Mastering Simulink. Prentice Hall, 2003. SKOGESTAD, S & I. POSTLETHWAITE, I. Multivariable Feedback Control: Analysis and Design. Chichester: Wiley, 2005. Thank you for your attention! Erasmus lectures at Università di Cagliari in November 2016 / František Gazdoš