3. 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 Installing OpenModelica.
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
3.1. 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 Fig. 3.1.
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.
parameters:
mass m |
spring constant k |
damping factor α |
---|---|---|
10³ kg |
30.10³ N/m |
2.10³ N/(m/s) |
Useful tip for OpenModelica
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.
3.2. What’s next
Possible next activities:
Uncovering the mysteries of OpenModelica: OpenModelica simulation process
More advanced equations: Describing discrete behaviors
Start using physical components: Physical components in Modelica