MultiBondLib.Mechanics3DwithImpulses

A library of hybrid 3D-mechanical models.

MultiBondLib.Mechanics3DwithImpulses.World3D MultiBondLib.Mechanics3DwithImpulses.CollisionPool MultiBondLib.Mechanics3DwithImpulses.Interfaces MultiBondLib.Mechanics3DwithImpulses.Contacts MultiBondLib.Mechanics3DwithImpulses.Forces MultiBondLib.Mechanics3DwithImpulses.Joints MultiBondLib.Mechanics3DwithImpulses.Parts MultiBondLib.Mechanics3DwithImpulses.Examples

Information


  This is an extension of the package Mechanics3D. 
  The continuous models are extended to hybrid models, that describe the behaviour of in situaions of continuous changement and in situations of sudden (impulse) changement.
The extension of the underlying continuous models is done by equations.

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:

Tutorial

The modeling of the actual mechanical systems doesn't differ from the Mechanics3D library.

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.

Extension of the continuous models

The existing continuous models of the Mechanics3D library are extended by their corresponding impulse equations. The necessary equations are added in textual form. The continuous models remain unchanged.

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.

Kinematic Loops

Impacts on kinematic loops cause no severe problems. Only the loop needs to be closed manually by a special CloseLoop elements of the package ?Joints?. The CloseLoop element is an extension of the manual loop closer of the Mechanics3D library. It is needed, because a further loop needs to be cut: the one of the boolean contact signal.

Efficency

The efficiency of the continuous models is not impaired in any way.

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.

Examples

A small set of examples demonstrate the usage of the Mechanics3DwithImpulses library. They offer a good starting point to make yourself familiar with this library.

NameDescription
World3D world element of the 3D-mechanicsWorld coordinate system + gravity field + default animation definition
CollisionPool collision pool
Interfaces connector elements
Contacts contact models
Forces force elements
Joints joint elements
Parts Parts
Examples Examples


MultiBondLib.Mechanics3DwithImpulses.World3D MultiBondLib.Mechanics3DwithImpulses.World3D

world element of the 3D-mechanicsWorld coordinate system + gravity field + default animation definition

MultiBondLib.Mechanics3DwithImpulses.World3D

Information


This is the World3D model. 
This model is an extended copy of the Modelica.Mechanics.MultiBody.World model.

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.


Parameters

NameDefaultDescription
enableAnimationtrue= true, if animation of all components is enabled
animateWorldtrue= true, if world coordinate system shall be visualized
animateGravitytrue= true, if gravity field shall be visualized (acceleration vector or field center)
label1"x"Label of horizontal axis in icon
label2"y"Label of vertical axis in icon
gravityTypeModelica.Mechanics.MultiBody...Type of gravity field
g9.81 Constant gravity acceleration [m/s2]
n{0,-1,0} Direction of gravity resolved in world frame (gravity = g*n/length(n))
mue3.986e14 Gravity field constant (default = field constant of earth) [m3/s2]
gravityPoolSize0size of gravity pool
Animation
if animateWorld = true
axisLengthnominalLength/2 Length of world axes arrows [m]
axisDiameteraxisLength/defaultFrameDiame... Diameter of world axes arrows [m]
axisShowLabelstrue = true, if labels shall be shown
axisColor_xModelica.Mechanics.MultiBody... Color of x-arrow
axisColor_yaxisColor_x Color of y-arrow
axisColor_zaxisColor_x Color of z-arrow
if animateGravity = true and gravityType = UniformGravity
gravityArrowTail[3]{0,0,0} Position vector from origin of world frame to arrow tail, resolved in world frame [m]
gravityArrowLengthaxisLength/2 Length of gravity arrow [m]
gravityArrowDiametergravityArrowLength/defaultWi... Diameter of gravity arrow [m]
gravityArrowColor{0,230,0} Color of gravity arrow
if animateGravity = true and gravityType = PointGravity
gravitySphereDiameter12742000 Diameter of sphere representing gravity center (default = mean diameter of earth) [m]
gravitySphereColor{0,230,0} Color of gravity sphere
Defaults
nominalLength1 "Nominal" length of multi-body system [m]
defaultAxisLengthnominalLength/5 Default for length of a frame axis (but not world frame) [m]
defaultJointLengthnominalLength/10 Default for the fixed length of a shape representing a joint [m]
defaultJointWidthnominalLength/20 Default for the fixed width of a shape representing a joint [m]
defaultForceLengthnominalLength/10 Default for the fixed length of a shape representing a force (e.g. damper) [m]
defaultForceWidthnominalLength/20 Default for the fixed width of a shape represening a force (e.g. spring, bushing) [m]
defaultBodyDiameternominalLength/9 Default for diameter of sphere representing the center of mass of a body [m]
defaultWidthFraction20 Default for shape width as a fraction of shape length (e.g., for Parts.FixedTranslation)
defaultArrowDiameternominalLength/40 Default for arrow diameter (e.g., of forces, torques, sensors) [m]
defaultFrameDiameterFraction40 Default for arrow diameter of a coordinate system as a fraction of axis length
defaultJointColor{255,0,255} Default color of a joint element
defaultBodyColor{0,64,255} Default color of a body element
defaultRodColor{96,128,128} Default color of a rod element
defaultForceElementColor{0,64,255} Default color of a rod element

Modelica definition

model World3D 
  "world element of the 3D-mechanicsWorld coordinate system + gravity field + default animation definition" 
               extends Mechanics3D.World3D;
  
  
end World3D;

MultiBondLib.Mechanics3DwithImpulses.CollisionPool MultiBondLib.Mechanics3DwithImpulses.CollisionPool

collision pool

Information


This is the model of the collision pool.

The collision pool contains a finite set of spherical bodies and models all possible mutual collisions between them.

Usage

To use the the collision pool, set the parameter collisionPoolSize 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 collsionPoolSize. The index number can be set by the parameter CPindex of the body element. The contact signal needs to be the propagated to the mechanical system by the "InsertImpulse" element.

Important note

Exactly one instance of model CollisionPool needs to be present in every model on the top level. The basic declaration needs to be:

    inner Mechanics3DwithImpulses.CollisionPool collisionPool

Parameters

NameDefaultDescription
poolSize0 

Modelica definition

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;

HTML-documentation generated by Dymola Thu Feb 23 12:19:32 2006.