Modelica is an object-oriented acausal modeling language that is well positioned to become a de-facto standard for expressing models of complex physical systems. To simulate a model expressed in Modelica, it needs to be translated into executable code. For generating run-time efficient code, such a translation needs to employ algebraic formula manipulations. As the SPARK solver has been shown to be competitive for generating such code but currently cannot be used with the Modelica language, we report in this paper how SPARK's symbolic and numerical algorithms can be implemented in OpenModelica, an open-source implementation of a Modelica modeling and simulation environment. We also report benchmark results that show that for our air flow network simulation benchmark, the SPARK solver is competitive with Dymola, which is believed to provide the best solver for Modelica.

1 aWetter, Michael1 aHaves, Philip1 aMoshier, Michael, A.1 aSowell, Edward, F. uhttp://www.ibpsa.us/simbuild2008/technical_sessions/SB08-DOC-TS03-1-Wetter.pdf00445nas a2200133 4500008004100000245004100041210004100082260003100123100002000154700001800174700002500192700002300217856007100240 2008 eng d00aUsing SPARK as a Solver for Modelica0 aUsing SPARK as a Solver for Modelica aBerkeley, CA, USAc07/20081 aWetter, Michael1 aHaves, Philip1 aMoshier, Michael, A.1 aSowell, Edward, F. uhttps://buildings.lbl.gov/publications/using-spark-solver-modelica01708nas a2200133 4500008004100000245005400041210005300095260002700148520125500175100002301430700002501453700001801478856007801496 2004 eng d00aGraph-theoretic Methods in Simulation Using SPARK0 aGraphtheoretic Methods in Simulation Using SPARK aArlington, VAc04/20043 aThis paper deals with simulation modeling of nonlinear, deterministic, continuous systems. It describes how the Simulation Problem Analysis and Research Kernel (SPARK) uses the mathematical graph both to describe models of such systems, and to solve the embodied differential-algebraic equation systems (DAEs). Problems are described declaratively rather than algorithmically, with atomic objects representing individual equations and macro objects representing larger programming entities (submodels) in a smooth hierarchy. Internally, in a preprocessing step, graphs are used to represent the problem at the level of equations and variables rather than procedural, multi-equation blocks. Benefits obtained include models that are without predefined input and output sets, enhancing modeling flexibility and code reusability, and relieving the modeler from manual algorithm development. Moreover, graph algorithms are used for problem decomposition and reduction, greatly reducing solution time for wide classes of problems. After describing the methodology the paper presents results of benchmark tests that quantify performance advantages relative to conventional methods. In a somewhat contrived nonlinear example we show O performance as opposed1 aSowell, Edward, F.1 aMoshier, Michael, A.1 aHaves, Philip uhttps://buildings.lbl.gov/publications/graph-theoretic-methods-simulation00486nas a2200133 4500008004100000245005400041210005300095260003800148100002300186700002500209700001800234700002000252856008000272 2004 eng d00aGraph-Theoretic Methods in Simulation Using SPARK0 aGraphTheoretic Methods in Simulation Using SPARK aArlington, Virginia, USAc04/20041 aSowell, Edward, F.1 aMoshier, Michael, A.1 aHaves, Philip1 aCurtil, Dimitri uhttps://buildings.lbl.gov/publications/graph-theoretic-methods-simulation-0