<< back
|
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.
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.
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 ConstantJul. 2, 2003
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.