WOLFRAM SYSTEM MODELER

SpringMassSystem

Mass attached with a spring to the world frame

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

This example shows the two different ways how force laws can be utilized:

  • In the left system a body is attached via a prismatic joint to the world frame. The prismatic joint has two 1-dimensional translational flanges (called "support" and "axis") that allows to connect elements from the Modelica.Mechanics.Translational library between the support and the axis connector. The effect is that the force generated by the 1-dimensional elements acts as driving force in the axis of the prismatic joint. In the example a simple spring is used.
    The advantage of this approach is that the many elements from the Translational library can be easily used here and that this implementation is usually more efficient as when using 3-dimensional springs.
  • In the right system the same model is defined. The difference is that a 3-dimensional spring from the Modelica.Mechanics.MultiBody.Forces library is used. This has the advantage to get a nice animation of the force component.
model Examples.Elementary.SpringMassSystem

Parameters (1)

animation

Value: true

Type: Boolean

Description: = true, if animation shall be enabled

Components (9)

world

Type: World

Description: World coordinate system + gravity field + default animation definition

p1

Type: Prismatic

Description: Prismatic joint (1 translational degree-of-freedom, 2 potential states, optional axis flange)

spring1

Type: Spring

Description: Linear 1D translational spring

body1

Type: Body

Description: Rigid body with mass, inertia tensor and one frame connector (12 potential states)

bar1

Type: FixedTranslation

Description: Fixed translation of frame_b with respect to frame_a

bar2

Type: FixedTranslation

Description: Fixed translation of frame_b with respect to frame_a

body2

Type: Body

Description: Rigid body with mass, inertia tensor and one frame connector (12 potential states)

p2

Type: Prismatic

Description: Prismatic joint (1 translational degree-of-freedom, 2 potential states, optional axis flange)

spring2

Type: Spring

Description: Linear translational spring with optional mass