{"id":14977170,"url":"https://github.com/mbonvini/modelicainaction","last_synced_at":"2025-09-01T13:40:14.259Z","repository":{"id":68007027,"uuid":"73675865","full_name":"mbonvini/ModelicaInAction","owner":"mbonvini","description":"Modelica In Action","archived":false,"fork":false,"pushed_at":"2018-11-29T05:46:06.000Z","size":754,"stargazers_count":44,"open_issues_count":2,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-21T09:55:47.586Z","etag":null,"topics":["docker-container","ipython-notebook","modelica","modelica-models"],"latest_commit_sha":null,"homepage":"http://marcobonvini.com/modelica/2017/01/02/modelica-in-action.html","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbonvini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-14T06:50:56.000Z","updated_at":"2025-04-30T20:16:53.000Z","dependencies_parsed_at":"2023-02-28T10:32:28.393Z","dependency_job_id":null,"html_url":"https://github.com/mbonvini/ModelicaInAction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbonvini/ModelicaInAction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbonvini%2FModelicaInAction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbonvini%2FModelicaInAction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbonvini%2FModelicaInAction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbonvini%2FModelicaInAction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbonvini","download_url":"https://codeload.github.com/mbonvini/ModelicaInAction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbonvini%2FModelicaInAction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273135640,"owners_count":25051998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-container","ipython-notebook","modelica","modelica-models"],"created_at":"2024-09-24T13:55:14.208Z","updated_at":"2025-09-01T13:40:14.209Z","avatar_url":"https://github.com/mbonvini.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modelica In Action\n\nThis repository contains examples that demonstrate how to\ncreate, compile and simulate Modelica models using [JModelica.org](http://www.jmodelica.org).\n\n## Notes\n\nAll the `make` commands mentioned in this guide reference the\n[Makefile](https://github.com/mbonvini/ModelicaInAction/blob/master/Makefile)\nlocated in the root directory of this repository.\n\n## Installation\n\nIn order to simplify your life the repository contains all the code\nnecessary to create a [Docker](https://www.docker.com) container that runs JModelica.org.\nIn case you wonder what's a Docker container\n\n\u003e Docker containers wrap a piece of software in a complete filesystem that contains\n\u003e everything needed to run: code, runtime,   system tools, system libraries – anything\n\u003e that can be installed on a server. This guarantees that the software will always\n\u003e run the same, regardless of its environment (see https://www.docker.com/what-docker\n\u003e for more info).\n\nIn this case I created a \"recipe\", also known as [Docker file](https://github.com/mbonvini/ModelicaInAction/blob/master/docker/Dockerfile),\nthat describes how to build a container with installed everything that's needed\nto work with JModelica.org.\n\nOnce created and started, the container and your computer will interact as shown\nin the following image.\n\n![alt tag](https://github.com/mbonvini/ModelicaInAction/blob/master/images/container_scheme.png)\n\nUpon start, some folders included in this repository will be shared with the container,\nin the meantime the container runs an IPython server. The container exposes the port\nused by the IPython server to your local machine. In this way you can connect to the\nIPython server in the container with a browser. Once you access the IPython\nserver you can start working with JModelica.org.\n\nThe Docker container is based on a so called image (something similar to a snapshot\nof a virtual machine). To create the image you have two options\n\n * manually build the image with the command\n `make build-image`\n\n * download the image with the command\n `make download-image`\n\nThe second option is preferable because it doesn't require you to wait while Docker\ncompiles from source JModelica.org and all its dependencies.\n\nAs of November 28 2018, there are two version of the image: 1.0 and 2.0, the latter has\ninstalled a more recent version of JModelica as well as Jupyter notebook instead of IPython.\nTo download the version you're interested in, add the `VERSION=x.0` to the make rules\nyou invoke, for example to download the image version 2.0 run\n\n```\nmake download-image VERSION=2.0\n```\n\nYou can verify that the container image has been built (or downloaded) using the command\n`docker images`. In my case when I run the command I see\n\n```\n$ docker images\nREPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE\nmodelicainaction/jmodelica   2.0                 7f7f224e3da2        23 hours ago        3.1GB\nubuntu                       18.04               93fd78260bd1        9 days ago          86.2MB\nubuntu                       16.04               f753707788c5        23 months ago       127.2 MB\nmodelicainaction/jmodelica   1.0                 adcc4c39b0d6        23 months ago       2.7GB\n```\n\n## Starting the container\n\nOnce the container image has been created we can start it.\nTo start the container run the command `make start`. Again, you can choose which version\nto run by specifying the version like `make start VERSION=2.0`. This command starts\nthe container with installed JModelica.org and an IPython notebook server\nlistening on port 8888. The same port used by the IPython/Jupyter server is exposed\nby the container and redirected to the localhost.\nThis means that if you open a browser and go to http://127.0.0.1:8888 you should see something\nlike this\n\n![alt tag](https://github.com/mbonvini/ModelicaInAction/blob/master/images/ipython_home.png)\n\nBy default the container is configured to share the following folders\n\n * `modelica` - a folder containing the source code of the Modelica models used in the examples\n\n * `ipynotebooks` - a folder containing the ipython notebooks with examples\n\nEvery Modelica model located in the folder `modelica` will be immediately visible\nto JModelica.org. The same is true for the folder `ipynotebooks`, every notebook it contains\nwill be automatically visible when you open the browser and go to http://127.0.0.1:8888.\n\nYou can verify that the container is running with the command `docker ps -a`\n\n```\n$ docker ps -a\nCONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                      NAMES\n639bd33a27fb        modelicainaction/jmodelica:1.0   \"sh -c 'ipython noteb\"   4 hours ago         Up 4 hours          127.0.0.1:8888-\u003e8888/tcp   prickly_mayer\n```\n\nand you can stop and remove the container (not the container image) with the command\n`docker stop 639bd33a27fb \u0026\u0026 docker rm 639bd33a27fb` where `639bd33a27fb` is the\ncontainer id.\n\n## NOTES\n\n- Version 2.0 uses Jupyter instead of IPython notebooks, and it requires to prompt a password when you connect\nto the server from your browser. The password is `modelicainaction`.\n- I've seen some warnings and minor problems when running the examples in the most recent version 2.0.\nUnfortunately JModelica.org documentation doesn't seem to be up to date and I can't do much about it.\nI was still able to run simulations, but as usual use it at your own risk!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbonvini%2Fmodelicainaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbonvini%2Fmodelicainaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbonvini%2Fmodelicainaction/lists"}