Giter Site home page Giter Site logo

ximalas / openmodelica Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openmodelica/openmodelica

0.0 0.0 0.0 249.46 MB

OpenModelica is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage.

Home Page: https://openmodelica.org

License: Other

Shell 0.05% JavaScript 0.01% Ruby 0.01% C++ 21.22% Python 0.20% Perl 0.03% C 33.00% Emacs Lisp 0.01% Java 0.05% Groovy 0.02% D 0.05% MATLAB 0.01% Julia 0.05% XSLT 0.04% TeX 0.01% ANTLR 0.01% GAP 0.25% Mathematica 0.01% Makefile 0.37% Modelica 44.65%

openmodelica's Introduction

OpenModelica License: OSMC-PL

OpenModelica is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage.

OpenModelica User's Guide

The User's Guide is automatically generated from the documentation repository.

OpenModelica environment

The OpenModelica Compiler is the core of the OpenModelica project. OMEdit is the graphical user interface on top of the compiler. OMSimulator is a capable FMI and SSP-based Co-Simulation environment, available as a standalone version or integrated in OMEdit. In addition there are interactive environments OMNotebook, OMPlot and OMShell interaction with the OMCompiler as well as various other tools: OMOptim, OMParser, OMSens, OMSense_Qt.

Working with the repository

OpenModelica.git is a superproject. Clone the project using one of:

# Faster pulling by using openmodelica.org read-only mirror (low latency in Europe; very important when updating all submodules)
# Replace the openmodelica.org pull URL with https://github.com/OpenModelica/OpenModelica.git if you want to pull directly from github
# The default choice is to push to your fork on github.com (SSH). Replace MY_FORK with OpenModelica to push directly to the OpenModelica repositories (if you have access)
MY_FORK=<MyGitHubUserName>
git clone https://openmodelica.org/git-readonly/OpenModelica.git --recursive
cd OpenModelica
git remote set-url --push origin [email protected]:$MY_FORK/OpenModelica.git
git submodule foreach --recursive 'git remote set-url --push origin `git config --get remote.origin.url | sed s,^.*/,[email protected]:'$MY_FORK'/,`'

If you are a developer and want to update your local git repository to the latest developments or latest heads, use:

# After cloning
cd OpenModelica
git checkout master
git pull
# To checkout the latest master on each submodule run
# >ou will need to merge each submodule, but your changes will remain
git submodule foreach --recursive "git checkout master && git pull"

# Running master on all submodules might lead to build errors
# so use this to make sure you force all submodules to the commits
# from the OpenModelica glue project which are properly tested
git submodule update --force --init --recursive

In order to push to the repository, you will push to your own fork of OpenModelica.git, etc. You will need to create a fork of each repository that you want to push to (by clicking the Fork button in the GitHub web interface).

If you do not checkout the repositories for some GUI clients (such as OMOptim.git), these directories will be ignored by autoconf and skipped during compilation.

To checkout a specific version of OpenModelica, say tag v1.16.2 do:

git clone https://github.com/OpenModelica/OpenModelica.git --recursive
cd OpenModelica
git checkout v1.16.2
git submodule update --force --init --recursive

If you have issues building you can try to clean and reset the repository using:

git clean -fdx
git submodule foreach --recursive git clean -fdx
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive

To check your working copy status and the hashes of the submodules, use:

git status
git submodule status --recursive

To checkout a minimal version of OpenModelica

> git clone https://openmodelica.org/git-readonly/OpenModelica.git OpenModelica-minimal
> cd OpenModelica-minimal
> git submodule update --init --recursive libraries

Build OpenModelica

How to run

Here is a short example session. This example uses OMShell-terminal, but OMShell, mos-scripts, or OMNotebook work the same way.

$ cd trunk/build/bin
$ ./OMShell-terminal
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org

To get help on using OMShell and OpenModelica, type "help()" and press enter
Started server using:omc -d=interactive > /tmp/omshell.log 2>&1 &
>>> loadModel(Modelica)
true
>>> getErrorString()
""
>> instantiateModel(Modelica.Electrical.Analog.Basic.Resistor)
"class Modelica.Electrical.Analog.Basic.Resistor \"Ideal linear electrical resistor\"
  Real v(quantity = \"ElectricPotential\", unit = \"V\") \"Voltage drop between the two pins (= p.v - n.v)\";
  Real i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing from pin p to pin n\";
  Real p.v(quantity = \"ElectricPotential\", unit = \"V\") \"Potential at the pin\";
  Real p.i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing into the pin\";
  Real n.v(quantity = \"ElectricPotential\", unit = \"V\") \"Potential at the pin\";
  Real n.i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing into the pin\";
  parameter Boolean useHeatPort = false \"=true, if HeatPort is enabled\";
  parameter Real T(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) = T_ref \"Fixed device temperature if useHeatPort = false\";
  Real LossPower(quantity = \"Power\", unit = \"W\") \"Loss power leaving component via HeatPort\";
  Real T_heatPort(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) \"Temperature of HeatPort\";
  parameter Real R(quantity = \"Resistance\", unit = \"Ohm\", start = 1.0) \"Resistance at temperature T_ref\";
  parameter Real T_ref(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) = 300.15 \"Reference temperature\";
  parameter Real alpha(quantity = \"LinearTemperatureCoefficient\", unit = \"1/K\") = 0.0 \"Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))\";
  Real R_actual(quantity = \"Resistance\", unit = \"Ohm\") \"Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))\";
equation
  assert(1.0 + alpha * (T_heatPort - T_ref) >= 1e-15, \"Temperature outside scope of model!\");
  R_actual = R * (1.0 + alpha * (T_heatPort - T_ref));
  v = R_actual * i;
  LossPower = v * i;
  v = p.v - n.v;
  0.0 = p.i + n.i;
  i = p.i;
  T_heatPort = T;
  p.i = 0.0;
  n.i = 0.0;
end Modelica.Electrical.Analog.Basic.Resistor;
"
>> a:=1:5;
>> b:=3:8
{3,4,5,6,7,8}
>>> a*b

>>> getErrorString()
"[<interactive>:1:1-1:0:writable] Error: Incompatible argument types to operation scalar product in component <NO COMPONENT>, left type: Integer[5], right type: Integer[6]
[<interactive>:1:1-1:0:writable] Error: Incompatible argument types to operation scalar product in component <NO COMPONENT>, left type: Real[5], right type: Real[6]
[<interactive>:1:1-1:0:writable] Error: Cannot resolve type of expression a * b. The operands have types Integer[5], Integer[6] in component <NO COMPONENT>.
"
>> b:=3:7;
>> a*b
85
>>> listVariables()
{b, a}
>>

How to contribute to the OpenModelica Compiler

The long-term development of OpenModelica is supported by a non-profit organization - the Open Source Modelica Consortium (OSMC).

See CONTRIBUTING.md on how to contribute to the development. If you encounter any bugs, feel free to open a ticket about it. For general questions regarding OpenModelica there is a discussions section available.

License

See OSMC-License.txt.

How to cite

We recommend citing the article The OpenModelica Integrated Environment for Modeling, Simulation, and Model-Based Development regarding OpenModelica.

BibTeX:

@article{MIC-2020-4-1,
  title={{The OpenModelica Integrated Environment for Modeling, Simulation, and Model-Based   Development}},
  author={Fritzson, Peter and Pop, Adrian and Abdelhak, Karim and Ashgar, Adeel and Bachmann,   Bernhard and Braun, Willi and Bouskela, Daniel and Braun, Robert and Buffoni, Lena and Casella,   Francesco and Castro, Rodrigo and Franke, Rüdiger and Fritzson, Dag and Gebremedhin, Mahder and   Heuermann, Andreas and Lie, Bernt and Mengist, Alachew and Mikelsons, Lars and Moudgalya, Kannan   and Ochel, Lennart and Palanisamy, Arunkumar and Ruge, Vitalij and Schamai, Wladimir and Sjölund,   Martin and Thiele, Bernhard and Tinnerholm, John and Östlund, Per},
  journal={Modeling, Identification and Control},
  volume={41},
  number={4},
  pages={241--295},
  year={2020},
  doi={10.4173/mic.2020.4.1},
  publisher={Norwegian Society of Automatic Control}
}

Last updated: 2023-02-13

openmodelica's People

Contributors

sjoelund avatar adeas31 avatar adrpo avatar perost avatar openmodelica-hudson avatar lochel avatar rfranke avatar niklwors avatar mahge avatar vwaurich avatar hkiel avatar ptaeuber avatar ruedkamp avatar kabdelhak avatar levsa avatar arun3688 avatar anheuermann avatar bernhard-thiele avatar alash325 avatar phannebohm avatar robbr48 avatar smiz avatar vruge avatar fbergero avatar mflehmig avatar pavolpr avatar casella avatar jkrt avatar dietmarw avatar atrosinenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.