These components are either define a mass and inertia or they define a fixed relationship.
Name | Description |
---|---|
Body | complete body model |
SimpleBody | simple body element |
Fixed | wall element |
FixedRotation | fixed rotational element |
FixedTranslation | fixed translational element (massles rod) |
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 inertia tensor is a symmetric 3x3 matrix and can be specified by the parameters I11, I12, ...
A non-zero value for the parameter GPIndex inserts the body into the gravity pool.
Make sure the integer value is unique and does not exceed the size of the gravity pool.
The parameter animation toggles the visualization
The orientation can either be expressed by the three cardan angles or by quaternions.
Which of these two variants is used, can be specified by the parameter useQuaternions. If cardan angles are chosen to be used, you can specify the sequence of rotation axis by the parameter sequence_angles.
Name | Default | Description |
---|---|---|
animation | true | = true, if animation shall be enabled |
m | 1 | mass of body [kg] |
GPIndex | 0 | Index of element in gravity pool (is zero if element is not in gravity pool) |
Inertia tensor (resolved in center of mass, parallel to frame_a) | ||
I_11 | 0.001 | (1,1) element of inertia tensor [kg.m2] |
I_22 | 0.001 | (2,2) element of inertia tensor [kg.m2] |
I_33 | 0.001 | (3,3) element of inertia tensor [kg.m2] |
I_21 | 0 | (2,1) element of inertia tensor [kg.m2] |
I_31 | 0 | (3,1) element of inertia tensor [kg.m2] |
I_32 | 0 | (3,2) element of inertia tensor [kg.m2] |
Initialization | ||
initType | MB.Types.Init.Free | Type of initialization (defines usage of start values below) |
x_start[3] | {0,0,0} | initial position [m] |
v_start[3] | {0,0,0} | initial velocity [m/s] |
a_start[3] | {0,0,0} | initial acceleration [m/s2] |
phi_start[3] | {0,0,0} | initial cardan angles in degree [deg] |
w_start[3] | {0,0,0} | initial angular velocity in deg/s [deg/s] |
z_start[3] | {0,0,0} | initial angular acceleration in deg/s2 [deg/s2] |
Advanced | ||
enforceStates | false | enforce Quaternions or cardan angles and w as states |
useQuaternions | true | use Quaternions instead of cardan angles |
sequence_angles | {1,2,3} | sequence of the cardan angles |
frame_a | redeclare Interfaces.Frame_a... | replaceable Interface for further extensions |
PotentialFBM1 | redeclare Joints.PotentialFB... | replaceable Interface for further extensions |
Animation | ||
if animation = true | ||
sphereDiameter | world3D.defaultBodyDiameter | Diameter of sphere [m] |
sphereColor | world3D.defaultBodyColor | Color of sphere |
model Body "complete body model" import SI = Modelica.SIunits; import Cv = Modelica.SIunits.Conversions; 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 I_11=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (1,1) element of inertia tensor"; parameter SI.Inertia I_22=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,2) element of inertia tensor"; parameter SI.Inertia I_33=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,3) element of inertia tensor"; parameter SI.Inertia I_21=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,1) element of inertia tensor"; parameter SI.Inertia I_31=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,1) element of inertia tensor"; parameter SI.Inertia I_32=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,2) element of inertia tensor"; final parameter SI.Inertia Inert[3, 3]=[I_11, I_21, I_31; I_21, I_22, I_32; I_31, I_32, I_33] "inertia tensor"; 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[3] = {0,0,0} "|Initialization||initial position"; parameter SI.Velocity v_start[3] = {0,0,0} "|Initialization||initial velocity"; parameter SI.Acceleration a_start[3] = {0,0,0} "|Initialization||initial acceleration"; parameter Cv.NonSIunits.Angle_deg phi_start[3] = {0,0,0} "|Initialization||initial cardan angles in degree"; parameter Types.AngularVelocity_deg w_start[3] = {0,0,0} "|Initialization||initial angular velocity in deg/s"; parameter Types.AngularAcceleration_deg z_start[3] = {0,0,0} "|Initialization||initial angular acceleration in deg/s2"; parameter Boolean enforceStates = false "|Advanced||enforce Quaternions or cardan angles and w as states"; parameter Boolean useQuaternions = true "|Advanced||use Quaternions instead of cardan angles"; parameter Types.RotationSequence sequence_angles = {1,2,3} "|Advanced||sequence of the cardan angles"; parameter SI.Diameter sphereDiameter=world3D.defaultBodyDiameter "|Animation|if animation = true| Diameter of sphere"; parameter MB.Types.Color sphereColor=world3D.defaultBodyColor "|Animation|if animation = true| Color of sphere"; parameter Integer GPIndex = 0 "Index of element in gravity pool (is zero if element is not in gravity pool)"; replaceable Interfaces.Frame_a frame_a "|Advanced||replaceable Interface for further extensions"; SI.Force gF[3]; protected outer World3D world3D; protected inner Defaults MBG_defaults(n=3); replaceable Interfaces.Mech2MBG Mech2MBG1; Junctions.J1 J1_1(n=3); Passive.I I1(n=3, I={m}); Junctions.J1 J1_2(n=3); Passive.IF IF1(n=3, I=Inert); AdditionalMBG.MGY MGY1(I=Inert); Bonds.MultiBond MultiBond7; Bonds.MultiBond MultiBond6; Bonds.MultiBond MultiBond5; Bonds.MultiBond MultiBond1; Bonds.MultiBond MultiBond8; Bonds.MultiBond MultiBond9; Sources.mSe mSe1(n=3); Bonds.Utilities.MultiBondTail MultiBondTail1; Bonds.Utilities.MultiBondTail MultiBondTail2; parameter Integer ndim=if world3D.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.x, each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(3))); public replaceable Joints.PotentialFBM PotentialFBM1( 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, useQuaternions=useQuaternions, sequence_angles=sequence_angles) "|Advanced||replaceable Interface for further extensions"; equation if GPIndex > 0 then world3D.gravityPool.pos[GPIndex,:] = frame_a.P.x; world3D.gravityPool.mass[GPIndex] = m; end if; gF = world3D.gravityPool.gravityForce(GPIndex); mSe1.s = m*world3D.gravityAcceleration(Mech2MBG1.x)+gF; connect(Mech2MBG1.frame_a, frame_a); connect(J1_2.MultiBondCon1, MultiBond5.MultiBondCon2); connect(MultiBond6.MultiBondCon1, J1_2.MultiBondCon3); connect(IF1.MultiBondCon1, MultiBond6.MultiBondCon2); connect(MultiBond8.MultiBondCon1, J1_2.MultiBondCon2); connect(MultiBond8.MultiBondCon2, MGY1.MultiBondCon1); connect(MultiBond9.MultiBondCon1, J1_1.MultiBondCon2); connect(MultiBond9.MultiBondCon2, I1.MultiBondCon1); connect(MultiBond7.MultiBondCon2, J1_1.MultiBondCon1); connect(MultiBond1.MultiBondCon2, J1_1.MultiBondCon3); connect(mSe1.MultiBondCon1, MultiBond1.MultiBondCon1); connect(MultiBond7.MultiBondCon1, Mech2MBG1.MultiBondConTrans); connect(Mech2MBG1.MultiBondConRot, MultiBond5.MultiBondCon1); connect(PotentialFBM1.frame_b, frame_a); end Body;
Different from the standard body model, this model does not contain a potential joint and therefore needs to be connected to a joint or fixation element.
The inertia tensor is a symmetric 3x3 matrix and can be specified by the parameters I11, I12, ...
A non-zero value for the parameter GPIndex inserts the body into the gravity pool.
Make sure the integer value is unique and does not exceed the size of the gravity pool.
The parameter animation toggles the visualization
Name | Default | Description |
---|---|---|
animation | true | = true, if animation shall be enabled |
m | 1 | mass of body [kg] |
GPIndex | 0 | Index of element in gravity pool (is zero if element is not in gravity pool) |
Inertia tensor (resolved in center of mass, parallel to frame_a) | ||
I_11 | 0.001 | (1,1) element of inertia tensor [kg.m2] |
I_22 | 0.001 | (2,2) element of inertia tensor [kg.m2] |
I_33 | 0.001 | (3,3) element of inertia tensor [kg.m2] |
I_21 | 0 | (2,1) element of inertia tensor [kg.m2] |
I_31 | 0 | (3,1) element of inertia tensor [kg.m2] |
I_32 | 0 | (3,2) element of inertia tensor [kg.m2] |
Animation | ||
if animation = true | ||
sphereDiameter | world3D.defaultBodyDiameter | Diameter of sphere [m] |
sphereColor | world3D.defaultBodyColor | Color of sphere |
Advanced | ||
frame_a | redeclare Interfaces.Frame_a... | replaceable Interface for further extensions |
model SimpleBody "simple body element " 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 I_11=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (1,1) element of inertia tensor"; parameter SI.Inertia I_22=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,2) element of inertia tensor"; parameter SI.Inertia I_33=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,3) element of inertia tensor"; parameter SI.Inertia I_21=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,1) element of inertia tensor"; parameter SI.Inertia I_31=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,1) element of inertia tensor"; parameter SI.Inertia I_32=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,2) element of inertia tensor"; final parameter SI.Inertia Inert[3, 3]=[I_11, I_21, I_31; I_21, I_22, I_32; I_31, I_32, I_33] "inertia tensor"; parameter SI.Diameter sphereDiameter=world3D.defaultBodyDiameter "|Animation|if animation = true| Diameter of sphere"; parameter MB.Types.Color sphereColor=world3D.defaultBodyColor "|Animation|if animation = true| Color of sphere"; parameter Integer GPIndex = 0 "Index of element in gravity pool (is zero if element is not in gravity pool)"; replaceable Interfaces.Frame_a frame_a "|Advanced||replaceable Interface for further extensions"; SI.Force gF[3]; protected outer World3D world3D; protected inner Defaults MBG_defaults(n=3); replaceable Interfaces.Mech2MBG Mech2MBG1; Junctions.J1 J1_1(n=3); Passive.I I1(n=3, I={m}); Junctions.J1 J1_2(n=3); Passive.IF IF1(n=3, I=Inert); AdditionalMBG.MGY MGY1(I=Inert); Bonds.MultiBond MultiBond7; Bonds.MultiBond MultiBond6; Bonds.MultiBond MultiBond5; Bonds.MultiBond MultiBond1; Bonds.MultiBond MultiBond8; Bonds.MultiBond MultiBond9; Sources.mSe mSe1(n=3); Bonds.Utilities.MultiBondTail MultiBondTail1; Bonds.Utilities.MultiBondTail MultiBondTail2; parameter Integer ndim=if world3D.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.x, each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(3))); equation if GPIndex > 0 then world3D.gravityPool.pos[GPIndex,:] = frame_a.P.x; world3D.gravityPool.mass[GPIndex] = m; end if; gF = world3D.gravityPool.gravityForce(GPIndex); mSe1.s = m*world3D.gravityAcceleration(Mech2MBG1.x)+gF; connect(Mech2MBG1.frame_a, frame_a); connect(J1_2.MultiBondCon1, MultiBond5.MultiBondCon2); connect(MultiBond6.MultiBondCon1, J1_2.MultiBondCon3); connect(IF1.MultiBondCon1, MultiBond6.MultiBondCon2); connect(MultiBond8.MultiBondCon1, J1_2.MultiBondCon2); connect(MultiBond8.MultiBondCon2, MGY1.MultiBondCon1); connect(MultiBond9.MultiBondCon1, J1_1.MultiBondCon2); connect(MultiBond9.MultiBondCon2, I1.MultiBondCon1); connect(MultiBond7.MultiBondCon2, J1_1.MultiBondCon1); connect(MultiBond1.MultiBondCon2, J1_1.MultiBondCon3); connect(mSe1.MultiBondCon1, MultiBond1.MultiBondCon1); connect(MultiBond7.MultiBondCon1, Mech2MBG1.MultiBondConTrans); connect(Mech2MBG1.MultiBondConRot, MultiBond5.MultiBondCon1); end SimpleBody;
Name | Default | Description |
---|---|---|
r[3] | {0,0,0} | position of frame_b [m] |
Advanced | ||
frame_b | redeclare Interfaces.Frame_b... | replaceable Interface for further extensions |
model Fixed "wall element" import SI = Modelica.SIunits; parameter SI.Position r[3] = {0,0,0} "position of frame_b"; replaceable Interfaces.Frame_b frame_b "|Advanced||replaceable Interface for further extensions"; protected inner Defaults MBG_defaults(n=3); replaceable Interfaces.MBG2Mech MBG2Mech1; Sources.Sf Sf1( f0={0}); Modelica.Blocks.Sources.Constant x0[3](k=r); Modelica.Blocks.Sources.Constant R0[3,3](k=identity(3)); Sources.Sf Sf2( f0={0}); Bonds.MultiBond MultiBond1; Bonds.MultiBond MultiBond2; Bonds.Utilities.MultiBondTail MultiBondTail1; Bonds.Utilities.MultiBondTail MultiBondTail2; equation defineRoot(frame_b.P); connect(MBG2Mech1.frame_b, frame_b); connect(Sf1.MultiBondCon1, MultiBond1.MultiBondCon1); connect(x0.y, MBG2Mech1.x); connect(R0.y, MBG2Mech1.R); connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConTrans); connect(Sf2.MultiBondCon1, MultiBond2.MultiBondCon1); connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConRot); end Fixed;
Name | Default | Description |
---|---|---|
n[3] | {1,0,0} | rotation axis [m] |
angle | 0 | angle [deg] |
Advanced | ||
frame_a | redeclare Interfaces.Frame_a... | replaceable Interface for further extensions |
frame_b | redeclare Interfaces.Frame_b... | replaceable Interface for further extensions |
model FixedRotation "fixed rotational element" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; import Cv = Modelica.SIunits.Conversions; parameter SI.Position n[3] = {1,0,0} "rotation axis"; final parameter Real eN[3] = n/sqrt(n*n) "unit vector pointing along rotation axis"; parameter Cv.NonSIunits.Angle_deg angle=0 "angle"; final parameter SI.Angle phi = Cv.from_deg(angle); replaceable Interfaces.Frame_a frame_a "|Advanced||replaceable Interface for further extensions"; replaceable Interfaces.Frame_b frame_b "|Advanced||replaceable Interface for further extensions"; protected outer World3D world3D; inner Defaults MBG_defaults(n=3); replaceable Interfaces.Mech2MBG Mech2MBG1; replaceable Interfaces.MBG2Mech MBG2Mech1; Utilities.planarRotation planarRotation1(n=eN); Bonds.MultiBond MultiBond3; Bonds.MultiBond MultiBond1; Bonds.MultiBond MultiBond2; Bonds.Utilities.MultiBondTail MultiBondTail1; Bonds.Utilities.MultiBondTail MultiBondTail2; Bonds.Utilities.MultiBondTail MultiBondTail3; AdditionalMBG.mTF mTF1; Modelica.Blocks.Sources.Constant Constant1(k=phi); Utilities.Rotation Rotation1; equation defineBranch(frame_a.P,frame_b.P); if rooted(frame_a.P) then Rotation1.dirForward = true; mTF1.transformFlow = true; else Rotation1.dirForward = false; mTF1.transformFlow = false; end if; connect(MBG2Mech1.frame_b, frame_b); connect(Mech2MBG1.frame_a, frame_a); connect(Mech2MBG1.x, MBG2Mech1.x); connect(planarRotation1.phi, Constant1.y); connect(planarRotation1.Rrel, Rotation1.Rrel); connect(Mech2MBG1.R, Rotation1.R1); connect(Rotation1.R2, MBG2Mech1.R); connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConRot); connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondConRot); connect(MultiBond3.MultiBondCon2, MBG2Mech1.MultiBondConTrans); connect(MultiBond3.MultiBondCon1, Mech2MBG1.MultiBondConTrans); connect(mTF1.MultiBondCon1, MultiBond1.MultiBondCon2); connect(mTF1.MultiBondCon2, MultiBond2.MultiBondCon1); connect(planarRotation1.Rrel, mTF1.M); end FixedRotation;
Name | Default | Description |
---|---|---|
animation | true | = true, if animation shall be enabled |
r[3] | {1,0,0} | translational vector from frame a to b [m] |
Animation | ||
if animation = true | ||
shapeType | "cylinder" | Type of shape |
length | sqrt(r*r) | Length of shape [m] |
width | length/world3D.defaultWidthF... | Width of shape [m] |
height | width | Height of shape. [m] |
extra | 0.0 | Additional parameter depending on shapeType (see docu of Visualizers.Advanced.Shape). |
color | world3D.defaultRodColor | Color of shape |
Advanced | ||
frame_a | redeclare Interfaces.Frame_a... | replaceable Interface for further extensions |
frame_b | redeclare Interfaces.Frame_b... | replaceable Interface for further extensions |
model FixedTranslation "fixed translational element (massles rod)" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; parameter Boolean animation=true "= true, if animation shall be enabled"; parameter SI.Position r[3] = {1,0,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/world3D.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=world3D.defaultRodColor "|Animation|if animation = true| Color of shape"; replaceable Interfaces.Frame_a frame_a "|Advanced||replaceable Interface for further extensions"; replaceable Interfaces.Frame_b frame_b "|Advanced||replaceable Interface for further extensions"; protected outer World3D world3D; inner Defaults MBG_defaults(n=3); replaceable Interfaces.Mech2MBG Mech2MBG1; replaceable Interfaces.MBG2Mech MBG2Mech1; AdditionalMBG.translationalTF translationalTF1(r=r); Junctions.J0 J0_1; Junctions.J1 J1_1; Passive.mTF_effort mTF_effort1; Bonds.MultiBond MultiBond1; Bonds.MultiBond MultiBond2; Bonds.MultiBond MultiBond3; Bonds.MultiBond MultiBond4; Bonds.MultiBond MultiBond5; Bonds.MultiBond MultiBond6; Bonds.MultiBond MultiBond7; Bonds.Utilities.MultiBondTail MultiBondTail1; Bonds.Utilities.MultiBondTail MultiBondTail2; Bonds.Utilities.MultiBondTail MultiBondTail3; Bonds.Utilities.MultiBondTail MultiBondTail4; Utilities.Translation Translation1(r=r); parameter Integer ndim=if world3D.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, each widthDirection={0,0,1}, each r_shape={0,0,0}, each r=Mech2MBG1.x, each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(3))); equation defineBranch(frame_a.P,frame_b.P); connect(MBG2Mech1.frame_b, frame_b); connect(Mech2MBG1.frame_a, frame_a); connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans); connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondConTrans); connect(MultiBond3.MultiBondCon1, Mech2MBG1.MultiBondConRot); connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConRot); connect(Mech2MBG1.R, MBG2Mech1.R); connect(Mech2MBG1.x, Translation1.x1); connect(Mech2MBG1.R, Translation1.R); connect(J0_1.MultiBondCon2, MultiBond2.MultiBondCon1); connect(MBG2Mech1.x, Translation1.x2); connect(MultiBond1.MultiBondCon2, J0_1.MultiBondCon1); connect(mTF_effort1.MultiBondCon2, MultiBond5.MultiBondCon2); connect(mTF_effort1.MultiBondCon1, MultiBond7.MultiBondCon1); connect(mTF_effort1.M, Mech2MBG1.R); connect(translationalTF1.MultiBondCon2, MultiBond5.MultiBondCon1); connect(translationalTF1.MultiBondCon1, MultiBond6.MultiBondCon2); connect(MultiBond6.MultiBondCon1, J1_1.MultiBondCon4); connect(MultiBond7.MultiBondCon2, J0_1.MultiBondCon3); connect(J1_1.MultiBondCon1, MultiBond3.MultiBondCon2); connect(J1_1.MultiBondCon2, MultiBond4.MultiBondCon1); end FixedTranslation;