Placeholder for the SlidingCar example model, available on the Wolfram SystemModeler website.

Wolfram Language




Library Dependency

This is a placeholder model. It requires the PlanarMechanics library.

  • The free PlanarMechanics library was created especially for modeling multibody systems with two-dimensional mechanical components. Compared to the MultiBody library, currently available in the Modelica Standard Library, it is simpler to use and it is more optimized to planar modeling. Planar models of mechanical systems are useful in many different applications, for example, in contact problems that are more easily modeled in 2D than in 3D.

The following documentation is taken from the main example of the downloadable model. Once you have downloaded all the model dependencies, the model can be downloaded here.

Sliding Car



This model shows the concept of configurable modeling. The wheels are defined as replaceable models and can easily be changed in the car model.


The Model

This model is based on the TwoTrackWithDifferentialGear example from the Planar Mechanics Library. The library can be downloaded here. Four wheels interact with the ground through a friction model. Depending on the type of wheel and ground, different friction coefficients are used. To switch between different setups, use the drop-down menu in the General tab.



To simulate the model, perform this step:

  • Click the Simulate button in the top toolbar .

Plot the Results

The simulation is set to run for 15 seconds. A constant torque is applied to the back wheels during the simulation. After 7 seconds, the front wheel will turn to the right over 3 seconds and then keep that front wheel angle for the rest of the simulation. See the position of the wheels of the car (as plotted below) or the forces on the wheels in the stored plots.

Automatic 3D Animation

PlanarMechanics and Multibody systems have visualizers to show what a real-world system would look like.

To show a 3D animation of the model, follow the steps below:

It is also possible to add traces to the wheels to see the path they have taken over time in the animation. To do this, right-click the background in the animation and choose Trace Path, and then choose the components to trace. One option is to trace the different cylinders 2–5 (powerTrain.fixedTranslation2.cylinder) as shown in the following image:

Changing the Wheels

By using the replaceable concept, we can redeclare the Wheel model and effectively change all four wheels of the car model with a drop-down menu. The code that enables this can be seen in the text view of the model. A snippet of this can be seen in the following image:

When redeclaring the Wheel model in the code, the type of the different wheels will be redeclared.