3. Technology

JModelica.org relies on the modeling language Modelica. Modelica targets modeling of complex heterogeneous physical systems, and is becoming a de facto standard for dynamic model development and exchange. There are numerous model libraries for Modelica, both free and commercial, including the freely available Modelica Standard Library (MSL).

A unique feature of JModelica.org is the support for the extension Optimica. Optimica enables users to conveniently formulate optimization problems based on Modelica models using simple but powerful constructs for encoding of optimization interval, cost function and constraints.

The JModelica.org compilers are developed in the compiler construction framework JastAdd. JastAdd is based on a number of different concepts, including object-orientation, aspect-orientation and reference attributed grammars. Compilers developed in JastAdd are specified in terms of declarative attributes and equations which together forms an executable specification of the language semantics. In addition, JastAdd targets extensible compiler development which makes it easy to experiment with language extensions.

For user interaction JModelica.org relies on the Python language. Python offers an interactive environment suitable for scripting, development of custom applications and prototype algorithm integration. The Python packages Numpy and Scipy provide support for numerical computation, including matrix and vector operations, basic linear algebra and plotting. The JModelica.org compilers as well as the model executables/dlls integrate seamlessly with Python and Numpy.

JModelica.org offers strong support for the Functional Mock-up Interface (FMI) standard. FMI specifies a format for exchange of compiled dynamic models and it is supported by a large number of modeling and simulation tools, including established Modelica tools such as Dymola, OpenModelica, and SimulationX. FMI defines a model execution interface consisting of a set of C-function signatures for handling the communication between the model and a simulation environment. Models are presented as ODEs with time, state and step events. FMI also specifies that all information related to a model, except the equations, should be stored in an XML formated text-file. The format is specified in the standard and specifically contains information about the variables, names, identifiers, types and start attributes. A model is distributed in a zip-file with the extension '.fmu', these zip-files containing the models are called FMUs (Functional Mock-up Units). FMI version 1.0 specifies two types of FMUs, either Model Exchange or Co-Simulation. The difference between them is that in a Co-Simulation FMU, the integrator for solving the system is contained in the model while in an Model Exchange FMU, an external integrator is needed to solve the system. The JModelica.org compiler supports export of FMUs and FMUs can be imported into Python using the Python packages included in the platform.