Concept overview

Technology relies on the established 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 is the support for the innovative extension Optimica. Optimica enables you to conveniently formulate optimization problems based on Modelica models using simple but powerful constructs for encoding of optimization interval, cost function and constraints.

The compilers are developed in the compiler construction framework JastAdd. JastAdd is based on established 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 form 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, 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 compilers as well as the model executables/dlls integrate seemlessly with Python and Numpy.


Architecture: JModelica platform architecture.Architecture: JModelica platform architecture. The platform consists of a number of different parts:

  • Modelica compiler
    • Modelica 3.1 compliant parser
    • Open Java interface to syntax trees
    • Code generation back-end for C-code
    • Code generation back-end for models in XML format
    • Aspect-based language extensions
  • Optimica compiler
    • Extension based on Modelica 3.1 for formulation of dynamic optimization problems
    • Code generation to C and XML 
  • Model Interface (JMI) C Runtime library
    • Well defined API to generated C code
    • Automatic differentiation for efficient Jacobian computations, including sparsity patterns
  • Optimization algorithm
    • Solution of optimal control and parameter estimation problems are solved by a collocation algorithm implemented in C
    • Direct interface to NLP solver IPOPT
  • Python user environment
    • User friendly Python classes to load and access JMI model DLLs and XML meta data
    • Numpy support
    • Compiler API to access and manipulate model Java AST
  • Functional Mockup Interface (FMI) compliance
    • Full FMI import support
    • Full FMI export support
  • XML export
    • Flattened Modelica models, including equations, can be exported in XML format, which allows for flexible integration with tools and algorithms


The platform is extensible in a number of different ways:

  • features a C interface for efficient evaluation of model equations, the cost function and the constraints: the JModelica Model Interface (JMI). JMI also contains functions for evaluation of derivatives and sparsity and is intended to offer a convenient interface for integration of numerical algorithms.
  • In addition to the the C interface, model meta data can be exported in XML. In the future this feature is intended to be extended to include full model export in XML, which in turn enables use of XML techniques such as XPATH and XSLT.
  • JastAdd produces compilers encoded in pure Java. As a result, the compilers are easily embedded in other applications aspiring to support Modelica and Optimica. In particular, a Java API for accessing the flat model representation and an extensible template-based code generation framework is offered.
  • The compilers are developed using the compiler construction framework JastAdd. JastAdd features extensible compiler construction, both at the language level and at the implementation level. This feature is explored in where the Optimica compiler is implemented as a fully modular extension of the core Modelica compiler. The platform is a suitable choice for experimental language design and research.

An overview of the platform is given in the paper Modeling and Optimization with Optimica and and Tools for Solving Large-Scale Dynamic Optimization Problem.