rumoca 0.1.0

A Modelica compiler with focus on Casadi, Sympy, JAX, and Collimator generation
rumoca-0.1.0 is not a library.
Visit the last successful build: rumoca-0.7.28

rumoca CI

A Modelica compiler with focus on Casadi, Sympy, JAX, and Collimator generation.

Building, Testing, and Running

cargo build
cargo run
cargo test
cargo run -- --filename src/model.mo --generator sympy

Installing

cargo install --path .

Make sure you add your rust bin path to your .bashrc and source it, then:

$ rumoca --help
Modelica Compiler

Usage: rumoca [OPTIONS] --filename <FILENAME> --generator <GENERATOR>

Options:
  -f, --filename <FILENAME>    The filename to compile
  -v, --verbose                Verbose output
  -g, --generator <GENERATOR>  Generator to Use [possible values: sympy, json, casadi-mx, casadi-sx]
  -h, --help                   Print help
  -V, --version                Print version

Running

The compiler is currently under development, but some initial results are shown below:

Modelica input file: src/model.mo

model Integrator
    Real x; // test
    Real y;
equation
    der(x) = 1.0;
    der(y) = x;
end Integrator;

Generated sympy output file.

$ rumoca --filename src/model.mo --generator sympy

import sympy

class Integrator:

    def __init__(self):
        self.x = sympy.symbols('x');
        self.y = sympy.symbols('y');

Roadmap

  1. Add more language features
  2. Improve generators
  3. Add support for JAX, Collimator