MultiBondLib.PlanarMechanics.Joints

joint elements

Information


This package contains models of joints.

Joints are massles objects, that define the relative movement between two rigid elements. The number of degrees of freedom specifies how many variables are minimally needed to describe the relative position. An object in a planar space can have up to 3 degrees of freedom.

Joints usually define integrators and the joint variables on positional and velocity level become state variables of the system. Anyhow the integrators might be removed by the Pantelides algorithm, if the joint is placed in a kinematic loop.
The number of degrees of freedom equals the number of potential state variables.

It is possible and common to create complex joints out of simple joints. However, one has to pay attention that no singularities occur if two or more joints are connected (directly or through massless elements).

Package Content

NameDescription
MultiBondLib.PlanarMechanics.Joints.Prismatic Prismatic prismatic joint (1 degree of freedom)
MultiBondLib.PlanarMechanics.Joints.Revolute Revolute revolute joint (1-degree of freedom)
MultiBondLib.PlanarMechanics.Joints.FreeBodyMovement FreeBodyMovement joint with all degrees of freedom (3)
MultiBondLib.PlanarMechanics.Joints.PotentialFBM PotentialFBM potential free-body movement joint
MultiBondLib.PlanarMechanics.Joints.CloseLoop CloseLoop element to close kinematik loops manualy


MultiBondLib.PlanarMechanics.Joints.Prismatic MultiBondLib.PlanarMechanics.Joints.Prismatic

prismatic joint (1 degree of freedom)

MultiBondLib.PlanarMechanics.Joints.Prismatic

Information


This is a prismatic joint. The two connected frames are allowed to shift in direction of the joint axis.
This joint defines one degree of freedom. 

General parameter

The joint axis can be defined by the parameter n. n can be of arbitrary length, but it must not be zero.

The parameter s_offset defines an offset value for the joint length s.

The parameter animation toggles the visualization of the element.

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element is visualized by box. The settings for width, height and color can be specified by the animation parameters.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

TypeNameDefaultDescription
Booleananimationtrueanimate prismatic joint as box
Positionn[2]{1,0}direction of the joint axis [m]
Positions_offset0Relative distance offset (distance between frame_a and frame_b = s_offset + s) [m]
Initialization
TempinitTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
Reals_start0initial length
Realv_start0initial velocity
Reala_start0initial acceleration
Animation
if animation = true
DistanceboxWidthplanarWorld.defaultJointWidth Width of prismatic joint box [m]
DistanceboxHeightboxWidth Height of prismatic joint box [m]
ColorboxColor[3]planarWorld.defaultJointColor Color of prismatic joint box
Advanced
BooleanenforceStatesfalseenforce s and v as states

Connectors

TypeNameDescription
Frame_aframe_a 
Frame_bframe_b 

Modelica definition

model Prismatic "prismatic joint (1 degree of freedom)" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter Boolean animation = true "animate prismatic joint as box";
  
  parameter SI.Position n[2] = {1,0} "direction of the joint axis";
  parameter SI.Position s_offset=0 
    "Relative distance offset (distance between frame_a and frame_b = s_offset + s)";
  final parameter SI.Position eD[2] = n/sqrt(n*n);
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter Real s_start = 0 "|Initialization|initial length";
  parameter Real v_start = 0 "|Initialization|initial velocity";
  parameter Real a_start = 0 "|Initialization|initial acceleration";
  
  parameter SI.Distance boxWidth=planarWorld.defaultJointWidth 
    "|Animation|if animation = true| Width of prismatic joint box";
  parameter SI.Distance boxHeight=boxWidth 
    "|Animation|if animation = true| Height of prismatic joint box";
  parameter Modelica.Mechanics.MultiBody.Types.Color boxColor=planarWorld.defaultJointColor 
    "|Animation|if animation = true| Color of prismatic joint box";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce s and v as states";
  
  SI.Position s(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "length of prismatic joint";
  SI.Velocity v(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "velocity of prismatic joint";
  SI.Acceleration a "acceleration of prismatic joint";
  
  Interfaces.Frame_a frame_a;
  Interfaces.Frame_b frame_b;
  
protected 
  outer PlanarWorld planarWorld;
  
  inner Defaults MBG_defaults(n=3);
  
  Interfaces.Mech2MBG Mech2MBG1;
  Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J0Partial J0Partial1(
    n=3,
    nPartial=2,
    order={1,2,3});
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  AdditionalMBG.Translation Translation1(d=eD);
  Junctions.J1 J1_1(n=1);
  Sources.Se Se1(e0={0}, n=1);
  AdditionalMBG.prismaticTF prismaticTF1(d=eD);
  AdditionalMBG.translationalTF translationalTF1(d=eD);
  Bonds.MultiBond MultiBond3;
  Bonds.Utilities.MultiBondTail MultiBondTail1;
  Bonds.MultiBond MultiBond4(n=1);
  Bonds.MultiBond MultiBond5(n=1);
  Bonds.MultiBond MultiBond6(n=2);
  Bonds.MultiBond MultiBond7(n=1);
  Sensors.Dq Dq1(stateInitialCondition=false,q(stateSelect = StateSelect.never),
    n=1);
  
  parameter Integer ndim=if planarWorld.enableAnimation and animation then 1 else 
            0;
  MB.Visualizers.Advanced.Shape sphere[ndim](
    each shapeType="box",
    each color=boxColor,
    each length=Dq1.q[1],
    each width=boxWidth,
    each height=boxHeight,
    each lengthDirection={eD[1],eD[2],0},
    each widthDirection={0,0,1},
    each r_shape={0,0,0},
    each r={Mech2MBG1.q[1],Mech2MBG1.q[2],0},
    each R=MB.Frames.planarRotation({0,0,-1},Mech2MBG1.q[3],0));
  
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    s = s_start;
  end if;
  
  if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init.
      PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or 
      initType == MB.Types.Init.VelocityAcceleration then
    // Initialize velocity variables
    v = v_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    a = a_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    v = 0;
    a = 0;
  end if;
  
equation 
  defineBranch(frame_a.P, frame_b.P);
  s = Dq1.q[1]-s_offset;
  v = J1_1.MultiBondCon1.f[1];
  a = der(v);
  connect(Mech2MBG1.frame_a, frame_a);
  connect(MBG2Mech1.frame_b, frame_b);
  connect(MultiBond2.MultiBondCon2, J0Partial1.MultiBondCon1);
  connect(MultiBond1.MultiBondCon1, J0Partial1.MultiBondCon2);
  connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondCon1);
  connect(translationalTF1.MultiBondCon2, MultiBond2.MultiBondCon1);
  connect(MultiBond3.MultiBondCon2, translationalTF1.MultiBondCon1);
  connect(MultiBond3.MultiBondCon1, Mech2MBG1.MultiBondCon1);
  connect(MultiBond6.MultiBondCon1, prismaticTF1.MultiBondConB);
  connect(MultiBond6.MultiBondCon2, J0Partial1.MultiBondCon3);
  connect(MultiBond4.MultiBondCon1, Se1.MultiBondCon1);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon2);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon3);
  connect(MultiBond5.MultiBondCon2, prismaticTF1.MultiBondConA);
  connect(Dq1.q[1], translationalTF1.ampl);
  connect(Dq1.q[1], Translation1.ampl);
  connect(Mech2MBG1.q, Translation1.q1);
  connect(Translation1.q2, MBG2Mech1.q);
  connect(translationalTF1.phi, Mech2MBG1.q[3]);
  connect(prismaticTF1.phi, Mech2MBG1.q[3]);
  connect(MultiBond7.MultiBondCon1, J1_1.MultiBondCon1);
  connect(MultiBond7.MultiBondCon2, Dq1.MultiBondCon1);
end Prismatic;

MultiBondLib.PlanarMechanics.Joints.Revolute MultiBondLib.PlanarMechanics.Joints.Revolute

revolute joint (1-degree of freedom)

MultiBondLib.PlanarMechanics.Joints.Revolute

Information


This is a revolute joint. The two connected frames are allowed to rotate around the joint axis normal to the plane. This joint defines one degree of freedom. 

General parameter

The parameter phi_offset defines an offset value for the revolute angle phi.

The parameter animation toggles the visualization of the element.

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element is visualized by a cylinder along the rotation axis. The settings for length, diameter and color can be specified by the animation parameters.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

TypeNameDefaultDescription
Booleananimationtrueanimate revolute joint as cylinder
Angle_degphi_offset0phi + phi_offset = angle between frames [deg]
Initialization
TempinitTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
Angle_degphi_start0initial angle [deg]
AngularVelocity_degw_start0initial angular velocity [deg/s]
AngularAcceleration_degz_start0initial angular acceleration [deg/s2]
Animation
if animation = true
DistancecylinderLengthplanarWorld.defaultJointLength Length of cylinder representing the joint axis [m]
DistancecylinderDiameterplanarWorld.defaultJointWidth Diameter of cylinder representing the joint axis [m]
ColorcylinderColor[3]planarWorld.defaultJointColor Color of cylinder representing the joint axis
Advanced
BooleanenforceStatesfalseenforce phi and w as states

Connectors

TypeNameDescription
Frame_aframe_a 
Frame_bframe_b 

Modelica definition

model Revolute "revolute joint (1-degree of freedom)" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  import Cv = Modelica.SIunits.Conversions;
  
  
  parameter Boolean animation = true "animate revolute joint as cylinder";
  parameter Cv.NonSIunits.Angle_deg phi_offset = 0 
    "phi + phi_offset = angle between frames";
  final parameter SI.Angle phi_offset_rad = Cv.from_deg(phi_offset);
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter Cv.NonSIunits.Angle_deg phi_start = 0 
    "|Initialization|initial angle";
  parameter Types.AngularVelocity_deg w_start = 0 
    "|Initialization|initial angular velocity";
  parameter Types.AngularAcceleration_deg z_start = 0 
    "|Initialization|initial angular acceleration";
  
  final parameter SI.Angle phi_start_rad = Cv.from_deg(phi_start) 
    "initial cardan angles";
  final parameter SI.AngularVelocity w_start_rad = Cv.from_deg(w_start) 
    "initial angular velocity";
  final parameter SI.AngularAcceleration z_start_rad = Cv.from_deg(z_start) 
    "initial angular acceleration";
  
  parameter SI.Distance cylinderLength=planarWorld.defaultJointLength 
    "|Animation|if animation = true| Length of cylinder representing the joint axis";
  parameter SI.Distance cylinderDiameter=planarWorld.defaultJointWidth 
    "|Animation|if animation = true| Diameter of cylinder representing the joint axis";
  parameter Modelica.Mechanics.MultiBody.Types.Color cylinderColor=planarWorld.defaultJointColor 
    "|Animation|if animation = true| Color of cylinder representing the joint axis";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce phi and w as states";
  
  SI.Angle phi(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "revolute angle";
  SI.AngularVelocity w(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "revolute angular velocity";
  SI.AngularAcceleration z "revolute angular acceleration";
  
  Interfaces.Frame_a frame_a;
  Interfaces.Frame_b frame_b;
  
protected 
  outer PlanarWorld planarWorld;
  
  inner Defaults MBG_defaults(n=3);
  
  Interfaces.Mech2MBG Mech2MBG1;
  Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J0Partial J0Partial1(
    n=3,
    nPartial=1,
    order={3,1,2});
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond3(n=1);
  Bonds.MultiBond MultiBond5(n=1);
  Bonds.Utilities.MultiBondTail MultiBondTail1;
  Junctions.J1 J1_1(n=1);
  Bonds.MultiBond MultiBond4(n=1);
  Sources.Se Se1(n=1, e0={0});
  Sensors.Dq Dq_phi(stateInitialCondition=false, n=1);
  
  AdditionalMBG.Translation TranslationRevolute(d={0,0});
  
  parameter Integer ndim=if planarWorld.enableAnimation and animation then 1 else 0;
  MB.Visualizers.Advanced.Shape cylinder[ndim](
    each shapeType="cylinder",
    each color=cylinderColor,
    each length=cylinderLength,
    each width=cylinderDiameter,
    each height=cylinderDiameter,
    each lengthDirection={0,0,1},
    each widthDirection={0,1,0},
    each r_shape=-{0,0,1}*cylinderLength/2,
    each r={Mech2MBG1.q[1],Mech2MBG1.q[2],0},
    each R=MB.Frames.planarRotation({0,0,-1},Mech2MBG1.q[3],0));
  
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    phi = phi_start_rad;
  end if;
  
  if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init.
      PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or 
      initType == MB.Types.Init.VelocityAcceleration then
    // Initialize velocity variables
    w = w_start_rad;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    z = z_start_rad;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    w = 0;
    z = 0;
  end if;
  
equation 
  defineBranch(frame_a.P, frame_b.P);
  phi = Dq_phi.q[1]-phi_offset_rad;
  w = J1_1.MultiBondCon1.f[1];
  z = der(w);
  connect(MBG2Mech1.frame_b, frame_b);
  connect(Mech2MBG1.frame_a, frame_a);
  connect(MultiBond2.MultiBondCon2, J0Partial1.MultiBondCon1);
  connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondCon1);
  connect(MultiBond1.MultiBondCon1, J0Partial1.MultiBondCon2);
  connect(MultiBond2.MultiBondCon1, Mech2MBG1.MultiBondCon1);
  connect(MultiBond3.MultiBondCon2, J0Partial1.MultiBondCon3);
  connect(J1_1.MultiBondCon3, MultiBond3.MultiBondCon1);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon4);
  connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
  connect(Dq_phi.q[1], TranslationRevolute.phi);
  connect(Mech2MBG1.q, TranslationRevolute.q1);
  connect(TranslationRevolute.q2, MBG2Mech1.q);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon1);
  connect(MultiBond5.MultiBondCon2, Dq_phi.MultiBondCon1);
end Revolute;

MultiBondLib.PlanarMechanics.Joints.FreeBodyMovement MultiBondLib.PlanarMechanics.Joints.FreeBodyMovement

joint with all degrees of freedom (3)

MultiBondLib.PlanarMechanics.Joints.FreeBodyMovement

Information


This is an untypical joint, that does not restrict the movement of its connected element
and defines all 3 degrees of freedom. The usage of this joint is hardly necessary, because it is potentially avaiable in each body element.

General parameter

There are no general parameters

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element isn't visualized.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

TypeNameDefaultDescription
Initialization
TempinitTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
Positionx_start[2]{0,0}initial position (x,y) [m]
Velocityv_start[2]{0,0}initial velocity (vx, vy) [m/s]
Accelerationa_start[2]{0,0}initial acceleration (ax, ay) [m/s2]
Anglephi_start0initial angle [rad]
AngularVelocityw_start0initial ang. velocity [rad/s]
AngularAccelerationz_start0initial ang. acc. [rad/s2]
Advanced
BooleanenforceStatesfalseenforce x,y,phi and vx, vy, w as states

Connectors

TypeNameDescription
Frame_bframe_b 

Modelica definition

model FreeBodyMovement "joint with all degrees of freedom (3)" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter SI.Position x_start[2] = {0,0} 
    "|Initialization|initial position (x,y)";
  parameter SI.Velocity v_start[2] = {0,0} 
    "|Initialization|initial velocity (vx, vy)";
  parameter SI.Acceleration a_start[2] = {0,0} 
    "|Initialization|initial acceleration (ax, ay)";
  
  parameter SI.Angle phi_start = 0 "|Initialization|initial angle";
  parameter SI.AngularVelocity w_start = 0 
    "|Initialization|initial ang. velocity ";
  parameter SI.AngularAcceleration z_start = 0 
    "|Initialization|initial ang. acc.";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce x,y,phi and vx, vy, w as states";
  
  Interfaces.Frame_b frame_b;
  SI.Position x(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Position y(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Angle phi(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  
  SI.Velocity vx(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Velocity vy(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.AngularVelocity w(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  
  SI.Acceleration ax;
  SI.Acceleration ay;
  SI.AngularAcceleration z;
  
protected 
  inner Defaults MBG_defaults(n=3);
protected 
  Interfaces.MBG2Mech MBG2Mech1;
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  Sources.Se Se1(e0={0}, n=3);
  Sensors.Dq Dq1(n=3, q_start={0,0,0},
    stateInitialCondition=false);
  Junctions.J1 J1_1;
  
  Bonds.MultiBond MultiBond3;
  
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    {x,y} = x_start;
    phi = phi_start;
  end if;
  
  if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init.
      PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or 
      initType == MB.Types.Init.VelocityAcceleration then
    // Initialize velocity variables
    {vx, vy} = v_start;
    w = w_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    {ax, ay} = a_start;
    z = z_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    {vx, vy} = zeros(2);
    {ax, ay} = zeros(2);
    w = 0;
    z = 0;
  end if;
  
equation 
  defineRoot(frame_b.P);
  {x,y,phi} = MBG2Mech1.q;
  {vx,vy,w} = MBG2Mech1.MultiBondCon1.f;
  {ax,ay,z} = der({vx,vy,w});
  connect(MBG2Mech1.frame_b, frame_b);
  connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondCon1);
  connect(Se1.MultiBondCon1, MultiBond2.MultiBondCon1);
  connect(Dq1.q, MBG2Mech1.q);
  connect(J1_1.MultiBondCon2, MultiBond1.MultiBondCon1);
  connect(J1_1.MultiBondCon1, MultiBond2.MultiBondCon2);
  connect(MultiBond3.MultiBondCon1, J1_1.MultiBondCon3);
  connect(MultiBond3.MultiBondCon2, Dq1.MultiBondCon1);
end FreeBodyMovement;

MultiBondLib.PlanarMechanics.Joints.PotentialFBM MultiBondLib.PlanarMechanics.Joints.PotentialFBM

potential free-body movement joint

MultiBondLib.PlanarMechanics.Joints.PotentialFBM

Information


This is a potential joint. It is in principle equal to the free body movement joint, but the differential
equations are only stated if necessary (i. e.: if the body movement can't be derived out of other joints).
This joint is part of every body element. There is actually no further usage of this element elsewhere. 

General parameter

There are no general parameters

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element isn't visualized.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

TypeNameDefaultDescription
Initialization
TempinitTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
Positionx_start[2]{0,0}initial position (x,y) [m]
Velocityv_start[2]{0,0}initial velocity (vx, vy) [m/s]
Accelerationa_start[2]{0,0}initial acceleration (ax, ay) [m/s2]
Anglephi_start0initial angle [rad]
AngularVelocityw_start0initial ang. velocity [rad/s]
AngularAccelerationz_start0initial ang. acc. [rad/s2]
Advanced
BooleanenforceStatesfalseenforce x,y,phi and vx, vy, w as states

Connectors

TypeNameDescription
Frame_bframe_b 

Modelica definition

model PotentialFBM "potential free-body movement joint" 
  
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter SI.Position x_start[2] = {0,0} 
    "|Initialization|initial position (x,y)";
  parameter SI.Velocity v_start[2] = {0,0} 
    "|Initialization|initial velocity (vx, vy)";
  parameter SI.Acceleration a_start[2] = {0,0} 
    "|Initialization|initial acceleration (ax, ay)";
  
  parameter SI.Angle phi_start = 0 "|Initialization|initial angle";
  parameter SI.AngularVelocity w_start = 0 
    "|Initialization|initial ang. velocity ";
  parameter SI.AngularAcceleration z_start = 0 
    "|Initialization|initial ang. acc.";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce x,y,phi and vx, vy, w as states";
  
  Interfaces.Frame_b frame_b;
  SI.Position x(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Position y(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Angle phi(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  
  SI.Velocity vx(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.Velocity vy(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  SI.AngularVelocity w(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer);
  
  SI.Acceleration ax;
  SI.Acceleration ay;
  SI.AngularAcceleration z;
  
protected 
  inner Defaults MBG_defaults(n=3);
protected 
  Interfaces.MBG2Mech MBG2Mech1;
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  Sources.Se Se1(e0={0}, n=3);
  Junctions.J1 J1_1;
  
protected 
  Bonds.MultiBond MultiBond3;
  
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    {x,y} = x_start;
    phi = phi_start;
  end if;
  
  if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init.
      PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or 
      initType == MB.Types.Init.VelocityAcceleration then
    // Initialize velocity variables
    {vx, vy} = v_start;
    w = w_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    {ax, ay} = a_start;
    z = z_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    {vx, vy} = zeros(2);
    {ax, ay} = zeros(2);
    w = 0;
    z = 0;
  end if;
  
equation 
  if enforceStates then
    defineRoot(frame_b.P);
  else
    definePotentialRoot(frame_b.P);
  end if;
  
  //activate differential equations for the root case 
  if isRoot(frame_b.P) then
    vx = der(x);
    vy = der(y);
    w = der(phi);
  end if;
  
  MultiBond3.MultiBondCon2.e = zeros(3);
  
  {x,y,phi} = MBG2Mech1.q;
  {vx,vy,w} = MBG2Mech1.MultiBondCon1.f;
  {ax,ay,z} = der({vx,vy,w});
  connect(MBG2Mech1.frame_b, frame_b);
  connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondCon1);
  connect(Se1.MultiBondCon1, MultiBond2.MultiBondCon1);
  connect(J1_1.MultiBondCon2, MultiBond1.MultiBondCon1);
  connect(J1_1.MultiBondCon1, MultiBond2.MultiBondCon2);
  connect(MultiBond3.MultiBondCon1, J1_1.MultiBondCon3);
  
end PotentialFBM;

MultiBondLib.PlanarMechanics.Joints.CloseLoop MultiBondLib.PlanarMechanics.Joints.CloseLoop

element to close kinematik loops manualy

MultiBondLib.PlanarMechanics.Joints.CloseLoop

Information


This is the CloseLoop element.

You can cut a kinematic loop manually with this element . Just insert the element into the loop at the point where you'd like to cut it.

This element connects its two connectors in a non-redundant way. It must not be used outside a kinematik loop.


Connectors

TypeNameDescription
Frame_aframe_a 
Frame_bframe_b 

Modelica definition

model CloseLoop "element to close kinematik loops manualy" 
  Interfaces.Frame_a frame_a;
  Interfaces.Frame_b frame_b;
equation 
  frame_a.P.x = frame_b.P.x;
  frame_a.P.y = frame_b.P.y;
  frame_a.P.phi = frame_b.P.phi;
  frame_a.fx = frame_b.fx;
  frame_a.fy = frame_b.fy;
  frame_a.t = frame_b.t;
  
end CloseLoop;

HTML-documentation generated by Dymola Thu Aug 31 09:47:36 2006.