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:

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.

_images/suspension.png

Fig. 3.1 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)

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: