MESM 2002 Sharjah, United Arab Emirates 29 September, 2002 A Software Architecture for Multi-paradigm Modelling Hans Vangheluwe School of Computer Science, McGill University, Montr´ eal, Canada Juan de Lara E.T.S. de Inform´ atica, Universidad Auton´ oma de Madrid, Madrid, Spain Ghislain Vansteenkiste BIOMATH department, Ghent University, Ghent, Belgium MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 1/55
� � � � � � Presentation Overview Complex systems Multi-paradigm Modelling and Simulation 1. Levels of abstraction 2. Multi-formalism Modelling and Simulation 3. Meta-modelling formalism syntax and semantics The AToM 3 environment MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 2/55
PaperPulp mill Waste Water Treatment Plant System of WWTP and Stormwater tanks (DEVS) M,S M,S M,S WWTP (DESS) M,S Aeration Sedimentation Switch Mixing Q Effluent Influent Activated sludge unit M,S Clarifier (DESS) (DESS) Q Recycle (return) flow Output function M,S M,S M,S M,S Input function Stormwater tank 1 Input/Output function Stormwater tank 2 overflow fish + EDRF GE X X CFF GF CFA X + RRA algae Fish Farm MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 3/55
✂ ✁ Complexity (system/model) due to . . . 1. Number of interacting (coupled, concurrent) components (+ feedback) 2. Variety of views at different levels of abstraction 3. Variety of components (software/hardware, continuous/discrete) 4. Uncertainty focus on 1 and 3 MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 4/55
Proposed solution: multi-paradigm modelling and simulation 1. Different levels of abstraction 2. Mixing different formalisms 3. Modelling syntax and semantics of classes of models (formalisms): meta-modelling All are closely related to model transformation MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 5/55
Multi-paradigm dimensions Meta Level Abstraction Level Formalism MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 6/55
✄ System under study: T l controlled liquid closed fill empty is_full is_empty is_cold heat is_hot off cool MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 7/55
✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✠ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ☛ ✡ ✎ ✍ ☛ ✁ ✌ ✟ ✞ ✁ ✆ ☎ ✍ ✆ ✑ ✆ ✌ ☛ ✆ ✍ ✆ ✏ ✆ ✌ ☛ ☛ ✍ ✆ ✑ ✆ ✌ ☛ ✆ ✍ ✝ ✏ ✝ ✌ ✝ ☞ Detailed (continuous) view, ALG + ODE formalism Inputs (discontinuous hybrid model): Emptying, filling flow rate φ Rate of adding/removing heat W Parameters: dT 1 W φ T T in dt l c ρ A Cross-section surface of vessel A dl φ dt Specific heat of liquid c is low l l low Density of liquid ρ is high l l high Temperature of influent T in State variables: is cold T T cold Temperature T is hot T T hot Level of liquid l Outputs (sensors): is low is high is cold is hot MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 8/55
High-level (discrete) view, FSA formalism level cool cool (cold,full) (T_ib,full) (hot,full) heat heat full empty fill l_in_between (cold,l_ib) (T_ib,l_ib) (hot,l_ib) empty fill (cold,empty) (T_ib,empty) (hot,empty) empty temperature cold T_in_between hot MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 9/55
Levels of abstraction/views: trajectories level heat Discrete State Trajectory full on off Continuous State Trajectory fill heat l_in_between off off fill empty off on temperature cold T_in_between hot on off of is_cold sensor is_full sensor off off on is_hot sensor is_empty sensor MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 10/55
Multi-paradigm dimensions: abstraction/formalism Meta Level meta-model low high Abstraction Level model Formalism ODE Formalism FSA Formalism MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 11/55
Multi-paradigm dimension: abstraction Meta Level meta-model low high Abstraction Level model linearize Formalism ODE Formalism MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 12/55
Levels of abstraction/views: morphism model M_t M_d abstraction simulation trajectory traj_t traj_d detailed abstract (technical) level (decision) level MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 13/55
Multi-paradigm dimensions: formalisms Meta Level Abstraction Level Formalism MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 14/55
Forrester System Dynamics model of Predator-Prey uptake_predator loss_prey Grazing_efficiency prey_surplus_BR predator_surplus_DR Predator Prey 2−species predator−prey system MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 15/55
Causal Block Diagram model of Harmonic Oscillator 0.0 x0 K 0.0 1.0 x IC − OUT I y0 1.0 PLOT y IC MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 16/55
Petri Net model of Producer Consumer 1 1 P.Calculating Wait4Prod Rem.from buffer Produce 0 Buffer 0 0 C.Calculating Wait4Cons 1 Buffer−p Consume Put in Buffer MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 17/55
Statechart model of Producer Consumer Producer Buff Consumer Producing Wait4Prod Produce Empty buffer−− [in Buff.Empty] [in Buff.Full] Consume buffer++ / buffer++ / buffer−− Wait4Cons Full Computing MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 18/55
GPSS model of Telephone Exchange Function: 1 LNKS 10 FN1 12 V2 2 R PH1 0 1 V1 PH 1 LNKS LR PH1 PH2 LR R PH1 LNKS 2 V1 H S PH2 P1 NE P2 120 FN1 1 S PH1 MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 19/55
Event Scheduling DAE model of a Train Departure_Event Initialize_Model passengers = passengers − IF x = x_0 v = v_0 1 Train_at_rest passengers = 0 IF AFTER 1 0 START EVENT DepartureStart IF AFTER passengers > 0 AFTER print "Train arrived at t 0 5 Train_is_full Passenger_arrive IF IF print "Train is leaving i passengers = passengers passengers >= 10 1 AFTER 0 Test_zerospeed IF passengers < 10 AFTER 5 monitoring fct.: v AFTER +− random.uniform ( 1 , 10 ) Train_starts print "Train is leaving a BrakingODE x v v − k * ( v + 3 ) AcceleratingODE x v testmax v k * ( v − v_init + 5 ) Start_Braking monitoring fct.: v_max − v +− Stop_Accelerating Start_Accelerating test_arrival testmin monitoring fct.: stopping_x − x +− monitoring fct.: v − v_min +− FrictionODE x v v − k * ( v − 20 ) MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 20/55
Multi-paradigm dimensions: meta Meta Level Abstraction Level Formalism MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 21/55
� � � � What is Meta-modelling ? A meta-model is a model of a modelling formalism A meta-model is itself a model. Its syntax and semantics are governed by the formalism it is described in. That formalism can be modelled in a meta-meta-model. As a meta-model is a model, we can reason about it, manipulate it, . . . In particular, properties of (all models in) a formalism can be formally proven. Formalism-specific modelling and simulation tools can automatically be generated from a meta-model (AToM 3 A Tool for Multi-formalism Meta-Modelling). MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 22/55
� ✒ � Formalisms can be tailored to specific needs by modifying the meta-model (possibly through inheritance if specializing). Building domain/applicatin specific, possibly graphical modelling and simulation environments becomes affordable. Semantics of new formalisms through extension or transformation (multi-formalism). MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 23/55
FSA model of Even Binary Number recognizer 1 1 Init End_1 0 1 0 End_0 0 MESM 2002, 29 September, Sharjah U.A.E hv@cs.mcgill.ca A Software Architecture for Multi-Paradigm Modelling 24/55
Recommend
More recommend