WOLFRAM SYSTEM MODELER

FirstExample

A first example

Wolfram Language

In[1]:=
SystemModel["PlanarMechanics.UsersGuide.Tutorial.FirstExample"]
Out[1]:=

Information

Here seveal steps will be listed to demonstrate how to build up, simulate and animate a simple pendulum, which consists of a fixed point, a planar world model, a revolute joint, a fixed translation and a body.

Building up Modelica composition diagram

The diagram is showed as following.

Modelica diagram

where component Fixed, Body, FixedTranslation can be found in Parts package, component Revolute in Joints, PlanarWorld directly under PlanarMechanics.

Every model having components from PlanarMechanics library must include an instance of component PlanarWorld on the highest level. The reason is that PlanarWorld component defines the default gravity for the model, includes default settings of animation parameters of almost every components.

Setting up initial values and parameters.

In this step, we only need to double click the relevant component and write initial values and parameters in the blanks. Default gravity force in is {0, -9.81}. In this example, phi.start in revolute component is set to be 50°, m and I in body are respectively 1 kg and 0.1 kgm2; all other settings remain default.

Translating and simulating the simple pendulum model.

With the above settings, animation is as following:

First example animation

Revisions

DLR logo Developed 2010 at the DLR Institute of System Dynamics and Control