The library is used to create models of mechanical systems that underly hard collisions and impacts. Again, mechanical systems can be composed out of single ideal elements. They are seperated as in Mechanics3D into packages for:
A contact model needs to be applied to model an hard impact between two mechanical systems. The contact model generates additionally a contact signal that needs to be manually connected to both colliding systmes. This is done via the "InsertImpulse" element of the subpackage "interfaces".
If a system underlies several possible impacts, the corresponding contact signals have to be merged by a boolean "or" function.
Please, don't forget to take a look at the examples.
To afford such an extension of the continuous models, it is necessary to redeclare the existing connectors. The new connectors are an extended variant of the old ones. The new connector contains also boolean variable that is the contact signals. This signal is set to true at the time of a force impulse and is transmitted between all rigid connections.
The efficiency of the computation at an discrete event is sufficient but could be better. However, the resulting systems of linear equations are solved accurately and robustly.
Name | Description |
---|---|
![]() | world element of the 3D-mechanicsWorld coordinate system + gravity field + default animation definition |
![]() | collision pool |
![]() | connector elements |
![]() | contact models |
![]() | force elements |
![]() | joint elements |
![]() | Parts |
![]() | Examples |
This world model serves several purposes:
Since the gravity field function is required from all bodies with mass and the default settings of animation properties are required from nearly every component, exactly one instance of model World3D needs to be present in every model on the top level. The basic declaration needs to be:
inner Mechanics3D.World3D world3D
Note, it must be an inner declaration with instance name world3D in order that this world object can be accessed from all objects in the model. When dragging the "World3D" object from the package browser into the diagram layer, this declaration is automatically generated (this is defined via annotations in model World).
To use the the gravity pool, set the parameter gravityPoolSize to the number of bodies you'd like to have in your pool. Then give each body in the pool a different index number from 1 to gravityPoolSize. The index number can be set by the parameter GPindex of the body element.
Type | Name | Default | Description |
---|---|---|---|
Boolean | enableAnimation | true | = true, if animation of all components is enabled |
Boolean | animateWorld | true | = true, if world coordinate system shall be visualized |
Boolean | animateGravity | true | = true, if gravity field shall be visualized (acceleration vector or field center) |
AxisLabel | label1 | "x" | Label of horizontal axis in icon |
AxisLabel | label2 | "y" | Label of vertical axis in icon |
Temp | gravityType | Modelica.Mechanics.MultiBody... | Type of gravity field |
Acceleration | g | 9.81 | Constant gravity acceleration [m/s2] |
Axis | n[3] | {0,-1,0} | Direction of gravity resolved in world frame (gravity = g*n/length(n)) |
Real | mue | 3.986e14 | Gravity field constant (default = field constant of earth) [m3/s2] |
Integer | gravityPoolSize | 0 | size of gravity pool |
Animation | |||
if animateWorld = true | |||
Distance | axisLength | nominalLength/2 | Length of world axes arrows [m] |
Distance | axisDiameter | axisLength/defaultFrameDiame... | Diameter of world axes arrows [m] |
Boolean | axisShowLabels | true | = true, if labels shall be shown |
Color | axisColor_x[3] | Modelica.Mechanics.MultiBody... | Color of x-arrow |
Color | axisColor_y[3] | axisColor_x | Color of y-arrow |
Color | axisColor_z[3] | axisColor_x | Color of z-arrow |
if animateGravity = true and gravityType = UniformGravity | |||
Position | gravityArrowTail[3] | {0,0,0} | Position vector from origin of world frame to arrow tail, resolved in world frame [m] |
Length | gravityArrowLength | axisLength/2 | Length of gravity arrow [m] |
Diameter | gravityArrowDiameter | gravityArrowLength/defaultWi... | Diameter of gravity arrow [m] |
Color | gravityArrowColor[3] | {0,230,0} | Color of gravity arrow |
if animateGravity = true and gravityType = PointGravity | |||
Diameter | gravitySphereDiameter | 12742000 | Diameter of sphere representing gravity center (default = mean diameter of earth) [m] |
Color | gravitySphereColor[3] | {0,230,0} | Color of gravity sphere |
Defaults | |||
Length | nominalLength | 1 | "Nominal" length of multi-body system [m] |
Length | defaultAxisLength | nominalLength/5 | Default for length of a frame axis (but not world frame) [m] |
Length | defaultJointLength | nominalLength/10 | Default for the fixed length of a shape representing a joint [m] |
Length | defaultJointWidth | nominalLength/20 | Default for the fixed width of a shape representing a joint [m] |
Length | defaultForceLength | nominalLength/10 | Default for the fixed length of a shape representing a force (e.g. damper) [m] |
Length | defaultForceWidth | nominalLength/20 | Default for the fixed width of a shape represening a force (e.g. spring, bushing) [m] |
Length | defaultBodyDiameter | nominalLength/9 | Default for diameter of sphere representing the center of mass of a body [m] |
Real | defaultWidthFraction | 20 | Default for shape width as a fraction of shape length (e.g., for Parts.FixedTranslation) |
Length | defaultArrowDiameter | nominalLength/40 | Default for arrow diameter (e.g., of forces, torques, sensors) [m] |
Real | defaultFrameDiameterFraction | 40 | Default for arrow diameter of a coordinate system as a fraction of axis length |
Color | defaultJointColor[3] | {255,0,255} | Default color of a joint element |
Color | defaultBodyColor[3] | {0,64,255} | Default color of a body element |
Color | defaultRodColor[3] | {96,128,128} | Default color of a rod element |
Color | defaultForceElementColor[3] | {0,64,255} | Default color of a rod element |
model World3D "world element of the 3D-mechanicsWorld coordinate system + gravity field + default animation definition" extends Mechanics3D.World3D; end World3D;
The collision pool contains a finite set of spherical bodies and models all possible mutual collisions between them.
inner Mechanics3DwithImpulses.CollisionPool collisionPool
Type | Name | Default | Description |
---|---|---|---|
Integer | poolSize | 0 |
Type | Name | Description |
---|---|---|
IFrame | frames[poolSize] | |
output BooleanOutput | y[poolSize, poolSize] |
model CollisionPool "collision pool" import SI = Modelica.SIunits; parameter Integer poolSize = 0; final parameter Integer collisionCount = integer(poolSize*(poolSize-1)/2); Interfaces.IFrame frames[poolSize]; Modelica.Blocks.Interfaces.BooleanOutput[poolSize,poolSize] y; // Types.CollisionObject COs[poolSize]; Contacts.CollisionSphereSphere Collisions[collisionCount]( each ra=0.1, each rb=0.1, each elasticity = 1.0, each muR = 0.0); protected function collisionIndex input Integer a; input Integer b; input Integer n; output Integer ind; algorithm ind := (b-1) + integer( ((n-1)*(n-2) - (n-1-a)*(n-a))/2); end collisionIndex; equation for i in 1:poolSize loop for i2 in (i+1):poolSize loop connect(Collisions[collisionIndex(i,i2,poolSize)].frame_a,frames[i]); connect(Collisions[collisionIndex(i,i2,poolSize)].frame_b,frames[i2]); y[i,i2] = Collisions[collisionIndex(i,i2,poolSize)].y; y[i2,i] = Collisions[collisionIndex(i,i2,poolSize)].y; end for; y[i,i] = false; end for; end CollisionPool;