################################ Describing equations in Modelica ################################ In this session, you'll learn how to use the OpenModelica environment to simulation differential equations written in a Modelica ``model``. First, if you want OpenModelica installed on your own computer, see :ref:`OM-install`. Main ressources needed: * Michael Tiller's online book *"Modelica by Example"* [Tiller-2014]_ * first chapter `Basic Equations`_ of the first part "Describing Behavior" * OpenModelica User’s Guide [OM-guide]_ * `OMEdit introduction`_ section ODE: Vehicle suspension ======================= Your boss want you to quickly check that the spec for the damping factor α is appropriate (i.e. that the chassis doesn't oscillate too much). Model for the suspension (agregated for all wheels) is given on :numref:`suspension`. Objective: Write and simulate a Modelica model to check the behavior of the chassis. To start with, let's consider that the wheel stays always in contact with the road. .. figure:: ./diagrams/suspension.png :width: 25 em :name: suspension diagram of a 1D model for a vehicle suspension parameters: ====== ================= ================ mass m spring constant k damping factor α ====== ================= ================ 10³ kg 30.10³ N/m 2.10³ N/(m/s) ====== ================= ================ .. admonition:: Useful tip for OpenModelica :class: attention Observe that the value of model parameters can be changed at simulation time, without recompiling the model. This saves the recompilation time. In the Plotting interface use the "Re-simulate" button. What's next =========== Possible next activities: * Uncovering the mysteries of OpenModelica: :ref:`OM-simflow` * More advanced equations: :ref:`discrete-eq` * Start using physical components: :ref:`use-comp` .. _Basic Equations: https://mbe.modelica.university/behavior/equations/ .. _OMEdit introduction: https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/omedit.html