These components either define a mass and inertia or they define a fixed relationship.
| Name | Description |
|---|---|
| comlete body model | |
| body element with mass and inertia | |
| wall element | |
| translational element |
MultiBondLib.PlanarMechanics.Parts.Body
If the body model is not connected to any joint, its movement is defined to be free. Therefore this model includes a potential free-body movement joint and in consequences shares certain joint characterisitcs.
The parameter animation toggles the visualization
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | animation | true | = true, if animation shall be enabled |
| Mass | m | 1 | Mass of body [kg] |
| Inertia | J | 1 | Inertia of body [kg.m2] |
| Initialization | |||
| Temp | initType | MB.Types.Init.Free | Type of initialization (defines usage of start values below) |
| Position | x_start[2] | {0,0} | initial position (x,y) [m] |
| Velocity | v_start[2] | {0,0} | initial velocity (vx, vy) [m/s] |
| Acceleration | a_start[2] | {0,0} | initial acceleration (ax, ay) [m/s2] |
| Angle | phi_start | 0 | initial angle [rad] |
| AngularVelocity | w_start | 0 | initial ang. velocity [rad/s] |
| AngularAcceleration | z_start | 0 | initial ang. acc. [rad/s2] |
| Animation | |||
| if animation = true | |||
| Diameter | sphereDiameter | planarWorld.defaultBodyDiame... | Diameter of sphere [m] |
| Color | sphereColor[3] | planarWorld.defaultBodyColor | Color of sphere |
| Advanced | |||
| Boolean | enforceStates | false | enforce x,y,phi and vx, vy, w as states |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a |
model Body "comlete body model"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
parameter Boolean animation=true "= true, if animation shall be enabled";
parameter SI.Mass m = 1 "Mass of body";
parameter SI.Inertia J = 1 "Inertia of body";
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 SI.Diameter sphereDiameter=planarWorld.defaultBodyDiameter
"|Animation|if animation = true| Diameter of sphere";
parameter MB.Types.Color sphereColor=planarWorld.defaultBodyColor
"|Animation|if animation = true| Color of sphere";
parameter Boolean enforceStates = false
"|Advanced||enforce x,y,phi and vx, vy, w as states";
Interfaces.Frame_a frame_a;
protected
SI.Force fz "dummy force in z-direction";
Interfaces.Mech2MBG Mech2MBG1;
Junctions.J1 J1_1;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond3;
Passive.I mass(I={m,m,J});
protected
outer PlanarWorld planarWorld;
protected
inner Defaults MBG_defaults(n=3);
parameter Integer ndim=if planarWorld.enableAnimation and animation then 1 else 0;
MB.Visualizers.Advanced.Shape sphere[ndim](
each shapeType="sphere",
each color=sphereColor,
each length=sphereDiameter,
each width=sphereDiameter,
each height=sphereDiameter,
each lengthDirection={1,0,0},
each widthDirection={0,1,0},
each r_shape=-{1,0,0}*sphereDiameter/2,
each r={Mech2MBG1.q[1],Mech2MBG1.q[2],0},
each R=MB.Frames.planarRotation({0,0,-1},Mech2MBG1.q[3],0));
Sources.mSe mSe1;
public
Joints.PotentialFBM PotFBM(
initType=initType,
x_start=x_start,
v_start=v_start,
a_start=a_start,
phi_start=phi_start,
w_start=w_start,
z_start=z_start,
enforceStates=enforceStates);
equation
{mSe1.s[1],mSe1.s[2],fz} = m*planarWorld.gravityAcceleration({Mech2MBG1.q[1],Mech2MBG1.q[2],0});
mSe1.s[3] = 0;
connect(Mech2MBG1.frame_a, frame_a);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondCon1);
connect(MultiBond1.MultiBondCon2, J1_1.MultiBondCon1);
connect(MultiBond3.MultiBondCon2, J1_1.MultiBondCon2);
connect(MultiBond2.MultiBondCon1, J1_1.MultiBondCon4);
connect(mass.MultiBondCon1, MultiBond2.MultiBondCon2);
connect(mSe1.MultiBondCon1, MultiBond3.MultiBondCon1);
connect(PotFBM.frame_b, frame_a);
end Body;
MultiBondLib.PlanarMechanics.Parts.SimpleBody
This model does not contain a potential joint and therefore needs to be connected to a joint or fixation element.
The parameter animation toggles the visualization
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | animation | true | = true, if animation shall be enabled |
| Mass | m | 1 | Mass of body [kg] |
| Inertia | J | 1 | Inertia of body [kg.m2] |
| Animation | |||
| if animation = true | |||
| Diameter | sphereDiameter | planarWorld.defaultBodyDiame... | Diameter of sphere [m] |
| Color | sphereColor[3] | planarWorld.defaultBodyColor | Color of sphere |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a |
model SimpleBody "body element with mass and inertia"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
parameter Boolean animation=true "= true, if animation shall be enabled";
parameter SI.Mass m = 1 "Mass of body";
parameter SI.Inertia J = 1 "Inertia of body";
parameter SI.Diameter sphereDiameter=planarWorld.defaultBodyDiameter
"|Animation|if animation = true| Diameter of sphere";
parameter MB.Types.Color sphereColor=planarWorld.defaultBodyColor
"|Animation|if animation = true| Color of sphere";
Interfaces.Frame_a frame_a;
protected
SI.Force fz "dummy force in z-direction";
Interfaces.Mech2MBG Mech2MBG1;
Junctions.J1 J1_1;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond3;
Passive.I I1( I={m,m,J});
protected
outer PlanarWorld planarWorld;
protected
inner Defaults MBG_defaults(n=3);
parameter Integer ndim=if planarWorld.enableAnimation and animation then 1 else 0;
MB.Visualizers.Advanced.Shape sphere[ndim](
each shapeType="sphere",
each color=sphereColor,
each length=sphereDiameter,
each width=sphereDiameter,
each height=sphereDiameter,
each lengthDirection={1,0,0},
each widthDirection={0,1,0},
each r_shape=-{1,0,0}*sphereDiameter/2,
each r={Mech2MBG1.q[1],Mech2MBG1.q[2],0},
each R=MB.Frames.planarRotation({0,0,-1},Mech2MBG1.q[3],0));
Sources.mSe mSe1;
equation
{mSe1.s[1],mSe1.s[2],fz} = m*planarWorld.gravityAcceleration({Mech2MBG1.q[1],Mech2MBG1.q[2],0});
mSe1.s[3] = 0;
connect(Mech2MBG1.frame_a, frame_a);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondCon1);
connect(MultiBond1.MultiBondCon2, J1_1.MultiBondCon1);
connect(MultiBond3.MultiBondCon2, J1_1.MultiBondCon2);
connect(MultiBond2.MultiBondCon1, J1_1.MultiBondCon4);
connect(I1.MultiBondCon1, MultiBond2.MultiBondCon2);
connect(mSe1.MultiBondCon1, MultiBond3.MultiBondCon1);
end SimpleBody;
MultiBondLib.PlanarMechanics.Parts.Fixed
| Type | Name | Default | Description |
|---|---|---|---|
| Position | r[2] | {0,0} | Position [m] |
| Angle | phi | 0 | Angle [rad] |
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b |
model Fixed "wall element"
import SI = Modelica.SIunits;
parameter SI.Position r[2] = {0,0} "Position";
parameter SI.Angle phi = 0 "Angle";
protected
inner Defaults MBG_defaults(n=3);
protected
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Sf Sf1(n=3, f0={0});
Modelica.Blocks.Sources.Constant ConstantFixed[3](k={r[1],r[2],phi});
public
Interfaces.Frame_b frame_b;
equation
defineRoot(frame_b.P);
connect(MBG2Mech1.frame_b, frame_b);
connect(ConstantFixed.y, MBG2Mech1.q);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondCon1);
connect(Sf1.MultiBondCon1, MultiBond1.MultiBondCon1);
end Fixed;
MultiBondLib.PlanarMechanics.Parts.FixedTranslation
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | animation | true | = true, if animation shall be enabled |
| Position | r[2] | {1,0} | translational vector from frame a to b [m] |
| Animation | |||
| if animation = true | |||
| ShapeType | shapeType | "cylinder" | Type of shape |
| Length | length | sqrt(r*r) | Length of shape [m] |
| Distance | width | length/planarWorld.defaultWi... | Width of shape [m] |
| Distance | height | width | Height of shape. [m] |
| Real | extra | 0.0 | Additional parameter depending on shapeType (see docu of Visualizers.Advanced.Shape). |
| Color | color[3] | planarWorld.defaultRodColor | Color of shape |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a | |
| Frame_b | frame_b |
model FixedTranslation "translational element"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
parameter Boolean animation=true "= true, if animation shall be enabled";
parameter SI.Position r[2] = {1,0} "translational vector from frame a to b";
parameter Modelica.Mechanics.MultiBody.Types.ShapeType shapeType="cylinder"
"|Animation|if animation = true| Type of shape";
parameter SI.Length length=sqrt(r*r)
"|Animation|if animation = true| Length of shape";
parameter SI.Distance width=length/planarWorld.defaultWidthFraction
"|Animation|if animation = true| Width of shape";
parameter SI.Distance height=width
"|Animation|if animation = true| Height of shape.";
parameter Real extra=0.0
"|Animation|if animation = true| Additional parameter depending on shapeType (see docu of Visualizers.Advanced.Shape).";
parameter Modelica.Mechanics.MultiBody.Types.Color color=planarWorld.defaultRodColor
"|Animation|if animation = true| Color of shape";
Interfaces.Frame_a frame_a;
Interfaces.Frame_b frame_b;
protected
outer PlanarWorld planarWorld;
Interfaces.Mech2MBG Mech2MBG1;
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.Utilities.MultiBondTail MultiBondTail1;
AdditionalMBG.Translation TranslationFixed(d=r);
AdditionalMBG.translationalTF translationalTF1(d=r);
parameter Integer ndim=if planarWorld.enableAnimation and animation then 1 else 0;
MB.Visualizers.Advanced.Shape rod[ndim](
each shapeType="cylinder",
each color=color,
each length=length,
each width=width,
each height=height,
each lengthDirection={r[1],r[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));
inner Defaults MBG_defaults(n=3);
equation
defineBranch(frame_a.P, frame_b.P);
connect(MBG2Mech1.frame_b, frame_b);
connect(Mech2MBG1.frame_a, frame_a);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondCon1);
connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondCon1);
connect(Mech2MBG1.q, TranslationFixed.q1);
connect(TranslationFixed.q2, MBG2Mech1.q);
connect(translationalTF1.MultiBondCon1, MultiBond1.MultiBondCon2);
connect(translationalTF1.MultiBondCon2, MultiBond2.MultiBondCon1);
connect(translationalTF1.phi, Mech2MBG1.q[3]);
end FixedTranslation;