Commit 20fed3bd authored by Ibrahim Ahmed's avatar Ibrahim Ahmed
Browse files

modelica kernel working

parents
%% Cell type:markdown id: tags:
# Modelica x Jupyter
These cells contain modelica code that can be run via Jupyter.
To install:
* Install OpenModelica
* Install Anaconda
* Create environment in `env.yml`
```
conda env create -f env.yml
```
%% Cell type:code id: tags:
``` OpenModelica
class Pendulum "Planar Pendulum"
constant Real PI=3.141592653589793;
parameter Real m=1, g=9.81, L=0.5;
Real F;
output Real x(start=0.5),y(start=0);
output Real vx,vy;
equation
m*der(vx)=-(x/L)*F;
m*der(vy)=-(y/L)*F-m*g;
der(x)=vx;
der(y)=vy;
x^2+y^2=L^2;
end Pendulum;
```
%% Cell type:code id: tags:
``` OpenModelica
simulate(Pendulum)
```
%% Cell type:code id: tags:
``` OpenModelica
plot(der(x),der(y),m)
```
# Modelica x Jupyter
These cells contain modelica code that can be run via Jupyter.
To install:
* Install OpenModelica
* Install Anaconda
* Create environment in `env.yml`
```
conda env create -f env.yml
```
\ No newline at end of file
name: modelica
channels:
- conda-forge
- defaults
dependencies:
- python=3.7
- scipy
- matplotlib
- pyfmi
- jupyter
- pip
- https://github.com/OpenModelica/OMPython/archive/v3.0.3.zip
- https://github.com/OpenModelica/jupyter-openmodelica/archive/5b90c36f65913e02b5c26757f5babae1f7c5c245.zip
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment