OpenModelica


Forgot password? | Forgot username? | Register

Python Modelica Compiler/ Anyone want to help?

Python Modelica Compiler/ Anyone want to help?

I've been working with openmodelica for awhile and always have found it difficult to extend the compiler for my needs. Recently ANTLR released a python runtime. I was able to easily combine the AST created with antlr and the jinja templates engine to create a compiler from modelica to a python based simulation for simple examples. I'm looking for anyone with interest in helping me out.

https://github.com/jgoppert/pymola

Jinja template to render AST into python simulation:
https://github.com/jgoppert/pymola/blob … ympy.jinja


ANTLR 4 Modelica Grammar:
https://github.com/jgoppert/pymola/blob … odelica.g4

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Python Modelica Compiler/ Anyone want to help?

I just finished a hello world ipython notebook example using pymola:

Features:
1. Analytical jacobians with sympy
2. Scipy python ode solver

https://github.com/jgoppert/pymola/blob … mple.ipynb

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic
You are here: