16
University of South-Eastern Norway Page 1 August 10, 2018 | FM1015: Modeling of Dynamic Systems © Bernt Lie Overview of course FM 1015 Modeling of Dynamic Systems Bernt Lie Professor Faculty of Technology, Natural Sciences and Maritime Sciences

Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 1August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Overview of course

FM 1015 Modeling of Dynamic SystemsBernt Lie

Professor

Faculty of Technology, Natural Sciences and Maritime Sciences

Page 2: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 2August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Content

• Learning material• Model forms: ODE vs. DAE• Notation and units• Balance laws• Constitutive models• Models in Modelica• Reduction of DAE to ODE• Analysis• Exam tips• Modelica Example• Summary

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Page 3: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 3August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Learning material …includes

• Lecture notes (free PDF file, syllabus is ca. 350 pp. out of 650+ pp.)

• A number of video tutorials

• 3 sets of quizzes (to get started)

• A compulsory group task/”project”, with oral presentation (counts 40% in grade)

• Written exam (based on group task), counts 60% in grade)

• Notes on the Modelica language (optional). Use Modelica, Python, Julia, and/or MATLAB to solve group “project”

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Page 4: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 4August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Model forms: ODE vs. DAE

ODE:

• State – system history

• Input – influences system

• Parameter – constants

• Output – system response

DAE (simplified):

• As for ODE +

– Algebraic variable

• State in ODE and DAE may be different

• Functions in ODE and DAE are different

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

dxdt

fx,u;

y gx,u;

dxdt

fx, z,u;

0 gx, z,u;

y hx, z,u;

Page 5: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 5August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Notation and units

• Notation

– Single letter – avoid assumed multiplication

– Decoration or indices to distinguish

• Units

– Terms that are equal or terms that are added/subtracted same unit!!

– Argument of transcendental ++ functions should be dimensionless

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Re R e ?

Re ?

NRe !

dm

dt m i m e

m e K h

h

sin xx

, ln xx

Page 6: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 6August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Balance laws

Material balance• Total mass balance:

• Mass species balance:

• Molar species balance:

With 𝑛_𝑠 species, we can only have 𝑛_𝑠independent material balances!!• Level + concentration for liquid• (Partial) pressure for gas

Momentum balance

Energy balance

Thermal energy balance

Use:

• Velocity, flow rate (MB)

• Temperature (EB)

Accumulated variables 𝑥 in DAE

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

dm

dt m i m e

dm j

dt m j,i m j,e m j,g

dnj

dt n j,i n j,e n j,g

dMdt

M i M e F

dE

dt Ė i Ėe W Q

dU

dt H i H e W v W f Q

Page 7: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 7August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Constitutive models I

Types of constitutive models:

• EOS – Equation of State, e.g. ideal gas law

• Introduction of intensive quantities

• Enthalpy:

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

pjV n jRT

p j

pj

mV

m

V

ĉ j mj

V

mj

V

c j n j

V

n j

V

j mj

m

x j n j

n

m V

m j ĉ jV jm

n j c jV x jn

H U pV

H mĤ nH

H m Ĥ nH

dĤ ĉpdT V 1 pTdp

dH c pdT V 1 pTdp

ĉp ĤT p

; c p HT p

p 1

VVT p

1

VVT p

H j1

ns

Hj; H j1

ns

H j

Page 8: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 8August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Constitutive models II

• Bernoulli’s law

• Reaction

• Diffusion

• Kinetic and potential energy

• Friction

• Heat flow

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

m Cv fup

p C v fu h

h

v j v 1ĉ jĴ j v 1

c jJ j

Ĵ j D jĉ j

x, J j D j

c j

x

K 12

mv2, K 12

J2

P mgy, P ksy0 y

F f KAf, K 12|v |v, NRe

vD

f

16NRe

, NRe 2.1 103

1

f 4 log

10NRe f 0.4, NRe 2.3 103, 4 104

Sr

0, r Rnr , Qnrns

r j,g n j,g

V

n j,g

V, rg Tr

Q c k T

x, Q w2b

hTw Tb

1U

j1

nb

1hj

j1

ns j

k j

Q r T4

Page 9: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 9August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Reduction of DAE to ODE

• Reduction of DAE by elimination of algebraic qtys.

• Example:

• Classification:

• Resulting ODE

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

dxdt

fx, z,u;

0 gx, z,u;

dxdt

fx,u;

dmdt

m i m e

m V

V Ah

m e K hh

x m

u m i

,A,K,h

z m e,V,h

dhdt

m iK h

h

A, dm

dt m i K m

Ah

x h, x m

K,h,,A, K,h,,A

u m i

Page 10: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 10August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Models in Modelica

Modelica: language for model description

– Equation based, i.e., order of equations immaterial

– Supports general DAEs

including special case:

Modeling vs. Modelica

– Accumulation quantities from balance laws are differential variables:

– States need initial values, e.g.:

– Inputs and parameters are easy to find

– Remaining variables are algebraic:

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

F dx

dt,x, z,u; 0

dxdt

fx, z,u;

0 gx, z,u;

x m,mj,nj,M,U

xt 0

z m i,m e,m j,i,n j,i, ,n j,g,

M i, ,H i, ,c j ,V ,v,Ĥ,

Page 11: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 11August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Analysis

• Solution of linear ODE

• Linear model asymptotically stable if:

• Time constant

• Linearization:

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

dxdt

Ax Bu

xt expAt x0 0

t

expABud

expAt I At 12At2 1

n!Atn

j : jA 0 dxdt

fx,u; dx

dt Ax Bu

A f

x , B

f

u

Page 12: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 12August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Exam tips

• Before exam:

– Re-work project

– [Exam will be based on/extend project]

– Look over course summary

– Try to solve past exams

– Work with Examples in lecture notes

– Only read those parts of lecture notes needed to understand problems

• During exam:

– Come in good time

– Bring blue or black pen. Do not use pencil or red/green colored pens.

– Answer briefly and straight to the point – there is no time for wordy prose

– Answer clearly – you don’t score by using «fancy»/ unclear explanations

– You don’t pay for the paper – don’t write densely

– Don’t write in the margin

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Page 13: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 13August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Modelica Example: Outline

• Liquid tank: Model Modelica code

• Focus:

– DAE model

– input-output

– two objects from one class

– time varying input

• Conclusions

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Page 14: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 14August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Modelica Example: Liquid tank model Modelica code

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic SystemsVideo

Page 15: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 15August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Modelica Example: Conclusions

• Encoding DAE model to Modelica code

• Model with both input and output

• Instantiating two models for comparing systems

• Time varying input with if-else structure

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems

Page 16: Overview of course FM 1015 Modeling of Dynamic Systems€¦ · MATLAB to solve group “project ... Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems. Title: Sensor

University of South-Eastern Norway Page 16August 10, 2018 |

FM1015: Modeling of Dynamic Systems

© Bernt Lie

Summary

• Modeling of dynamic system:– System: well defined subset of world

– Dynamic: inertial effects

– Model: mathematical model

– Relates inputs to outputs

– Based on mechanistic understanding/classical physics

– Basic analysis

– Need to know: balance laws, Need to understand: constitutive eqs.

• Particular characteristics:– Little emphasis on model manipulation

– Keep model as DAE

– Complete examples: model development + description using Modelica + simulation using OpenModelica

Bernt Lie: Overview of course FM 1015 Modeling of Dynamic Systems