The Modelling and Simulation Process 1. History of Modelling and - - PowerPoint PPT Presentation

the modelling and simulation process
SMART_READER_LITE
LIVE PREVIEW

The Modelling and Simulation Process 1. History of Modelling and - - PowerPoint PPT Presentation

The Modelling and Simulation Process 1. History of Modelling and Simulation 2. Modelling and Simulation Concepts 3. Levels of Abstraction 4. Experimental Frame 5. Validation 6. Studying a mass-spring system 7. The Modelling and Simulation


slide-1
SLIDE 1

The Modelling and Simulation Process

  • 1. History of Modelling and Simulation
  • 2. Modelling and Simulation Concepts
  • 3. Levels of Abstraction
  • 4. Experimental Frame
  • 5. Validation
  • 6. Studying a mass-spring system
  • 7. The Modelling and Simulation Process

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 1/34

slide-2
SLIDE 2

Modelling and simulation: past

(1950–): Numerical simulations: numerical analysis, statistical analysis, simulation languages (CSSL, discrete-event world views). focus: performance, accuracy (1981–): Artificial Intelligence: model = knowledge representation Use AI techniques in modelling, AI uses simulation (“deep” knowledge) focus: knowledge (1988–): Object-oriented modelling and simulation focus: object orientation, later “agents”, non-causal modelling

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 2/34

slide-3
SLIDE 3

Modelling and simulation: past, present, future

(1993–): Multi-formalism, Multi-paradigm (2001 –)

  • 1. Do it right (optimally) the first time (market pressure)
  • 2. Complex systems: multi-formalism
  • 3. Hybrid: continuous-discrete, hardware/software
  • 4. Exchange (between humans/tools) and re-use (validated model)
  • 5. User focus: do not expect user to know details

(software: glueing of components), need for tools

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 3/34

slide-4
SLIDE 4

Real-World entity Base Model System S

  • nly study behaviour in

experimental context experiment within context Model M Simulation Results Experiment Observed Data

within context

simulate = virtual experiment Model Base a-priori knowledge

validation

REALITY MODEL GOALS

Modelling and Simulation Process Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 4/34

slide-5
SLIDE 5

Behaviour (homo)morphism

Real System Abstract Model Experiment Results Simulation Results experiment virtual experiment modelling/abstraction abstraction

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 5/34

slide-6
SLIDE 6

Verification and Validation

Cause Effect Input Output System Conceptual Model Simulation Model Behavioural Validation Conceptual Model Validation Verification Structural Validation

Carl Popper: Falsification, Confidence

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 6/34

slide-7
SLIDE 7

Successful ending Type I Error ending Unsuccessful ending Type II Error Ending Type II Error Type I Error simulation results accepted ? simulation results accepted ? credibility

  • f simulation results

certified ? credibility

  • f simulation results

certified ? actual problem has no credible solution actual problem has a credible solution credible simulation model ? formulated problem contains actual problem ? Type III Error Formulated Problem NO YES NO YES NO YES NO YES NO YES NO YES

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 7/34

slide-8
SLIDE 8

System, Base Model, Lumped Model

DBaseModel

  • DRealSystem

DLumpedModel

E

  • DRealSystem

E

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 8/34

slide-9
SLIDE 9

Experimental Frame Structure

System (real or model) generator transducer acceptor

Experimental Frame

Frame Input Variables Frame Output Variables

Programming Language Types, Pre/Post-conditions

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 9/34

slide-10
SLIDE 10

Models and matching Experimental Frames

"generalization" "generalization"

general restricted more restricted

Models Experimental Frames

"applies to"

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 10/34

slide-11
SLIDE 11

Experimental Frame and Validity

Replicative Validity (

  • : within accuracy bounds):

DLumpedModel

E

  • DBaseModel

E

Predictive Validity:

FLumpedModel

E

FBaseModel

E

Structural Validity (morphism

☎ ✆

):

LumpedModel

E

☎ ✆

BaseModel

E

Simulator Verification:

DSimulator

  • DLumpedModel

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 11/34

slide-12
SLIDE 12

Modelling (and Simulation) Choices

  • 1. System Boundaries and Constraints: Experimental Frame (EF)
  • 2. Level of Abstraction
  • 3. Formalism(s)
  • 4. Level of Accuracy

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 12/34

slide-13
SLIDE 13

System under study: T

l controlled liquid

is_full is_empty heat

  • ff

cool is_cold is_hot

fill empty closed

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 13/34

slide-14
SLIDE 14

System Boundaries (Experimental Frame)

Inputs: liquid flow rate, heating/cooling rate

Outputs: observed level, temperature

Contraints: no overflow/underflow, one phase only (no boiling)

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 14/34

slide-15
SLIDE 15

Abstraction: detailed (continuous) view, ALG + ODE formalism

Inputs (discontinuous

hybrid model):

Emptying, filling flow rate φ

Temperature of inflowing liquid Tin

Rate of adding/removing heat W Parameters:

Cross-section surface of vessel A

Specific heat of liquid c

Density of liquid ρ State variables:

Temperature T

Level of liquid l Outputs (sensors):

is low

is high

is cold

is hot

☛ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ✌ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ✍

dT dt

1 l

W cρA

φ

T

Tin

✒ ✓

dl dt

φ is low

✆ ✑

l

llow

is high

✆ ✑

l

lhigh

is cold

✆ ✑

T

Tcold

is hot

✆ ✑

T

Thot

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 15/34

slide-16
SLIDE 16

Abstraction: high-level (discrete) view, FSA formalism

level temperature cold T_in_between hot full l_in_between empty (cold,empty) empty fill empty fill cool heat cool heat (hot,full) (hot,empty) (cold,full) (cold,l_ib) (T_ib,l_ib) (hot,l_ib) (T_ib,full) (T_ib,empty)

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 16/34

slide-17
SLIDE 17

Levels of abstraction: trajectories (behaviour)

level temperature cold T_in_between hot

  • n
  • ff
  • ff
  • ff
  • f
  • n

is_cold sensor is_hot sensor full l_in_between empty

  • n off
  • ff off
  • ff on

is_full sensor is_empty sensor

Continuous State Trajectory Discrete State Trajectory

fill fill heat heat

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 17/34

slide-18
SLIDE 18

Levels of accuracy

Depends on “equality” metric (definition of accuracy)

Depends on choice of formalism

Depends on choice of numerical approximation

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 18/34

slide-19
SLIDE 19

Levels of abstraction: behaviour morphism

detailed (technical) level abstract (decision) level abstraction simulation M_d M_t trajectory model traj_t traj_d

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 19/34

slide-20
SLIDE 20

A Modelling and Simulation Exercise: the Mass-Spring system

WALL

RestLength [m]

WALL

position x [m] Mass m [kg] Mass m [kg]

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 20/34

slide-21
SLIDE 21

Knowledge Sources

A Priori Knowledge: Laws of Physics

Goals, Intentions: Predict trajectory given Initial Conditions, “optimise” behaviour, . . .

  • 1. Analysis
  • 2. Design
  • 3. Control

Measurement Data

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 21/34

slide-22
SLIDE 22

Measured Data

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 22/34

slide-23
SLIDE 23

Experimental Frame

Room Temperature, normal humidity, . . .

Frictionless, Ideal Spring, . . .

Apply deviation from rest position

Observe position as function of time

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 23/34

slide-24
SLIDE 24

Structure Characterisation

n

1-order polynomial will perfectly fit n data points

Ideal Spring: Feature = maximum amplitude constant

Spring with Damping: Feature = amplitute decreases

Ideal Spring

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 24/34

slide-25
SLIDE 25

Building the model from a-priori knowledge

Newton’s Law

F

M d2∆x dt

Ideal Spring

F

✆ ✏

K∆x

d2∆x dt2

✆ ✏

K M ∆x

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 25/34

slide-26
SLIDE 26

Model representation

CLASS Spring "Ideal Spring": DAEmodel := { OBJ F_left: ForceTerminal, OBJ F_right: ForceTerminal, OBJ RestLength: LengthParameter, OBJ SpringConstant: SCParameter, OBJ x: LengthState, OBJ v: SpeedState, F_left - F_right = - SpringConstant * (x - RestLength), DERIV([ x, [t,] ]) = v, EF_assert( x - RestLenght < RestLength/100), },

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 26/34

slide-27
SLIDE 27

From Model to Simulation

Block-diagrams analog computers, Continuous System Modelling Program (CSMP)

From (algebraic) equation to Block Diagram

Higher order differential equations

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 27/34

slide-28
SLIDE 28

Time-slicing Simulator

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 28/34

slide-29
SLIDE 29

Experimentation

  • 1. Model
  • 2. Parameters (constant for each simulation run)
  • 3. Initial Conditions
  • 4. Input (file, interactive, real system)
  • 5. Output (file, plot, real system)
  • 6. Solver Configuration
  • 7. Experiment type

(simulation, optimization, parameter estimation

model calibration)

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 29/34

slide-30
SLIDE 30

Model Calibration: Parameter Fit

x x_measured

s i m p l e f r i c t i o n l e s s m a s s - s p r i n g s y s t e m time [s]

1 2 3

p o s i t i o n [ m ]

0 . 1 0.2 0.3

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 30/34

slide-31
SLIDE 31

From Here On . . .

Virtual Experiments: simulation, optimisation, what-if, . . .

Validation/Falsification

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 31/34

slide-32
SLIDE 32

The Modelling and Simulation Process

Experimental Frame Definition Structure Characterisation Parameter Estimation Simulation Validation

class of parametric model candidates parametric model model with meaningful parameter values simulated measurements validated model a priori knowledge modeller’s and experimenter’s goals experiment observation (measurement) data

Information Sources Activities

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 32/34

slide-33
SLIDE 33

Experimental Frame Definition problem formulation

Modelling and Simulation Process

communication decision making refinement version management comm ? N Y "release" formulated problem

  • bjectives

questions requirements communicated results communicated problem refined requirements

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 33/34

slide-34
SLIDE 34

Model uses

MODEL - re-use - exchange formal checking formal proof automated test generation simulation automated generation

  • f system/application

(code, possibly embedded) documentation

Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: M&S Process 34/34