SCICOS a General Purpose Modeling and Simulation Environment

Embed Size (px)

Citation preview

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    1/9

    Proceedingsof the 4th International Modelica Conference,

    Hamburg, March 7-8, 2005,Gerhard Schmitz (editor)

    M. Naja, S. Furic, R. NikoukhahImagine; INRIA-Rocquencourt, FranceSCICOS: a general purpose modeling and simulation environmentpp. 367-374

    Paper presented at the 4th International Modelica Conference, March 7-8, 2005,Hamburg University of Technology, Hamburg-Harburg, Germany,organized by The Modelica Association and the Department of Thermodynamics, Hamburg Universityof Technology

    All papers of this conference can be downloaded fromhttp://www.Modelica.org/events/Conference2005/

    Program Committee

    Prof. Gerhard Schmitz, Hamburg University of Technology, Germany (Program chair). Prof. Bernhard Bachmann, University of Applied Sciences Bielefeld, Germany. Dr. Francesco Casella, Politecnico di Milano, Italy. Dr. Hilding Elmqvist, Dynasim AB, Sweden. Prof. Peter Fritzson, University of Linkping, Sweden Prof. Martin Otter, DLR, Germany Dr. Michael Tiller, Ford Motor Company, USA Dr. Hubertus Tummescheit, Scynamics HB, Sweden

    Local Organization: Gerhard Schmitz, Katrin Pr ol, Wilson Casas, Henning Knigge, Jens Vasel, StefanWischhusen, TuTech Innovation GmbH

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    2/9

    SCICOS: a general purpose modeling and simulation environment

    M. Naja

    , S. Furic

    , R. Nikoukhah

    Abstract

    Partial support for Modelica is now provided by thegeneral purpose dynamical system simulator Scicos.In particular it is now possible to use component mod-els in Scicos diagrams where the dynamics of the com-ponent has been described in Modelica. This paperpresents this new extension of Scicos.

    KEYWORDS: Dynamic system simulation; Simulationsoftware; Component level modeling; Scilab; Model-ica

    1 Introduction

    Scicos is a Scilab 1 toolbox for modeling and simu-lation of dynamical systems [1, 2]. Scicos providesa hierarchical graphical editor for the construction of complex dynamical systems, a simulator and a code

    generator. For many applications, the Scilab/Scicosenvironment provides a free open-source alternative toMatlab/Simulink and MatrixX.Very general dynamical systems, including hybrid sys-tems, can be modeled in Scicos [3, 4, 5, 6]. A typicalScicos diagram is presented in Fig. 1. This diagramis used to evaluate the performance of an observer bysimulation; the simulation results are given in Fig. 2.The model of Fig. 1 is composed of explicit blocks,i.e., block with explicitly identied inputs and outputs.Modeling with such blocks is called system level mod-

    eling. Component level modeling, on the other hand,allows the use of implicit blocks which are blockswith port connections which a-priori are not labeledas inputs or outputs [7]. Implicit blocks are essentialfor constructing models which include physical com-ponents such as resistors, capacitors, etc., in electric-ity, or pipes, nozzles, etc., in hydraulics. They are alsouseful in many other areas such as mechanics and ther-

    IMAGINE ( www.amesim.com) Corresponding author ([email protected]) M. Naja, R. Nikoukhah are with INRIA-Rocquencourt, Do-

    maine de Voluceau, 78153 Le Chesnay Cedex, France1 Scilab is a free open-source software for scientic computa-

    tion, see www.scilab.org and www.scicos.org.

    Figure 1: A system modeled in Scicos.

    Figure 2: Simulation result of model of Fig. 1 in Sci-cos.

    modynamics. In Modelica community implicit blocksare called acausal [13].

    Contrary to explicit blocks, implicit blocks cannot bemodeled as black box objects. The equations realiz-ing the behavior of an implicit block must be available

    to the compiler for system reduction and code genera-tion. To describe the behavior of these blocks in Sci-cos, the Modelica language has been adopted.

    SCICOS: a general purpose modeling and simulation environment

    The Modelica Association 367 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    3/9

    2 Modelica and Scicos

    Even though Modelica is a rich language having thecapacity to handle continuous-time and discrete-timebehaviors, for the start, we are mainly using Modelicaand implicit blocks to model continuous-time dynam-ics; only minimal support is provided for discrete-timebehavior. The discrete-time behavior, in the Scicos en-vironment, is provided via explicit blocks.The addition of implicit blocks has been done withoutchanging signicantly Scicos formalism. Even thoughimplicit blocks can be used anywhere inside a Scicosdiagram, they are grouped and replaced with a singleblock in a precompilation phase [7]. The mechanism,which can be compared to the way an amesim 2 orDymola 3 model is integrated in Simulink, is com-pletely transparent to the user.

    Figure 3: Scicos diagram containing both types of blocks.

    Consider for example the Scicos diagram in Fig. 3.Here we have a uid level control system. To modelthis system in a natural way, a hydraulic source, a reg-ulated valve, a container, a tube, and a well have beenused. The container has a built-in level sensor whichmakes the interface with the explicit part of the system,similarly the valve is regulated through an input signalfrom the explicit part of model. The controller and thedisplay mechanism have been implemented using ex-plicit blocks and the blocks in gray are implicit blocksthat have been developed in Modelica language.

    2.1 Scicos architecture

    To illustrate our method, a simple owchart given inFig. 4 shows how Scicos and Modelica interact. Adesigner can select blocks from either standard or im-plicit toolboxes. Blocks in implicit toolbox have been

    2 www.amesim.com3 www.dymola.com

    developed using Modelica language. As shown in theowchart, if the model contains an implicit block, af-ter a series of automatic preprocessing steps, implicitpart of model is abstracted into a standard block withexplicit input/outputs; the resulting model can then be

    simulated by Scicos [7].

    Standard Blocks Implicit Blocks

    MODELICALanguage

    xd=f(x,u)y=g(x,u)

    Block Construction level

    are standard?No

    (ODE/DAE solver)

    Simulation

    compiling scicos diagram

    All blocks

    Create modelica modelof the implicit part

    Model design Design level

    Toolbox

    Compile level

    Simulation level

    Yes

    Modelica to C translator

    Create a new block

    Incrementally linking the

    new block with scicos

    Figure 4: system owchart

    2.2 Available implicit toolboxes

    To be able to use implicit blocks in addition to ex-plicit ones in Scicos, several new features have beenadded to Scicos. So far, only two palettes with implicitblocks are available for testing purposes: the electri-

    cal and the thermodynamics palettes. The thermo-hydraulic toolbox and available blocks are shown inFig. 5.

    M. Naja, S. Furic, R. Nikoukhah

    The Modelica Association 368 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    4/9

    Figure 5: Thematic toolbox

    2.3 New link and port type

    Implicit blocks or components are interfaced via spe-cial links associated with physical quantities such ascurrent or voltage in electronics, or, ow or pressurein hydraulics. It would be meaningless for a link rep-resenting a voltage to be connected to another link rep-resenting the output value of a PID controller. To dis-tinguish between these two, two different link typeshave been dened: explicit and implicit links that in-terconnect explicit and implicit ports respectively. InFig. 6 we have a hydraulic container which has fourimplicit ports (marked IP) representing liquid outletsand an explicit port (marked EO) representing a liquidlevel sensor output.

    Figure 6: An implicit block can have implicit and ex-plicit ports.

    2.4 Compiling a mixed diagram

    To compile and simulate a model containing implicitblocks, Scicos groups all implicit blocks into a single

    block having explicit inputs and outputs. Then it gen-erates a Modelica code expressing the behavior of thenew block and save it in a temporary le. This leis then processed by modelicac 4 which translatesthis Modelica code into a C-code describing the be-

    havior of the new Scicos block. Once the C-code iscompiled and incrementally linked in Scilab, Scicossees this new block as a standard explicit block; seeFig. 7. At the end of this procedure, the model is nolonger implicit because all blocks are standard explicitblocks, so the model can be compiled and simulatedas usual. It should be noted that this procedure is com-pletely transparent to the user [7].

    Figure 7: In a precompilation phase, all implicit blocksare grouped to form an explicit block.

    2.5 New numerical Solver

    Most of the time, after generating C code for im-plicit part of the model, we end up with a set of Differential-Algebraic Equations (DAE) that no longercan be integrated via ordinary differential equationsolvers. It is for this reason that the DAE solverDASKR [8, 9, 10, 11, 12] has been incorporated intoScicos.

    3 Modelicac, a Modelica compiler

    Modelicac (acronym of Modelica compiler) is acompiler for the subset of the Modelica language wefelt necessary to handle in order to cover the needs of simulating hybrid models under Scicos. Modelicac isan external tool, i.e. it is independent of Scilab, so

    4 A Modelica compiler and C code generator written inObjective Caml and included in the Scilab distribution.

    SCICOS: a general purpose modeling and simulation environment

    The Modelica Association 369 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    5/9

    one may use it like an ordinary compiler e.g., like a Ccompiler. By default, modelicac comes with a modulethat generates C code for the Scilab target. However,since modelicac is free and open source, it is possibleto develop a code generator for another target.

    3.1 Modelicac development

    Modelicac has been developed in Objective Caml 5

    which is a functional programming language devel-oped at INRIA since 1985. This language is dis-tributed with two compiler-development tools (i.e.,Ocamllex and Ocamlyacc) that offer some nice facil-ities to build compilers. Furthermore the ObjectiveCaml compiler is free and open source, thats why weadopted it to develop modelicac [16].

    3.2 Modelica compilation using modelicac

    Modelicac is invoked for two purposes: compiling ba-sic models from libraries and generating code for thetarget simulation environment. To fulll the rst task,like generating an object le with a C compiler, mod-elicac is invoked with the appropriate options from thecommand line to generate an object le with *.mocextension to be used later. The second task of mod-

    elicac is compiling the main Modelica model (hereprovided by Scicos) and generating a code for the tar-get (here, a C code). In this phase instead of generatingan object le, modelicac performs several simplica-tion steps to generate a code as compact as possible. InFig. 8 a simple owchart shows how modelicac gener-ates a C le from modelica model of a Scicos diagram.

    3.3 Supported Modelica subset

    As said previously, the current version of modelicac(1.x.x) does not handle the full set of Modelica lan-guage constructs. It actually allows only the descrip-tion of physical models at equation level. A phys-ical model is built as the aggregation of sub-modelsor basic types with constraints between variables, andexplicit event declarations (When). Currently mod-elicac has the following main limitations:

    Only Real data type is supported. Inheritance is not currently supported. Algorithm is not supported but it can be dened

    as an external C function.5 caml.inria.fr

    compilationModelica

    Simplification

    Code generation

    Internal Flat Model

    ModelicaLibraries

    *.moc

    "Close" model

    "Open" models

    Modelica filegenerated by scicos

    *.mo

    *.c

    Figure 8: Modelicac translation owchart

    3.3.1 Modelica source les

    Modelica source les must contain only one class dec-laration, introduced either by the class keyword orby the function keyword. So a Modelica source lemay dene one of the following things:

    An open model is a model with free variables.There are more variables than equations (e.g. themodel of a resistor in electrical library). The openmodels are introduced by the class keyword,

    A close model is a model with equal number of variables and constraints. It is also introduced by theclass keyword,

    An external function, introduced by the functionkeyword.Of course, only closed models can be simulated. Inorder to nd classes in the host le system hierarchy,it is required that the name of the le be the same asthe name of the enclosed class. To compile the closemodel modelicac searches the libraries used in the cur-rent compilation directory and also in user-dened di-rectories.The following source code describes a simple resistorenclosed in a Resistor.mo le:

    class ResistorPin p, n;parameter Real R "Resistance";

    M. Naja, S. Furic, R. Nikoukhah

    The Modelica Association 370 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    6/9

    equationR*p.i = p.v - n.v;p.i = -n.i;

    end Resistor;

    An instance of Resistor has two connectors (p

    and n), that have their own potentials and ows vari-ables (here, the voltage and the current, respectively).A resistor has also a resistance parameter imposed bythe component through the rst equation. The secondequation simply states that the current that ows in theresistor through p is equal to the current that owsout through n.

    3.4 Model simplication

    The following tasks are fullled by modelicac to sim-

    plify and generate a C source le from a Modelicasource code and library object code les:

    Obtaining a at model by replacing an aggrega-tion of sub-models by the set of all their variablesand equations merged together and replacing connec-tion equations by ordinary equations. Symbolic ma-nipulations in modelicac are performed using classicalacyclic graph manipulation techniques

    Simplication of trivial or unnecessary equations us-ing symbolic manipulations e.g. in the following sys-tem

    cos x sin y 0cos x sin y 0 z x y 0 f x y z v 0

    the rst two equations are fully non-linear and onlythe numerical solver can solve the system for x and y.But the third equation is trivial and z can be obtainedin terms of x and y, so in the rest of equations z isreplaced by x y. Most of the variables used to con-

    nect Modelica components (connection variables),are eliminated in this way. Causality analysis, i.e. computation of systems Ja-cobian matrix. It will be explained further.

    3.4.1 Causality analysis

    Causality analysis performs a few operations in orderto nd the so-called strongly connected componentsof a system of equations viewed as a directed bipartitegraph [13]:

    1. Constructing a bipartite graph whose nodes onthe left represent variables in the system and

    whose nodes on the right represent constraints be-tween variables (i.e., equations). There is an edgebetween a left-side node and a right-side node if and only if the variable represented by the left-side node appears in the equation represented by

    the right-side node.2. Finding a coupling (using the Ford and Fulkerson

    method for instance)

    3. Giving the edges an orientation depending on theresults of the previous step. Edges that link twocoupled nodes are all oriented in a given direction(either left-to-right or right-to-left) and the otherones in the opposite direction.

    4. Finding strongly connected components in the re-

    sulting oriented graph (using Tarjans algorithmfor instance)

    5. Sorting the resulting nodes in a topological order.

    Each strongly connected component represents a sub-system of the whole system and it is now possible toperform symbolic simplication steps in order to re-duce the number of variables in the system.

    3.4.2 Modelicac simplication strategy

    Symbolic simplications typically involve variants of the Gauss method (to solve linear systems) and sim-ple symbolic simplication methods based on a set of predetermined patterns (for efciency reasons) to tryto solve the remaining equations. In modelicac we fo-cused on the second class of simplication methods.The problem when trying to solve a set of non-linearequations is to determine a coupling in the bipartitegraph described above that triggers as many simpli-cations as possible. So the Ford and Fulkerson (or

    equivalent) method is not enough for our purposes: in-stead of taking the rst encountered coupling, we wantin addition that the coupling satisfy a given criterion(e.g. maximizing the potential number of simplica-tions in the system). Hence the use of a variant of theHungarian method which can be seen in modelicac asa method for nding a coupling based on an additionalconstraint called the satisfaction. Practically, that isdone in modelicac by associating a set of pairs (vari-able, weight) with each equation: given an equation,each weight indicates whether the equation is easy to

    solve with respect to its associated variable or not. Forinstance, if an equation contains only one variable, theweight associated with that variable is low whereas the

    SCICOS: a general purpose modeling and simulation environment

    The Modelica Association 371 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    7/9

    weight associated with any other variable is innite.Since modelicac associates low weights with variablesthat appear in linear systems, the Hungarian methoddiscovers linear systems by itself and symbolic sub-stitution techniques, when applied to those linear sys-

    tems, achieve the same effect as Gaussian elimination.Even though we did not consider the Gaussian elimi-nation algorithms in modelicac, we got good results.

    3.5 A complete (yet simple) example

    First, we present the Modelica source code of a fewelectrical models from electrical library and then showhow to use these models to construct and compile elab-orated electrical models with modelicac.

    3.5.1 Connectors

    In Scicos libraries connectors are the most basicopen models. Each particular domain (e.g., electrical,hydraulic, etc.) has a its own connectors that connecttwo or more models and exchange quantities. The aretwo connector types:

    Internal connectors, that allow connection of twoModelica components, such as p and n pins usedin electrical resistor model.

    class PinReal v;

    flow Real i;end Pin;

    External connectors, that allow communication of a Modelica component with an external environment(Explicit part of model in Scicos environment, for in-stance). Instances of InPutPort and OutPutPortare examples of these connectros types

    class InPutPortinput Real vi;

    end InPutPort;

    class OutPortoutput Real v;

    end OutPort;

    These types of connectors are used in sensor and actu-ator blocks that can be seen in Fig. 3 and 9.

    3.5.2 Electrical component classes

    These models include the ideal resistor, capacitor, in-ductor, sinusoidal voltage source and ground.

    class Ground "Ground"Pin p;

    equation

    p.v = 0;end Ground;

    class CapacitorPin p, n;Real v;

    Real i;parameter Real C "Capacitance";

    equationC*der(v) = i;v = p.v - n.v;0 = p.i + n.i;i = p.i;

    end Capacitor;

    class Inductor "Ideal electrical inductor"Pin p, n;Real v;Real i;parameter Real L "Inductance";

    equationv = L*der(i);v = p.v - n.v;0 = p.i + n.i;i = p.i;

    end Inductor;

    class VsourceAC "Sin-wave voltage source"Pin p, n;Real v;Real i;

    parameter Real VA=220 "Amplitude";parameter Real f=50 "Frequency";parameter Real PI=3.1415926 "PI";

    equationv = VA*2*PI*f*time;v = p.v - n.v;0 = p.i + n.i;i = p.i;

    end VsourceAC;

    3.5.3 Main class

    In order to perform the simulation of an electrical cir-cuit one normally has to describe the circuit usingModelica by dening the components involved (i.e.giving their names and the value of their parameters)and the connections to establish. Then, modelicacshould be invoked with the appropriate options and ar-guments. This task is done by Scicos, provided thatthe appropriate library exist in Scicos;In fact it is not necessary to write any Modelica code

    to build a circuit: one can assemble components usingthe Scicos editor and then Scicos automatically buildsthe Modelica source code from the graphical specica-

    M. Naja, S. Furic, R. Nikoukhah

    The Modelica Association 372 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    8/9

    Figure 9: An electrical circuit modeled in Scicos.

    tion and invokes modelicac to convert Modelica codeinto C code. In Fig. 9 there is a model of an electricalcircuit modeled in Scicos. Here is its Modelica classautomatically generated by Scicos:

    class imppart_rlcparameter Real P1=0.0001;parameter Real P2=0.1;parameter Real P3=25.0;parameter Real P4=0.2;parameter Real P5=50.0;Inductor B1(L=P1);Capacitor B2(C=P2, v(start=P3));Ground B3;VoltageSensor B4;CurrentSensor B5;

    Resistor B6(R=P4);VVsourceAC B7(f=P5);OutPutPort B8;OutPutPort B9;InPutPort B10;

    equationconnect (B5.p,B3.p);connect (B7.p,B3.p);connect (B2.p,B1.p);connect (B4.p,B1.p);connect (B6.n,B1.p);connect (B2.n,B1.n);connect (B4.n,B1.n);connect (B5.n,B1.n);connect (B7.n,B6.p);B4.v = B8.vi;B5.i = B9.vi;B10.vo = B7.VA;

    end imppart_rlc;

    For this model modelicac generates a C code. This Ccode is incrementally linked with Scicos to be used asa standard block.

    /*number of discrete variables = 0number of variables = 3number of inputs = 1number of outputs = 2number of modes = 0

    number of zero-crossings = 0I/O direct dependency = false*/

    #include #include

    void rlc(scicos_block *block, int flag){

    double *rpar = block->rpar;

    double *z = block->z;double *x = block->x;double *xd = block->xd;double **y = block->outptr;double **u = block->inptr;double *g = block->g;double *res = block->res;int *jroot = block->jroot;int *mode = block->mode;int nevprt = block->nevprt;int property[3];

    /* Intermediate variables */double v0,v1;

    i f ( f lag == 0) {res[0] = x[1]-xd[0]*rpar[0];res[1] = x[0]+xd[1]*rpar[1]-x[2];v1=get_scicos_time();res[2] = x[1]+x[2]*rpar[3]+sin(6.28318530718*v1*rpar[4])*u[0][0];

    } e lse i f ( f lag == 1) {if (get_phase_simulation() == 1) {

    y[0][0] = x[1]; /* main.B8.vo */y[1][0] = -x[2]; /* main.B9.vo */

    } e lse {y[0][0] = x[1]; /* main.B8.vo */y[1][0] = -x[2]; /* main.B9.vo */

    }} e lse i f ( f lag == 2 && nevprt < 0) {} e lse i f ( f lag == 4) {

    x [0 ] = 0. 0; / * m ai n. B1 .i * /x[1] = rpar[2]; /* main.B2.v */x [2 ] = 0. 0; / * m ai n. B6 .p .i */Set_Jacobian_flag(1);

    } e lse i f ( f lag == 6) {} e lse i f ( f lag == 7) {

    property[0] = 1; /* main.B1.i (state variable) */property[1] = 1; /* main.B2.v (state variable) */property[2] = -1; /* main.B6.p.i (algebraic variable) */set_pointer_xproperty(property);

    } e lse i f ( f lag == 9) {} e lse i f ( flag == 10) {

    v0 = Get_Jacobian_parameter();res[0] = -rpar[0]*v0;res[1] = 1.0;res[2] = 0.0;res[3] = 1.0;res[4] = rpar[1]*v0;res[5] = 1.0;res[6] = 0.0;res[7] = -1.0;res[8] = rpar[3];res[9] = 0.0;res[10] = 0.0;res[11] = sin(6.28318530718*get_scicos_time()*rpar[4])res[12] = 0.0;res[13] = 0.0;res[14] = 1.0;res[15] = 0.0;res[16] = 0.0;res[17] = -1.0;res[18] = 0.0;res[19] = 0.0;set_block_error(0);

    }

    return;}

    Conclusion

    The use of Modelica in Scicos provides a versatilemodeling and simulation tool.

    References

    [1] C. Bunks, J. P. Chancelier, F. Delebecque, C.Gomez(ed.), M. Goursat, R. Nikoukhah and

    SCICOS: a general purpose modeling and simulation environment

    The Modelica Association 373 Modelica 2005, March 7-8, 2005

  • 8/6/2019 SCICOS a General Purpose Modeling and Simulation Environment

    9/9

    S. Steer, Engineering and Scientic Computingwith Scilab , Birkhauser, 1999.

    [2] J. P. Chancelier, F. Delebecque, C. Gomez, M.Goursat, R. Nikoukhah, and S. Steer, Introduc-tion a Scilab , Springer-Verlag, 2002.

    [3] R. Nikoukhah and S. Steer, Scicos a dynamicsystem builder and simulator , IEEE I NTERNA -TIONAL C ONFERENCE ON CACSD, Dearborn,Michigan, 1996.

    [4] R. Nikoukhah and S. Steer, Hybrid systems:modeling and simulation , COSY: M ATHEMAT -ICAL M ODELLING OF C OMPLEX S YSTEM ,Lund, Sweden, Sept. 1996.

    [5] A. Benveniste, Compositional and Uniform Modeling of Hybrid Systems , IEEE Trans. Au-tomat. Control, AC-43, 1998.

    [6] R. Nikoukhah and S. Steer, Scicos: A DynamicSystem Builder and Simulator, Users Guide -Version 1.0 , INRIA Technical Report, RT-0207,June 1997.

    [7] M. Naja, A.Azil, and R. Nikoukhah, Extendingscicos from system to component level simula-tion , ESMc2004 international conference, Paris,

    France, October 2004.

    [8] K. E. Brenan, S. L. Campbell, and L. R. Pet-zold, Numerical Solution of Initial-Value Prob-lems in Differential-Algebraic Equations , SIAMpublication, Philadelphia, 1996.

    [9] A. C. Hindmarsh, LSODE and LSODI, TwoNew Initial Value Ordinary Differential Equa-tion Solvers, ACM-Signum Newsletter , Vol. 15,1980, pp. 1011.

    [10] L. R. Petzold, Automatic selection of methodsfor solving stiff and nonstiff systems of ordinarydifferential equations, SIAM J. Sci. Stat. Com- put. , No. 4, 1983.

    [11] L. R. Petzold. A Description of DASSL: A Dif-ferential/Algebraic System Solver, In Proceed-ings of the 10th IMACS World Congress , Mon-treal, 1982, pp. 8-13.

    [12] P. N. Brown, A. C. Hindmarsh, and L. R.

    Petzold, Consistent Initial Condition Calcula-tion for Differential-Algebraic Systems , SIAM J.S CI . COM P ., NO . 19, 1998.

    [13] P. F RITZSON ,Principles of Object-Oriented Modeling and Simulation with Modelica 2.1 ,W ILEY -IEEE P RESS , 2004

    [14] S.E. M ATTSSON , H. E LMQVIST , M. O TTER ,AND H. O LSSON , I NITIALIZATION OF H Y-BRID D IFFERENTIAL -A LGEBRAIC EQUATIONSIN M ODELICA 2.0, 2nd Inter. Modelica Con- ference 2002 , DYNASIM AB, S WEDEN ANDDLR O BERPFAFFENHOFEN , GERMANY , 2002,PP . 915.

    [15] R. N IKOUKHAH AND S. S TEER , C ONDI -TIONING IN HYBRID SYSTEM FORMALISM , International Conference Automation of Mixed Processes:A D P M Hybrid Dynamic Systems ,D ORTMUND , GERMANY , 2000.

    [16] W EIS , P IERRE , LEROY , XAVIER , Le LangageCAML , 2ND ED , DUNOD P RESS , 1999

    M. Naja, S. Furic, R. Nikoukhah

    The Modelica Association 374 Modelica 2005, March 7-8, 2005