Modelica.Mechanics.MultiBody.Examples.Elementary

Elementary examples to demonstrate various features of the MultiBody library

Information


This package contains elementary example models to demonstrate the usage of the MultiBody library

Content

ModelDescription
DoublePendulum Simple double pendulum with two revolute joints and two bodies.
ForceAndTorque Demonstrates usage of Forces.ForceAndTorque element.
FreeBody Free flying body attached by two springs to environment.
InitSpringConstant Determine spring constant such that system is in steady state at given position.
LineForceWithTwoMasses Demonstrates a line force with two point masses using a Joints.Assemblies.JointUPS and alternatively a Forces.LineForceWithTwoMasses component.
Pendulum Simple pendulum with one revolute joint and one body.
PendulumWithSpringDamper Simple spring/damper/mass system
PointGravity Two bodies in a point gravity field
PointGravityWithPointMasses Two point masses in a point gravity field (rotation of bodies is neglected)
PointGravityWithPointMasses2 Rigidly connected point masses in a point gravity field
RollingWheel Single wheel rolling on ground starting from an initial speed
RollingWheelSetDriving Rolling wheel set that is driven by torques driving the wheels
RollingWheelSetPulling Rolling wheel set that is pulled by a force
SpringDamperSystem Spring/damper system with a prismatic joint and attached on free flying body
SpringMassSystem Mass attached via a prismatic joint and a spring to the world frame
SpringWithMass Point mass hanging on a spring
ThreeSprings 3-dimensional springs in series and parallel connection

Extends from Modelica.Icons.Library (Icon for library).

Package Content

NameDescription
Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum DoublePendulum Simple double pendulum with two revolute joints and two bodies
Modelica.Mechanics.MultiBody.Examples.Elementary.ForceAndTorque ForceAndTorque Demonstrate usage of ForceAndTorque element
Modelica.Mechanics.MultiBody.Examples.Elementary.FreeBody FreeBody Free flying body attached by two springs to environment
Modelica.Mechanics.MultiBody.Examples.Elementary.InitSpringConstant InitSpringConstant Determine spring constant such that system is in steady state at given position
Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses LineForceWithTwoMasses Demonstrate line force with two point masses using a JointUPS and alternatively a LineForceWithTwoMasses component
Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum Pendulum Simple pendulum with one revolute joint and one body
Modelica.Mechanics.MultiBody.Examples.Elementary.PendulumWithSpringDamper PendulumWithSpringDamper Simple spring/damper/mass system
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity PointGravity Two point masses in a point gravity field
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses PointGravityWithPointMasses Two point masses in a point gravity field (rotation of bodies is neglected)
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2 PointGravityWithPointMasses2 Rigidly connected point masses in a point gravity field
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem SpringDamperSystem Simple spring/damper/mass system
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem SpringMassSystem Mass attached with a spring to the world frame
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringWithMass SpringWithMass Point mass hanging on a spring
Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings ThreeSprings 3-dim. springs in series and parallel connection
Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel RollingWheel Single wheel rolling on ground starting from an initial speed
Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetDriving RollingWheelSetDriving Rolling wheel set that is driven by torques driving the wheels
Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetPulling RollingWheelSetPulling Rolling wheel set that is pulled by a force


Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum

Simple double pendulum with two revolute joints and two bodies

Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum

Information


This example demonstrates that by using joint and body elements animation is automatically available. Also the revolute joints are animated. Note, that animation of every component can be switched of by setting the first parameter animation to false or by setting enableAnimation in the world object to false to switch off animation of all components.

model Examples.Elementary.DoublePendulum

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model DoublePendulum 
  "Simple double pendulum with two revolute joints and two bodies"

  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(useAxisFlange=true,phi(fixed=true),
      w(fixed=true));
  Modelica.Mechanics.Rotational.Components.Damper damper(
                                              d=0.1);
  Modelica.Mechanics.MultiBody.Parts.BodyBox boxBody1(r={0.5,0,0}, width=0.06);
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(phi(fixed=true), w(
        fixed=true));
  Modelica.Mechanics.MultiBody.Parts.BodyBox boxBody2(r={0.5,0,0}, width=0.06);
equation 

  connect(damper.flange_b, revolute1.axis);
  connect(revolute1.support, damper.flange_a);
  connect(revolute1.frame_b, boxBody1.frame_a);
  connect(revolute2.frame_b, boxBody2.frame_a);
  connect(boxBody1.frame_b, revolute2.frame_a);
  connect(world.frame_b, revolute1.frame_a);
end DoublePendulum;

Modelica.Mechanics.MultiBody.Examples.Elementary.ForceAndTorque Modelica.Mechanics.MultiBody.Examples.Elementary.ForceAndTorque

Demonstrate usage of ForceAndTorque element

Modelica.Mechanics.MultiBody.Examples.Elementary.ForceAndTorque

Information


In this example the usage of the general force element
"ForceAndTorque"
is shown. A "ForceAndTorque" element is connected
between a body and a fixed point in the world system. The force and torque
is defined by the "Constant" block. The two vectors are resolved in the
coordinate system defined by the "fixedRotation" component that is
fixed in the world system:

The animation view at time = 0 is shown in the figure below. The yellow line is directed from frame_a to frame_b of the forceAndTorque component. The green arrow characterizes the force acting at the body whereas the green double arrow characterizes the torque acting at the body. The lengths of the two vectors are proportional to the lengths of the force and torque vectors (constant scaling factors are defined as parameters in the forceAndTorque component):

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model ForceAndTorque "Demonstrate usage of ForceAndTorque element"
  extends Modelica.Icons.Example;
  inner World world(animateGravity=false);
  Parts.BodyCylinder body(r={1,0,0});
  Parts.Fixed fixed1(r={0,-0.5,0}, width=0.03);
  Parts.FixedRotation fixedRotation(n={0,0,1}, angle=30);
  Forces.ForceAndTorque forceAndTorque(Nm_to_m=120, N_to_m=1200,
    resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve);
  Joints.Revolute revolute2(n={0,1,0},
    phi(fixed=true),
    w(fixed=true));
  Modelica.Blocks.Sources.Constant torque[3](k={-100,100,0});
  Joints.Revolute revolute1(phi(fixed=true), w(fixed=true));
  Parts.Fixed fixed2(width=0.03, r={1.5,0.25,0});
  Modelica.Blocks.Sources.Constant force[3](k={0,1000,0});
equation 
  connect(revolute2.frame_b, body.frame_a);
  connect(forceAndTorque.frame_b, body.frame_b);
  connect(fixed1.frame_b, revolute1.frame_a);
  connect(revolute1.frame_b, revolute2.frame_a);
  connect(fixed2.frame_b, forceAndTorque.frame_a);
  connect(fixedRotation.frame_a, fixed1.frame_b);
  connect(forceAndTorque.frame_resolve, fixedRotation.frame_b);
  connect(force.y, forceAndTorque.force);
  connect(torque.y, forceAndTorque.torque);
end ForceAndTorque;

Modelica.Mechanics.MultiBody.Examples.Elementary.FreeBody Modelica.Mechanics.MultiBody.Examples.Elementary.FreeBody

Free flying body attached by two springs to environment

Modelica.Mechanics.MultiBody.Examples.Elementary.FreeBody

Information


This example demonstrates:

model Examples.Elementary.FreeBody

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Modelica definition

model FreeBody 
  "Free flying body attached by two springs to environment"
  extends Modelica.Icons.Example;
  parameter Boolean animation=true "= true, if animation shall be enabled";
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar2(r={0.8,0,0}, animation=false);
  Modelica.Mechanics.MultiBody.Forces.Spring spring1(
    width=0.1,
    coilWidth=0.005,
    numberOfWindings=5,
    c=20,
    s_unstretched=0);
  Modelica.Mechanics.MultiBody.Parts.BodyShape body(
    m=1,
    I_11=1,
    I_22=1,
    I_33=1,
    r={0.4,0,0},
    r_CM={0.2,0,0},
    width=0.05,
    r_0(start={0.2,-0.5,0.1}, fixed=true),
    v_0(fixed=true),
    angles_fixed=true,
    w_0_fixed=true,
    angles_start={0.174532925199433,0.174532925199433,0.174532925199433});
  Modelica.Mechanics.MultiBody.Forces.Spring spring2(
    c=20,
    s_unstretched=0,
    width=0.1,
    coilWidth=0.005,
    numberOfWindings=5);
equation 
  connect(bar2.frame_a, world.frame_b);
  connect(spring1.frame_b, body.frame_a);
  connect(bar2.frame_b, spring2.frame_a);
  connect(spring1.frame_a, world.frame_b);
  connect(body.frame_b, spring2.frame_b);
end FreeBody;

Modelica.Mechanics.MultiBody.Examples.Elementary.InitSpringConstant Modelica.Mechanics.MultiBody.Examples.Elementary.InitSpringConstant

Determine spring constant such that system is in steady state at given position

Modelica.Mechanics.MultiBody.Examples.Elementary.InitSpringConstant

Information


This example demonstrates a non-standard type of initialization by calculating a spring constant such that a simple pendulum is at a defined position in steady state.

The goal is that the pendulum should be in steady state when the rotation angle of the pendulum is zero. The spring constant of the spring shall be calculated during initialization such that this goal is reached.

The pendulum has one degree of freedom, i.e., two states. Therefore, two additional equations have to be provided for initialization. However, parameter "c" of the spring component is defined with attribute "fixed = false", i.e., the value of this parameter is computed during initialization. Therefore, there is one additional equation required during initialization. The 3 initial equations are the rotational angle of the revolute joint and its first and second derivative. The latter ones are zero, in order to initialize in steady state. By setting the start values of phi, w, a to zero and their fixed attributes to true, the required 3 initial equations are defined.

After translation, this model is initialized in steady-state. The spring constant is computed as c = 49.05 N/m. An animation of this simulation is shown in the figure below.

model Examples.Elementary.InitSpringConstant

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model InitSpringConstant 
  "Determine spring constant such that system is in steady state at given position"

  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world(gravityType=Modelica.Mechanics.MultiBody.Types.GravityTypes.
        UniformGravity);
  Modelica.Mechanics.MultiBody.Joints.Revolute rev(useAxisFlange=true,n={0,0,1},
    phi(fixed=true),
    w(fixed=true),
    a(fixed=true));
  Modelica.Mechanics.Rotational.Components.Damper damper(
                                              d=0.1);
  Modelica.Mechanics.MultiBody.Parts.BodyShape body(
    r={1,0,0},
    r_CM={0.5,0,0},
    m=1);
  Modelica.Mechanics.MultiBody.Parts.Fixed fixed(r={1,0.2,0}, width=0.02);
  Modelica.Mechanics.MultiBody.Forces.Spring spring(s_unstretched=0.1, c(fixed=false) = 100);

equation 
  connect(world.frame_b, rev.frame_a);
  connect(damper.flange_b, rev.axis);
  connect(rev.support, damper.flange_a);
  connect(rev.frame_b, body.frame_a);
  connect(fixed.frame_b, spring.frame_a);
  connect(body.frame_b, spring.frame_b);
end InitSpringConstant;

Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses

Demonstrate line force with two point masses using a JointUPS and alternatively a LineForceWithTwoMasses component

Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses

Information


It is demonstrated how to implement line force components that shall have mass properties. Two alternative implementations are given:

In both cases, a linear 1-dimensional translational damper from the Modelica.Mechanics.Translational library is used as line force between the two attachment points. Simulate this system and plot the differences of the cut forces at both sides of the line force component ("rod_f_diff" and "body_f_diff"). Both vectors should be zero (depending on the choosen relative tolerance of the integration, the difference is in the order of 1.e-10 ... 1.e-15).

Note, that the implementation with the LineForceWithTwoMasses component is simpler and more convenient. An animation of this simulation is shown in the figure below. The system on the left side in the front is the animation with the LineForceWithTwoMasses component whereas the system on the right side in the back is the animation with the JointUPS component.

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Massm1Mass of point masses [kg]

Modelica definition

model LineForceWithTwoMasses 
  "Demonstrate line force with two point masses using a JointUPS and alternatively a LineForceWithTwoMasses component"

  import SI = Modelica.SIunits;

  extends Modelica.Icons.Example;
  parameter Modelica.SIunits.Mass m=1 "Mass of point masses";
  SI.Force rod_f_diff[3]=rod1.frame_b.f - rod3.frame_b.f 
    "Difference of cut-forces in rod1 and rod3";
  SI.Force body_f_diff[3]=bodyBox1.frame_b.f - bodyBox2.frame_b.f 
    "Difference of cut-forces in bodyBox1 and bodyBox2";

  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(phi(fixed=true), w(
        fixed=true));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox1(r={0.7,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod1(
    r={0,-0.9,0},
    width=0.01,
    animation=false);
  Modelica.Mechanics.MultiBody.Joints.Assemblies.JointUPS jointUPS(nAxis_ia={0.7,1.2,0}, animation=
       true);
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    r_CM=0.2*jointUPS.eAxis_ia,
    cylinderDiameter=0.05,
    animation=true,
    m=m,
    I_11=0,
    I_22=0,
    I_33=0);
  Modelica.Mechanics.MultiBody.Parts.Body body2(
    r_CM=-0.2*jointUPS.eAxis_ia,
    cylinderDiameter=0.05,
    animation=true,
    m=m,
    I_11=0,
    I_22=0,
    I_33=0);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod2(
    r={0,0.3,0},
    width=0.01,
    animation=false);
  Modelica.Mechanics.Translational.Components.Damper damper1(
                                                  d=3);
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(phi(fixed=true), w(
        fixed=true));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox2(r={0.7,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod3(
    width=0.01,
    r={0,-0.9,0.3},
    animation=false);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod4(
    width=0.01,
    r={0,0.3,0.3},
    animation=false);
  Modelica.Mechanics.Translational.Components.Damper damper2(
                                                  d=3);
  Modelica.Mechanics.MultiBody.Forces.LineForceWithTwoMasses
    lineForceWithTwoMasses(
    L_a=0.2,
    L_b=0.2,
    cylinderLength_a=0.2,
    cylinderLength_b=1.2,
    massDiameterFaction=2.2,
    m_a=m,
    m_b=m);
equation 
  connect(jointUPS.bearing, damper1.flange_a);
  connect(jointUPS.axis, damper1.flange_b);
  connect(jointUPS.frame_ib, body2.frame_a);
  connect(world.frame_b, rod2.frame_a);
  connect(world.frame_b, rod1.frame_a);
  connect(rod2.frame_b, revolute1.frame_a);
  connect(revolute1.frame_b, bodyBox1.frame_a);
  connect(bodyBox1.frame_b, jointUPS.frame_b);
  connect(body1.frame_a, jointUPS.frame_ia);
  connect(rod1.frame_b, jointUPS.frame_a);
  connect(rod4.frame_b, revolute2.frame_a);
  connect(revolute2.frame_b, bodyBox2.frame_a);
  connect(world.frame_b, rod4.frame_a);
  connect(rod3.frame_a, rod4.frame_a);
  connect(lineForceWithTwoMasses.frame_a, rod3.frame_b);
  connect(lineForceWithTwoMasses.frame_b, bodyBox2.frame_b);
  connect(lineForceWithTwoMasses.flange_b, damper2.flange_b);
  connect(lineForceWithTwoMasses.flange_a, damper2.flange_a);
end LineForceWithTwoMasses;

Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum

Simple pendulum with one revolute joint and one body

Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum

Information


This simple model demonstrates that by just dragging components default animation is defined that shows the structure of the assembled system.

model Examples.Elementary.Pendulum

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model Pendulum "Simple pendulum with one revolute joint and one body"
  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world(gravityType=Modelica.Mechanics.MultiBody.Types.GravityTypes.
        UniformGravity);
  Modelica.Mechanics.MultiBody.Joints.Revolute rev(n={0,0,1},useAxisFlange=true,
    phi(fixed=true),
    w(fixed=true));
  Modelica.Mechanics.Rotational.Components.Damper damper(
                                              d=0.1);
  Modelica.Mechanics.MultiBody.Parts.Body body(m=1.0, r_CM={0.5,0,0});
equation 
  connect(world.frame_b, rev.frame_a);
  connect(damper.flange_b, rev.axis);
  connect(rev.support, damper.flange_a);
  connect(body.frame_a, rev.frame_b);
end Pendulum;

Modelica.Mechanics.MultiBody.Examples.Elementary.PendulumWithSpringDamper Modelica.Mechanics.MultiBody.Examples.Elementary.PendulumWithSpringDamper

Simple spring/damper/mass system

Modelica.Mechanics.MultiBody.Examples.Elementary.PendulumWithSpringDamper

Information


A body is attached on a revolute and prismatic joint. A 3-dim. spring and a 3-dim. damper are connected between the body and a point fixed in the world frame:

model Examples.Elementary.PendulumWithSpringDamper

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Modelica definition

model PendulumWithSpringDamper "Simple spring/damper/mass system"
  extends Modelica.Icons.Example;
  parameter Boolean animation=true "= true, if animation shall be enabled";
  inner Modelica.Mechanics.MultiBody.World world(axisLength=0.6);
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    m=1,
    animation=animation,
    I_11=1,
    I_22=1,
    I_33=1,
    r_CM={0,0,0},
    cylinderDiameter=0.05,
    sphereDiameter=0.2);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar1(animation=animation, r={0.3,0,0});
  Modelica.Mechanics.MultiBody.Forces.Spring spring1(
    coilWidth=0.01,
    numberOfWindings=5,
    c=20,
    s_unstretched=0.2);
  Modelica.Mechanics.MultiBody.Forces.Damper damper1(
    d=1,
    length_a=0.1,
    diameter_a=0.08,
    animation=false);
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute(phi(fixed=true), w(
        fixed=true));
  Modelica.Mechanics.MultiBody.Joints.Prismatic prismatic(
    boxWidth=0.04,
    boxColor={255,65,65},
    s(fixed=true, start=0.5),
    v(fixed=true));
equation 
  connect(world.frame_b, bar1.frame_a);
  connect(revolute.frame_a, bar1.frame_b);
  connect(prismatic.frame_a, revolute.frame_b);
  connect(damper1.frame_a, bar1.frame_b);
  connect(damper1.frame_b, prismatic.frame_b);
  connect(spring1.frame_a, bar1.frame_b);
  connect(spring1.frame_b, prismatic.frame_b);
  connect(body1.frame_a, prismatic.frame_b);
end PendulumWithSpringDamper;

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity

Two point masses in a point gravity field

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity

Information


This model demonstrates a point gravity field. Two bodies are placed in the gravity field. The initial positions and velocities of these bodies are selected such that one body rotates on a circle and the other body rotates on an ellipse around the center of the point gravity field.

model Examples.Elementary.PointGravity

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model PointGravity "Two point masses in a point gravity field"
  import SI = Modelica.SIunits;
  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world(
    mue=1,
    gravitySphereDiameter=0.1,
    gravityType=Modelica.Mechanics.MultiBody.Types.GravityTypes.PointGravity);
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    m=1,
    sphereDiameter=0.1,
    I_11=0.1,
    I_22=0.1,
    I_33=0.1,
    r_0(start={0,0.6,0}, fixed=true),
    v_0(start={1,0,0}, fixed=true),
    angles_fixed=true,
    w_0_fixed=true,
    r_CM={0,0,0});
  Modelica.Mechanics.MultiBody.Parts.Body body2(
    m=1,
    sphereDiameter=0.1,
    I_11=0.1,
    I_22=0.1,
    I_33=0.1,
    r_0(start={0.6,0.6,0}, fixed=true),
    v_0(start={0.6,0,0}, fixed=true),
    angles_fixed=true,
    w_0_fixed=true,
    r_CM={0,0,0});
equation 

end PointGravity;

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses

Two point masses in a point gravity field (rotation of bodies is neglected)

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses

Information


This model demonstrates the usage of model Parts.PointMass in a point gravity field. The PointMass model has the feature that that rotation is not taken into account and can therefore also not be calculated. This example demonstrates two cases where this does not matter: If a PointMass is not connected (body1, body2), the orientation object in these point masses is set to a unit rotation. If a PointMass is connected by a line force element, such as the used Forces.LineForceWithMass component, then the orientation object is set to a unit rotation within the line force element. These are the two cases where the rotation is automatically set to a default value, when the physical system does not provide the equations.

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model PointGravityWithPointMasses 
  "Two point masses in a point gravity field (rotation of bodies is neglected)"
  import SI = Modelica.SIunits;
  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world(
    mue=1,
    gravitySphereDiameter=0.1,
    gravityType=Modelica.Mechanics.MultiBody.Types.GravityTypes.PointGravity);
  Modelica.Mechanics.MultiBody.Parts.PointMass body1(
    m=1,
    sphereDiameter=0.1,
    r_0(start={0,0.6,0}, fixed=true),
    v_0(start={1,0,0}, fixed=true));
  Modelica.Mechanics.MultiBody.Parts.PointMass body2(
    m=1,
    sphereDiameter=0.1,
    r_0(start={0.6,0.6,0}, fixed=true),
    v_0(start={0.6,0,0}, fixed=true));
  Modelica.Mechanics.MultiBody.Parts.PointMass body3(
    m=1,
    sphereDiameter=0.1,
    r_0(start={0,0.8,0}, fixed=true),
    v_0(start={0.6,0,0}, fixed=true));
  Modelica.Mechanics.MultiBody.Parts.PointMass body4(
    m=1,
    sphereDiameter=0.1,
    r_0(start={0.3,0.8,0}, fixed=true),
    v_0(start={0.6,0,0}, fixed=true));
  Forces.Spring spring(showMass=false, c=10);
equation 

  connect(spring.frame_a, body3.frame_a);
  connect(spring.frame_b, body4.frame_a);
end PointGravityWithPointMasses;

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2 Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2

Rigidly connected point masses in a point gravity field

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2

Information


This model demonstrates the usage of model Parts.PointMass in a point gravity field. 6 point masses are connected rigidly together. Translating such a model results in an error, because point masses do not define an orientation object. The example demonstrates that in such a case (when the orientation object is not defined by an object that is connected to a point mass), a "MultiBody.Joints.FreeMotion" joint has to be used, to define the the degrees of freedom of this structure.

In order to demonstrate that this approach is correct, in model "referenceSystem", the same system is again provided, but this time modeled with a generic body (Parts.Body) where the inertia tensor is set to zero. In this case, no FreeMotion object is needed because every body provides its absolute translational and rotational position and velocity as potential states.

The two systems should move exactly in the same way. The system with the PointMasses object visulizes the point masses in "red", whereas the "referenceSystem" shows its bodies in "blue".

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model PointGravityWithPointMasses2 
  "Rigidly connected point masses in a point gravity field"
  extends Modelica.Icons.Example;
  model PointMass = Modelica.Mechanics.MultiBody.Parts.PointMass (m=1, sphereColor={
          255,0,0}) "Point mass used at all places of this example";

  PointMass pointMass1(r_0(start={3,0,0}, fixed=true), v_0(start={0,0,-1},
        fixed=true));

  PointMass pointMass2;
  PointMass pointMass3(r_0(start={2,1,0}, fixed=true), v_0(start={0,0,-1},
        fixed=true));
  PointMass pointMass4;
  PointMass pointMass5;
  PointMass pointMass6;

  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(r={1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1(r={-1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2(r={0,1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3(r={0,-1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation4(r={0,0,1});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation5(r={0,0,-1});

  inner World world(                             gravityType=Modelica.Mechanics.MultiBody.Types.GravityTypes.PointGravity, mue=
        5);
  Joints.FreeMotion freeMotion;

model SystemWithStandardBodies 
    "For comparison purposes, an equivalent model with Bodies instead of PointMasses"
  extends Modelica.Icons.Example;
  model PointMass = Modelica.Mechanics.MultiBody.Parts.Body(m=1,I_11=0,I_22=0,I_33=0) 
      "Body used all places of the comparision model with zero inertia tensor";

  PointMass pointMass1(
      r_0(start={3,0,0}, fixed=true),
      v_0(start={0,0,-1}, fixed=true),
      angles_fixed=true,
      w_0_fixed=true,
      r_CM={0,0,0});
  PointMass pointMass2(r_CM={0,0,0});
  PointMass pointMass3(r_CM={0,0,0});
  PointMass pointMass4(r_CM={0,0,0});
  PointMass pointMass5(r_CM={0,0,0});
  PointMass pointMass6(r_CM={0,0,0});

  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation( r={1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1( r={-1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2( r={0,1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3( r={0,-1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation4( r={0,0,1});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation5( r={0,0,-1});

equation 
  connect(fixedTranslation1.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation2.frame_a);
  connect(fixedTranslation3.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation4.frame_a);
  connect(fixedTranslation5.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation2.frame_b, pointMass3.frame_a);
  connect(fixedTranslation3.frame_b, pointMass4.frame_a);
  connect(pointMass5.frame_a, fixedTranslation4.frame_b);
  connect(fixedTranslation5.frame_b, pointMass6.frame_a);
  connect(fixedTranslation.frame_b, pointMass1.frame_a);
  connect(fixedTranslation1.frame_b, pointMass2.frame_a);
end SystemWithStandardBodies;

  SystemWithStandardBodies referenceSystem;
equation 
  connect(fixedTranslation1.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation2.frame_a);
  connect(fixedTranslation3.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation4.frame_a);
  connect(fixedTranslation5.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation2.frame_b, pointMass3.frame_a);
  connect(fixedTranslation3.frame_b, pointMass4.frame_a);
  connect(pointMass5.frame_a, fixedTranslation4.frame_b);
  connect(fixedTranslation5.frame_b, pointMass6.frame_a);
  connect(fixedTranslation.frame_b, pointMass1.frame_a);
  connect(fixedTranslation1.frame_b, pointMass2.frame_a);
  connect(world.frame_b, freeMotion.frame_a);
  connect(freeMotion.frame_b, fixedTranslation1.frame_a);
end PointGravityWithPointMasses2;

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem

Simple spring/damper/mass system

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem

Information


This example demonstrates:

model Examples.Elementary.SpringDamperSystem

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Modelica definition

model SpringDamperSystem "Simple spring/damper/mass system"
  extends Modelica.Icons.Example;
  parameter Boolean animation=true "= true, if animation shall be enabled";
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    m=1,
    animation=animation,
    r_CM={0,-0.2,0},
    cylinderDiameter=0.05,
    sphereDiameter=0.15,
    I_11=0.1,
    I_22=0.1,
    I_33=0.1,
    r_0(start={0.3,-0.2,0}, fixed=true),
    v_0(fixed=true),
    angles_fixed=true,
    w_0_fixed=true,
    w_0_start(displayUnit="deg/s") = {0,0,0.03490658503988659});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar1(animation=animation, r={0.3,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar2(animation=animation, r={0.6,0,0});
  Modelica.Mechanics.MultiBody.Parts.Body body2(
    m=1,
    animation=animation,
    cylinderDiameter=0.05,
    sphereDiameter=0.15,
    r_CM={0,0,0});
  Modelica.Mechanics.MultiBody.Joints.Prismatic p2(useAxisFlange=true,
    n={0,-1,0},
    animation=animation,
    boxWidth=0.05,
    stateSelect=StateSelect.always,
    v(fixed=true),
    s(fixed=true, start=0.1));
  Modelica.Mechanics.MultiBody.Forces.Spring spring2(
    c=30,
    s_unstretched=0.1,
    coilWidth=0.01,
    width=0.1);
  Modelica.Mechanics.MultiBody.Forces.Spring spring1(
    s_unstretched=0.1,
    coilWidth=0.01,
    c=30,
    numberOfWindings=10,
    width=0.1);
  Modelica.Mechanics.MultiBody.Forces.Damper damper1(d=2);
equation 
  connect(world.frame_b, bar1.frame_a);
  connect(bar1.frame_b, bar2.frame_a);
  connect(bar2.frame_b, p2.frame_a);
  connect(p2.frame_b, body2.frame_a);
  connect(bar2.frame_b, spring2.frame_a);
  connect(body2.frame_a, spring2.frame_b);
  connect(damper1.frame_a, bar1.frame_b);
  connect(spring1.frame_a, bar1.frame_b);
  connect(damper1.frame_b, body1.frame_a);
  connect(spring1.frame_b, body1.frame_a);
end SpringDamperSystem;

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem

Mass attached with a spring to the world frame

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem

Information


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

model Examples.Elementary.SpringMassSystem

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Modelica definition

model SpringMassSystem 
  "Mass attached with a spring to the world frame"
  extends Modelica.Icons.Example;
  parameter Boolean animation=true "= true, if animation shall be enabled";
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Joints.Prismatic p1(useAxisFlange=true,
    n={0,-1,0},
    animation=animation,
    boxWidth=0.05,
    s(fixed=true, start=0.1),
    v(fixed=true));
  Modelica.Mechanics.Translational.Components.Spring spring1(
                                                  c=30, s_rel0=0.1);
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    m=1,
    sphereDiameter=0.2,
    animation=animation,
    r_CM={0,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar1(animation=animation, r={0.3,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar2(animation=animation, r={0.3,0,0});
  Modelica.Mechanics.MultiBody.Parts.Body body2(
    m=1,
    sphereDiameter=0.2,
    animation=animation,
    r_CM={0,0,0});
  Modelica.Mechanics.MultiBody.Joints.Prismatic p2(useAxisFlange=true,
    n={0,-1,0},
    animation=animation,
    boxWidth=0.05,
    stateSelect=StateSelect.always,
    s(fixed=true, start=0.1),
    v(fixed=true));
  Modelica.Mechanics.MultiBody.Forces.Spring spring2(
    c=30,
    s_unstretched=0.1,
    width=0.1);
equation 
  connect(body1.frame_a, p1.frame_b);
  connect(world.frame_b, bar1.frame_a);
  connect(bar1.frame_b, p1.frame_a);
  connect(spring1.flange_b, p1.axis);
  connect(bar1.frame_b, bar2.frame_a);
  connect(bar2.frame_b, p2.frame_a);
  connect(p2.frame_b, body2.frame_a);
  connect(bar2.frame_b, spring2.frame_a);
  connect(body2.frame_a, spring2.frame_b);
  connect(spring1.flange_a, p1.support);
end SpringMassSystem;

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringWithMass Modelica.Mechanics.MultiBody.Examples.Elementary.SpringWithMass

Point mass hanging on a spring

Modelica.Mechanics.MultiBody.Examples.Elementary.SpringWithMass

Information


This example shows that a force component may have a mass. The 3-dimensional spring as used in this example, has an optional point mass between the two points where the spring is attached. In the animation, this point mass is represented by a small, light blue, sphere.

model Examples.Elementary.SpringWithMass

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model SpringWithMass "Point mass hanging on a spring"
  extends Modelica.Icons.Example;
  inner Modelica.Mechanics.MultiBody.World world(animateGravity=false);
  Modelica.Mechanics.MultiBody.Forces.Spring spring(
    s_unstretched=0.2,
    m=0.5,
    c=40,
    width=0.1,
    massDiameter=0.07);
  Modelica.Mechanics.MultiBody.Parts.Body body(
    r_0(start={0,-0.3,0}, fixed=true),
    v_0(fixed=true),
    angles_fixed=true,
    w_0_fixed=true,
    r_CM={0,0,0},
    m=1);
equation 
  connect(world.frame_b, spring.frame_a);
  connect(body.frame_a, spring.frame_b);
end SpringWithMass;

Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings

3-dim. springs in series and parallel connection

Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings

Information


This example demonstrates that 3-dimensional line force elements (here: Modelica.Mechanics.MultiBody.Forces.Spring elements) can be connected together in series without having a body with mass at the connection point (as usually required by multi-body programs). This is advantageous since stiff systems can be avoided, say, due to a stiff spring and a small mass at the connection point.

model Examples.Elementary.ThreeSprings

Extends from Modelica.Icons.Example (Icon for an example model).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Modelica definition

model ThreeSprings "3-dim. springs in series and parallel connection"
  extends Modelica.Icons.Example;
  parameter Boolean animation=true "= true, if animation shall be enabled";
  inner Modelica.Mechanics.MultiBody.World world(animateWorld=animation);
  Modelica.Mechanics.MultiBody.Parts.Body body1(
    animation=animation,
    r_CM={0,-0.2,0},
    m=0.8,
    I_11=0.1,
    I_22=0.1,
    I_33=0.1,
    sphereDiameter=0.2,
    r_0(start={0.5,-0.3,0}, fixed=true),
    v_0(fixed=true),
    angles_fixed=true,
    w_0_fixed=true);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar1(animation=animation, r={0.3,0,0});
  Modelica.Mechanics.MultiBody.Forces.Spring spring1(
    lineForce(r_rel_0(start={-0.2,-0.2,0.2})),
    s_unstretched=0.1,
    width=0.1,
    coilWidth=0.005,
    numberOfWindings=5,
    c=20,
    animation=animation);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation bar2(animation=animation, r={0,0,0.3});
  Modelica.Mechanics.MultiBody.Forces.Spring spring2(
    s_unstretched=0.1,
    width=0.1,
    coilWidth=0.005,
    numberOfWindings=5,
    c=40,
    animation=animation);
  Modelica.Mechanics.MultiBody.Forces.Spring spring3(
    s_unstretched=0.1,
    width=0.1,
    coilWidth=0.005,
    numberOfWindings=5,
    c=20,
    animation=animation);
equation 
  connect(world.frame_b, bar1.frame_a);
  connect(world.frame_b, bar2.frame_a);
  connect(bar1.frame_b, spring1.frame_a);
  connect(bar2.frame_b, spring3.frame_a);
  connect(spring2.frame_b, body1.frame_a);
  connect(spring3.frame_b, spring1.frame_b);
  connect(spring2.frame_a, spring1.frame_b);
end ThreeSprings;

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel

Single wheel rolling on ground starting from an initial speed

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel

Information



Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model RollingWheel 
  "Single wheel rolling on ground starting from an initial speed"
   extends Modelica.Icons.Example;

  Modelica.Mechanics.MultiBody.Parts.RollingWheel wheel1(
    wheelRadius=0.3,
    wheelMass=2,
    wheel_I_axis=0.06,
    wheel_I_long=0.12,
    hollowFraction=0.6,
    x(start=0.2),
    y(start=0.2),
    der_angles(start={0,5,1}));
  inner Modelica.Mechanics.MultiBody.World world(label2="z", n={0,0,-1});
  Modelica.Mechanics.MultiBody.Visualizers.Ground ground(length=4);
end RollingWheel;

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetDriving Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetDriving

Rolling wheel set that is driven by torques driving the wheels

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetDriving

Information



Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model RollingWheelSetDriving 
  "Rolling wheel set that is driven by torques driving the wheels"
   extends Modelica.Icons.Example;

  Modelica.Mechanics.MultiBody.Visualizers.Ground ground(
                length=3, groundColor={0,255,0});
  inner Modelica.Mechanics.MultiBody.World world(label2="z", n={0,0,-1});
  Modelica.Mechanics.MultiBody.Parts.RollingWheelSet wheelSet(
    wheelRadius=0.1,
    wheelMass=0.5,
    wheel_I_axis=0.01,
    wheel_I_long=0.02,
    wheelDistance=0.5,
    x(start=0.1, fixed=true),
    y(start=0.1, fixed=true),
    phi(fixed=true),
    theta1(fixed=true),
    theta2(fixed=true),
    der_theta1(fixed=true),
    der_theta2(fixed=true));
  Modelica.Mechanics.MultiBody.Parts.Body body(m=0.01, r_CM={0,0,0},
    animation=false);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(
                       r={0.2,0,0},
    animation=true,
    width=0.04);
  Modelica.Blocks.Sources.Sine sine1(freqHz=1, amplitude=2);
  Modelica.Blocks.Sources.Sine sine2(
    freqHz=1,
    amplitude=2,
    phase=1.5707963267949);
  Modelica.Mechanics.Rotational.Sources.Torque2 torque1;
  Modelica.Mechanics.Rotational.Sources.Torque2 torque2;
  Modelica.Mechanics.MultiBody.Visualizers.FixedShape shape(
    final lengthDirection={0,1,0},
    final widthDirection={1,0,0},
    final shapeType="pipe",
    final r_shape={0,-wheelSet.wheelWidth,0},
    final length=2*wheelSet.wheelWidth,
    final width=2*wheelSet.wheelRadius,
    final height=2*wheelSet.wheelRadius,
    final color={0,128,255},
    final extra=0.8);
equation 
  connect(fixedTranslation.frame_a, wheelSet.frameMiddle);
  connect(fixedTranslation.frame_b, body.frame_a);
  connect(wheelSet.axis1, torque1.flange_a);
  connect(torque1.flange_b, wheelSet.support);
  connect(wheelSet.axis2, torque2.flange_a);
  connect(wheelSet.support, torque2.flange_b);
  connect(sine1.y, torque1.tau);
  connect(sine2.y, torque2.tau);
  connect(shape.frame_a, fixedTranslation.frame_b);
end RollingWheelSetDriving;

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetPulling Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetPulling

Rolling wheel set that is pulled by a force

Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheelSetPulling

Information



Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model RollingWheelSetPulling 
  "Rolling wheel set that is pulled by a force"
   extends Modelica.Icons.Example;

  Modelica.Mechanics.MultiBody.Forces.WorldForce force(animation=false);
  Modelica.Mechanics.MultiBody.Visualizers.Ground ground(
                length=3);
  inner Modelica.Mechanics.MultiBody.World world(label2="z", n={0,0,-1});
  Modelica.Mechanics.MultiBody.Parts.RollingWheelSet wheelSet(
    wheelRadius=0.1,
    wheelMass=0.5,
    wheel_I_axis=0.01,
    wheel_I_long=0.02,
    wheelDistance=0.5,
    x(start=0.1, fixed=true),
    y(start=0.1, fixed=true),
    phi(fixed=true),
    theta1(fixed=true),
    theta2(fixed=true),
    der_theta1(fixed=true),
    der_theta2(fixed=true));
  Modelica.Mechanics.MultiBody.Parts.Body body(m=0.01, r_CM={0,0,0},
    animation=false);
  Modelica.Blocks.Sources.CombiTimeTable combiTimeTable(table=[0,1,0,0; 1,1,
        0,0; 2,0,2,0; 3,0,2,0]);
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(
                       r={0.2,0,0},
    animation=true,
    width=0.04);
  Modelica.Mechanics.MultiBody.Visualizers.FixedShape shape(
    final lengthDirection={0,1,0},
    final widthDirection={1,0,0},
    final shapeType="pipe",
    final r_shape={0,-wheelSet.wheelWidth,0},
    final length=2*wheelSet.wheelWidth,
    final width=2*wheelSet.wheelRadius,
    final height=2*wheelSet.wheelRadius,
    final color={0,128,255},
    final extra=0.8);
equation 
  connect(combiTimeTable.y, force.force);
  connect(fixedTranslation.frame_a, wheelSet.frameMiddle);
  connect(fixedTranslation.frame_b, body.frame_a);
  connect(force.frame_b, fixedTranslation.frame_b);
  connect(shape.frame_a, fixedTranslation.frame_b);
end RollingWheelSetPulling;

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.PointMass Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.PointMass

Point mass used at all places of this example

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.PointMass

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled (show sphere)
Massm1Mass of mass point [kg]
Initialization
Positionr_0.start[3]{0,0,0}Position vector from origin of world frame to origin of frame_a, resolved in world frame [m]
Velocityv_0.start[3]{0,0,0}Absolute velocity of frame_a, resolved in world frame (= der(r_0)) [m/s]
Accelerationa_0.start[3]{0,0,0}Absolute acceleration of frame_a resolved in world frame (= der(v_0)) [m/s2]
Animation
if animation = true
DiametersphereDiameterworld.defaultBodyDiameterDiameter of sphere [m]
ColorsphereColor{255,0,0}Color of sphere
SpecularCoefficientspecularCoefficientworld.defaultSpecularCoeffic...Reflection of ambient light (= 0: light is completely absorbed)
Advanced
StateSelectstateSelectStateSelect.avoidPriority to use frame_a.r_0, v_0 (= der(frame_a.r_0)) as states

Connectors

TypeNameDescription
Frame_aframe_aCoordinate system fixed at center of mass point

Modelica definition

model PointMass = Modelica.Mechanics.MultiBody.Parts.PointMass (m=1, sphereColor={
        255,0,0}) "Point mass used at all places of this example";

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies

For comparison purposes, an equivalent model with Bodies instead of PointMasses

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies

Information


In order to compare the results of the "PointMass" example where 6 point masses are rigidly connected together, in this comparision model, an equivalent system is setup, with the only difference that the point masses are replaced by Bodies with zero inertia.

Extends from Modelica.Icons.Example (Icon for an example model).

Modelica definition

model SystemWithStandardBodies 
  "For comparison purposes, an equivalent model with Bodies instead of PointMasses"
  extends Modelica.Icons.Example;
  model PointMass = Modelica.Mechanics.MultiBody.Parts.Body(m=1,I_11=0,I_22=0,I_33=0) 
    "Body used all places of the comparision model with zero inertia tensor";

  PointMass pointMass1(
      r_0(start={3,0,0}, fixed=true),
      v_0(start={0,0,-1}, fixed=true),
      angles_fixed=true,
      w_0_fixed=true,
      r_CM={0,0,0});
  PointMass pointMass2(r_CM={0,0,0});
  PointMass pointMass3(r_CM={0,0,0});
  PointMass pointMass4(r_CM={0,0,0});
  PointMass pointMass5(r_CM={0,0,0});
  PointMass pointMass6(r_CM={0,0,0});

  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation( r={1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1( r={-1,0,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2( r={0,1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3( r={0,-1,0});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation4( r={0,0,1});
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation5( r={0,0,-1});

equation 
  connect(fixedTranslation1.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation2.frame_a);
  connect(fixedTranslation3.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation1.frame_a, fixedTranslation4.frame_a);
  connect(fixedTranslation5.frame_a, fixedTranslation.frame_a);
  connect(fixedTranslation2.frame_b, pointMass3.frame_a);
  connect(fixedTranslation3.frame_b, pointMass4.frame_a);
  connect(pointMass5.frame_a, fixedTranslation4.frame_b);
  connect(fixedTranslation5.frame_b, pointMass6.frame_a);
  connect(fixedTranslation.frame_b, pointMass1.frame_a);
  connect(fixedTranslation1.frame_b, pointMass2.frame_a);
end SystemWithStandardBodies;

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies.PointMass Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies.PointMass

Body used all places of the comparision model with zero inertia tensor

Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.SystemWithStandardBodies.PointMass

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled (show cylinder and sphere)
Positionr_CM[3] Vector from frame_a to center of mass, resolved in frame_a [m]
Massm1Mass of rigid body [kg]
Inertia tensor (resolved in center of mass, parallel to frame_a)
InertiaI_110 (1,1) element of inertia tensor [kg.m2]
InertiaI_220 (2,2) element of inertia tensor [kg.m2]
InertiaI_330 (3,3) element of inertia tensor [kg.m2]
InertiaI_210 (2,1) element of inertia tensor [kg.m2]
InertiaI_310 (3,1) element of inertia tensor [kg.m2]
InertiaI_320 (3,2) element of inertia tensor [kg.m2]
Initialization
Positionr_0.start[3]{0,0,0}Position vector from origin of world frame to origin of frame_a [m]
Velocityv_0.start[3]{0,0,0}Absolute velocity of frame_a, resolved in world frame (= der(r_0)) [m/s]
Accelerationa_0.start[3]{0,0,0}Absolute acceleration of frame_a resolved in world frame (= der(v_0)) [m/s2]
Booleanangles_fixedfalse= true, if angles_start are used as initial values, else as guess values
Angleangles_start[3]{0,0,0}Initial values of angles to rotate frame_a around 'sequence_start' axes into frame_b [rad]
RotationSequencesequence_start{1,2,3}Sequence of rotations to rotate frame_a into frame_b at initial time
Booleanw_0_fixedfalse= true, if w_0_start are used as initial values, else as guess values
AngularVelocityw_0_start[3]{0,0,0}Initial or guess values of angular velocity of frame_a resolved in world frame [rad/s]
Booleanz_0_fixedfalse= true, if z_0_start are used as initial values, else as guess values
AngularAccelerationz_0_start[3]{0,0,0}Initial values of angular acceleration z_0 = der(w_0) [rad/s2]
Animation
if animation = true
DiametersphereDiameterworld.defaultBodyDiameterDiameter of sphere [m]
ColorsphereColorModelica.Mechanics.MultiBody...Color of sphere
DiametercylinderDiametersphereDiameter/Types.Default...Diameter of cylinder [m]
ColorcylinderColorsphereColorColor of cylinder
SpecularCoefficientspecularCoefficientworld.defaultSpecularCoeffic...Reflection of ambient light (= 0: light is completely absorbed)
Advanced
BooleanenforceStatesfalse = true, if absolute variables of body object shall be used as states (StateSelect.always)
BooleanuseQuaternionstrue = true, if quaternions shall be used as potential states otherwise use 3 angles as potential states
RotationSequencesequence_angleStates{1,2,3} Sequence of rotations to rotate world frame into frame_a around the 3 angles used as potential states

Connectors

TypeNameDescription
Frame_aframe_aCoordinate system fixed at body

Modelica definition

model PointMass = Modelica.Mechanics.MultiBody.Parts.Body(m=1,I_11=0,I_22=0,I_33=0) 
  "Body used all places of the comparision model with zero inertia tensor";

HTML-documentation generated by Dymola Sun Jan 17 21:11:11 2010.