Modelica kernel?

206 views
Skip to first unread message

Jorge Cardona

unread,
Mar 8, 2015, 4:06:14 PM3/8/15
to jup...@googlegroups.com
Hi, my name is Jorge, 

I have used ipython for long time, and would like to check first if there is any plan in adding Modelica in Jupyter, I don't fully understand the scope of this project compared with ipython, so, should be ok to follow instructions in http://ipython.org/ipython-doc/dev/development/kernels.html to build something than can be compatible with Jupyter?

The major free software compiler for Modelica is openmodelica, which is basically C++ and they have a python integration, so, it can be easy to control everything from python, being Jupyter an "agnostic" project is "ok" to use python for the kernel? somehow should be easy to use openmodelica from c++ but I prefer python, and I just want to do something that transcend my spring break "free" time.

So, can I just follow instructions in http://ipython.org/ipython-doc/dev/development/kernels.html without worring too much? Is anyone else interested in this project? 

PD: I tried few times before to do a pure python modelica compiler and couldn't make it to get anything real done. I don't like too much the openmodelica process, they create .c code with the solvers and execute them to get the solution, so, doing  interactive version of it is kind of a pain, hopefully someone is interested in build something with me for this.  There are not that much modelica free-software compiler, Jmodelica and openmodelica, and none web based, I don't know why but I feel this would be a great tool to have online, like a Jupyter based modelica notebook with shareable dynamical system simulations and be able to do some optimization process.

Bye.

MinRK

unread,
Mar 8, 2015, 4:34:00 PM3/8/15
to jup...@googlegroups.com

On Sun, Mar 8, 2015 at 1:06 PM, Jorge Cardona <jorgee...@gmail.com> wrote:

Hi, my name is Jorge, 

I have used ipython for long time, and would like to check first if there is any plan in adding Modelica in Jupyter, I don't fully understand the scope of this project compared with ipython, so, should be ok to follow instructions in http://ipython.org/ipython-doc/dev/development/kernels.html to build something than can be compatible with Jupyter?

Yes, that and the message spec are the key documents for writing kernels, and feel free to ask any further questions about implementing kernels here.

You may want to look at examples of kernels for other languages written in Python. If there is a Python API for Modelica, the new R2 Kernel, which uses rpy2 to run R code from Python, may be of specific interest.

-MinRK


The major free software compiler for Modelica is openmodelica, which is basically C++ and they have a python integration, so, it can be easy to control everything from python, being Jupyter an "agnostic" project is "ok" to use python for the kernel? somehow should be easy to use openmodelica from c++ but I prefer python, and I just want to do something that transcend my spring break "free" time.

So, can I just follow instructions in http://ipython.org/ipython-doc/dev/development/kernels.html without worring too much? Is anyone else interested in this project? 


PD: I tried few times before to do a pure python modelica compiler and couldn't make it to get anything real done. I don't like too much the openmodelica process, they create .c code with the solvers and execute them to get the solution, so, doing  interactive version of it is kind of a pain, hopefully someone is interested in build something with me for this.  There are not that much modelica free-software compiler, Jmodelica and openmodelica, and none web based, I don't know why but I feel this would be a great tool to have online, like a Jupyter based modelica notebook with shareable dynamical system simulations and be able to do some optimization process.

Bye.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/fc62397c-086e-4004-889c-b8708884bef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicholas Bollweg

unread,
Mar 9, 2015, 10:45:48 AM3/9/15
to jup...@googlegroups.com
Yeah, this is a great idea.

I've done a touch of OMPython stuff in the past... it already has a kernel-level construct that you could reuse without re-implementing the message spec. I wouldn't try to get zmw working in there! The r2_kernel looks like a great starting point!
  • __init__
    • ensure that you have the connection
    • OMPython.run()
  • do_execute(self, code)
    • output = OMPython.execute(self, code)
    • error = OMPython.execute(''getErrorString()")
    • then think about how the user gets data back out... you'll basically have to check against the API and assume that anything that isn't an OM API call is a request for a value.
    • then think about getting generated pictures out, and wrapping them appropriately
  • do_complete
    • this will be... harder.

Matthis Thorade

unread,
Dec 7, 2016, 9:10:07 AM12/7/16
to Project Jupyter
I know this is an old thread, but apparently the OpenModelica guys have started to work on this, too:
https://trac.openmodelica.org/OpenModelica/ticket/3705
https://github.com/OpenModelica/jupyter-openmodelica
Reply all
Reply to author
Forward
0 new messages