Summer Research

<< back



Table of Content

  1. Abstraction
  2. Calendar

Abstraction

Rearch Areas: Forrester System Dynamics
the Forrester System Dynamics (FSD) formalism was proposed in the 1960s by Jay Forrester at MIT. It is currently a popular formalism for studying problems ran going from population dynamics to software process modelling. I will first investigate the different variants in syntax and semantics of FSD. Information will be obtained from literature as well as from tool comparison.

Subsequently, I will use the software tool AToM3 (A Tool for Multi-formalism Meta-Modelling) developed in the modelling, Simulation and Design Lab (MSDL) to meta-model the FSD formalism. From this meta-model, a visual FSD modelling environment will be synthesized. The repercussions, at the meta-level, of introducing hierarchy in FSD will be investigated. I will then take advantage of computer algebra as well as graph analysis techniques to generate efficient simulation code. This is necessary to be able to solve truly complex problems.

The transformations will be modelled in the form of Graph Grammars to be processed by the AToM3 tool. B ooks' Law for software project dynamics as well as a simplified model of the spreading of HIV will be used as a test cases.


Calender

May, 2003
Jun. 2, 2003 -- Jun. 8, 2003
Jun. 9, 2003 -- Jun. 15, 2003
Jun. 16, 2003 -- Jun. 29, 2003


Modelica is both a object-oriented modeling language and a model exchange spcification. It is designed to allow convenient, component-oriented modeling of complex physical system,e.g., systems containg mchanical, electrical, electronic,and so on. Moreover, Modelica can model dynamic system. That's my concern.
Modelica language is based on real object, so it is objected-oriented. (Real object is a little different from object in programming language. A real object, like resistor, always includes several objeacts ( connector,resister) when implementing it with programming language.) And Python is also OO programming language,so Modelica model should be easy to implement in Python.
DSblock model interface is a neutral, low-level description for complex dynamic system. The proper Modelica compiler can generate DSblock(python code.However I have no idea how to generate these code( I need take cs520). Then, DSblock code will be loaded to simulator to simulate the behavior of model according to user's input.
I think DSblock is tightly relative to Modelica model. The design of DSblock should be based on Modelica model's structure and library.

FDS for population


 a simple modelica model

The graphic Modelica Model(figure 2) is from figure 1. I think this step may be done by AToM3 with the proper graph grammar. Although two graphs look different, they describe one system.
The following Modelica model describe in
 
model PopulationModel
   import Modelica.SystemDynamics

    Additional.Constant k_br("birth rate coefficient");
    Additional.Constant k_dr("death rate coeficient");
    Level population (xstart = 190 000 000);
    Rates.Multiplication_2 birthRate, deathRate; 
equation
    connect(birthRate.flowdown, population.flow1);       
    connect(deathRate.flowup, population.flow2);
    connect(population.state, birthRate.Inport2);
    connect(population.state, deathRate.Inport1);
    connect(k_br.OutPort1, birthRate.Inport1);
    connect(k_dr.OutPort1, deathRate.Inport2);
end Population Model

   
model Level
    parameter Real xstart=0.0 "initial value of state"
    Real x(start=xstart) = state.signal[1] "state variable";
    Real f1=flow1.signal[1] "flow variable one";
    Real f2=flow2.signal[1] "flow variable two";
    Interfaces.FlowIn flow1(SignalType=Integer);
    Interfaces.FlowIn flow2(SignalType=Integer);
    Modelica.blocks.Interfaces.OutPort state;
equation
    der(x) = f1 + f2;
end Level


model Multiplication_2
      extend Dec_2

equation
    r = u1 * u2;
end Multiplication_2


partial model Dec_2 
    protected
       input Real u1=Inport1.signal[1];
       input Real u2=Inport2.signal[2];
       output Real r "flow rate, in default flow direction";
    public
       Modelica.Blocks.Interfaces.Inport Inport1;
       Interfaces.FlowOut flowup;
       Interfaces.FlowOut flowdown;
       Modelica.Blocks.Interfaces.Inport Inport2;
equation
    //route flow signal to output connectors for the flows
    r = flowdown.signal[1];
    flowup.signal[1] = -flowdown.signal[1];
end Dec_2


connector FlowIn
    parameter Integer n=1 "Dimension of signal vector";
    replaceable type SignalType = Real "type of signal";
    input SignalType signal[n] "Real input signals";
end FlowIn;


connector FlowOut
    parameter Integer n=1 "Dimension of signal vector";
    replaceable type SignalType = Real "type of signal";
    output SignalType signal[n] "Real input signals";
end FlowOut;
 

model Constant
    parameter Real k "constant value";
    Modelica.Blocks.Interfaces.OutPort OutPort1;
equation
    OutPort1.signal[1] = k;
end Constant

   

        
Jul. 2, 2003 First, I give a brief explanation about what's simulation and what simulator does. Simulation is the process of using a model to confirm the observation and to predict future behavior.But,what's a model? Acturally, it's mathematic representation of the real-world physical systems, which is a system of equations. Simulator solves these equations using proper solvers, and descript the behavior of model in given condition.
The rough structure of simulator is followed.

simulator structure


Model is Modelica model implemented in Python. The essential part of model is equation.
Solver contains many different solvers, which are a set of algorithms used to solve different equations
Simulator Experiment initial experiment enviroment, use proper solver to solve equations in the model, and descript the corresponding behavior.
Test check if the simulating result is satisfied to user requirement. If yes, output outputs the simulating result in required form. Otherwise, Optimizer will update the corresponding variables according to feedback information and run simulator again. this procedure will repeat until the simulating result satisfies the requirement.

Simulator's design follows the structure in figure 3.But the following simulator is not complete. It doesn't include Optimizer and Test. My design is a little different from the old one. One is solver's design. Simulator may simulate different kind models such as FDS and electrical system, which use algebric equation(AE), Ordinary Differential Equation(ODE), Partial Differential Equation(PDE) and so on. These equations need different solvers (algorthms) to solve them. So I divide solvers into ODE solver,PDE solver,AE solver and other solvers. FDS mainly involves ODE. So I leave PDE solver, AE solver and other solvers out on my furthur design. ODE solver is further divided into fixed step solver and variable step solver. The reason is that fixed step solver is generally unstable but simple and efficient, but variable step solver (adaptive solver in the old simualtor) rarely show the unstble behavior but ineffiecient. Another difference is that all events, which make model transfer into other models or discrete state in same model, are put into teminal method in model. At every step, model only checks the events only relative to itself. Then event handler find the next model by looking for the evert talble in event handler. In addition, composite design pattern could be used in designing the model classes. And observer design pattern is for output design.

simulator design


There are several types of mathematical formulations that are suited for modelling deterministic systems-i.e.systems where uncertainty is not significant. Basically, there are six types of formulation.

miniSimulator Code: