WOLFRAM SYSTEM MODELER

DoublePendulumInitTip

Demonstrate how to initialize a double pendulum so that its tip starts at a predefined position

Diagram

Wolfram Language

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

Information

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

This example demonstrates at hand of a double pendulum, how non-standard initialization can be defined: The absolute position of the pendulum tip, and its absolute speed shall be initially defined. This can be performed with the Joints.FreeMotionScalarInit joint that allows to initialize individual elements of its relative vectors. In this case, the x-, and y-coordinates of the relative position vector (visualized by the yellow arrow in the figure below) and of its derivative shall have a defined value at initial time. The configuration of the double pendulum at the initial time is shown below, where the tip position is required to have the coordinates x=0.7, y=0.3.

Setting only the tip's start position results in an ambiguous initialization since two valid solutions for revolute1.phi and revolute2.phi exist. Moreover, the calculated angles revolute1.phi and revolute2.phi can be a multiple of expected solution phi1 and phi2,

  • revolute1.phi(k1) = phi1 + 2 π k1,
  • revolute2.phi(k2) = phi2 + 2 π k2.

To clearly indicate the preferred solution, guess initial angles can be additionally given. In this example, it is simply done by revolute2.phi.start = Modelica.Constants.pi/2.

Components (7)

world

Type: World

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

revolute1

Type: Revolute

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

damper

Type: Damper

Description: Linear 1D rotational damper

boxBody1

Type: BodyBox

Description: Rigid body with box shape. Mass and animation properties are computed from box data and density (12 potential states)

revolute2

Type: Revolute

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

boxBody2

Type: BodyBox

Description: Rigid body with box shape. Mass and animation properties are computed from box data and density (12 potential states)

freeMotionScalarInit

Type: FreeMotionScalarInit

Description: Free motion joint with scalar initialization and state selection (6 degrees-of-freedom, 12 potential states)