VehicleDynamics.Utilities.Parts

VehicleDynamics.Utilities.Parts.FrameAxesNoAcceleration VehicleDynamics.Utilities.Parts.Body VehicleDynamics.Utilities.Parts.Shape VehicleDynamics.Utilities.Parts.Inertia3D

NameDescription
FrameAxesNoAcceleration Identical to FrameAxes but acceleration is set to zero
Body Rigid body with visual shape (also used for animation)
Shape Rigid body with visual shape (also used for animation)
Inertia3D 1D-rotational component with inertia taking into account 3D-effects


VehicleDynamics.Utilities.Parts.Body VehicleDynamics.Utilities.Parts.Body

Rigid body with visual shape (also used for animation)

VehicleDynamics.Utilities.Parts.Body

Information

Rigid body with two cuts and an additional shape used in animation.
All the mass and inertia properties must be supplied with respect
to the center of mass. All parameter vectors are resolved in frame_a
in [m].
Parameters:
  r[3]         : Position vector from the origin of frame_a to the origin of
                 frame_b.
  rCM[3]       : Position vector from the origin of frame_a to the center of
                 mass.
  m            : Mass of body in [kg].
  Ixy          : Elements (x,y) of the inertia tensor of the body with respect to
                 the center of mass, resolved in the inertial frame in the home
                 position in [kgm^2]. The following elements can be defined:
                 I11, I22, I33, I21, I31, I32.
                 (Move the inertial from into the center of mass by translation
                 and resolve the inertia tensor in this frame).
  Shape        : Type of visual shape. Predefined shapes are
                   Shape = "box"
                           "sphere"
                           "cylinder"
                           "cone"
                           "pipe"
                           "beam"
                           "gearwheel"
                           "wirebox"
                 External shapes are specified as DXF-files (only 3DFace is supported).
                 External shapes must be named "1", "2"  etc. The corresponding definitions
                 should be in files "1.dxf", "2.dxf" etc.Since the DXF-files contain color
                 and dimensions for the individual faces, the corresponding information
                 in the model is currently ignored, but the specular coefficient is
                 utilized. The DXF-files must be found in the current directory.
  r0[3]        : Position vector from the origin of frame_a to the origin
                 of the visual object.
  LengthDirection[3]: Unit vector in direction of length (will be normalized).
  WidthDirection[3] : Unit vector in direction of width (will be normalized).
  Length       : Length of visual shape in [m].
  Width        : Width of visual shape in [m].
  Height       : Height of visual shape in direction of a vector which is
                 orthogonal to  LengthDirection  and  WidthDirection.
  Material[4]  : = {r, g, b, specular} specifies the color of the shape.
                 [r,g,b] affects the color of diffuse and ambient reflected
                 light. Specular is a coefficient defining white specular
                 reflection. What color that is reflected also depends on the
                 color of the light sources. Note, r g, b and specular are
                 given in the range 0 . 1. Specular=1 gives a metallic appearance.
  Extra        : Additional parameter for cone and pipe.
                 "pipe"     : A hollow cylinder. Extra = InnerRadius/Radius of the cylinder.
                 "gearwheel": A ring with gear wheel teeth. Extra = number of teeth.

Parameters

NameDefaultDescription
masstrueTrue if mass should be considered
animationtrueTrue if part should be animated
r[3]{0.2,0,0}Vector from frame_a to frame_b, resolved in frame_a [m]
rho3.2Density of material [g/cm^3]
shape"box"shape
height0.02height of shape [m]
width0.02width of shape [m]
r0[3]{0,0,0}Vector from frame_a to shape frame, resolved in frame_a [m]
lengthUtilities.Functions.length(r - r0)length of shape [m]
lengthDirection[3]r - r0Vector in direction of cylinder axis, resolved in frame_a [m]
widthDirection[3]{0,0,1}Vector in direction perpendiculare to cylinder axis, resolved in frame_a [m]
material[4]{0.5,0.5,0.5,0.5}Color and specular coefficient
extra1.0Additional parameter
rCM[3]r0 + length/2*Utilities.Functions.normalize(lengthDirection)Vector from frame_a to center of mass, resolved in frame_a [m]
m1000*rho*length*width*heightMass of body [kg] [kg]
I11I[1, 1](1,1) element of inertia tensor [kg.m2]
I22I[2, 2](2,2) element of inertia tensor [kg.m2]
I33I[3, 3](3,3) element of inertia tensor [kg.m2]
I21I[2, 1](2,1) element of inertia tensor [kg.m2]
I31I[3, 1](3,1) element of inertia tensor [kg.m2]
I32I[3, 2](3,2) element of inertia tensor [kg.m2]

Modelica definition

model Body "Rigid body with visual shape (also used for animation)" 
  extends ModelicaAdditions.MultiBody.Interfaces.TwoTreeFrames;
  parameter Boolean mass=true 
    "|Mass and Inertia| |True if mass should be considered";
  parameter Boolean animation=true 
    "|Animation||True if part should be animated";
  
  parameter SI.Position r[3]={0.2,0,0} 
    "|Geometry||Vector from frame_a to frame_b, resolved in frame_a";
  parameter Real rho(min=0) = 3.2 
    "|Mass and Inertia|Default box parameters|Density of material [g/cm^3]";
  
  parameter String shape="box" "|Animation||shape";
  parameter SI.Length height=0.02 "|Animation||height of shape";
  parameter SI.Length width=0.02 "|Animation||width of shape";
  parameter SI.Position r0[3]={0,0,0} 
    "|Animation||Vector from frame_a to shape frame, resolved in frame_a";
  parameter SI.Length length=Utilities.Functions.length(r - r0) 
    "|Animation||length of shape";
  parameter SI.Position lengthDirection[3]=r - r0 
    "|Animation||Vector in direction of cylinder axis, resolved in frame_a";
  parameter SI.Position widthDirection[3]={0,0,1} 
    "|Animation||Vector in direction perpendiculare to cylinder axis, resolved in frame_a";
  parameter Real material[4]={0.5,0.5,0.5,0.5} 
    "|Animation||Color and specular coefficient";
  parameter Real extra=1.0 "|Animation||Additional parameter";
  
  parameter SI.Position rCM[3]=r0 + length/2*Utilities.Functions.normalize(
      lengthDirection) 
    "|Mass and Inertia|General parameters|Vector from frame_a to center of mass, resolved in frame_a";
  parameter SI.Mass m=1000*rho*length*width*height 
    "|Mass and Inertia|General parameters|Mass of body [kg]";
  parameter SI.Inertia I11=I[1, 1] 
    "|Mass and Inertia|General parameters|(1,1) element of inertia tensor";
  parameter SI.Inertia I22=I[2, 2] 
    "|Mass and Inertia|General parameters|(2,2) element of inertia tensor";
  parameter SI.Inertia I33=I[3, 3] 
    "|Mass and Inertia|General parameters|(3,3) element of inertia tensor";
  parameter SI.Inertia I21=I[2, 1] 
    "|Mass and Inertia|General parameters|(2,1) element of inertia tensor";
  parameter SI.Inertia I31=I[3, 1] 
    "|Mass and Inertia|General parameters|(3,1) element of inertia tensor";
  parameter SI.Inertia I32=I[3, 2] 
    "|Mass and Inertia|General parameters|(3,2) element of inertia tensor";
  
protected 
  parameter Real S[3, 3]=Utilities.Functions.from_nxy(lengthDirection, 
      widthDirection);
  parameter SI.Inertia I[3, 3]=S*diagonal({m*(width*width + height*height),m*(length*
      length + height*height),m*(length*length + width*width)}/12)*transpose(S);
  
  
public 
  ModelicaAdditions.MultiBody.Parts.FrameTranslation translation(r=r);
  ModelicaAdditions.MultiBody.Parts.Shape vis[ndimVis](
    each Shape=shape, 
    each r0=r0, 
    each LengthDirection=lengthDirection, 
    each WidthDirection=widthDirection, 
    each Length=length, 
    each Width=width, 
    each Height=height, 
    each Material=material, 
    each Extra=extra);
protected 
  final parameter Integer ndimMass=if mass then 1 else 0;
  final parameter Integer ndimVis=if animation then 1 else 0;
public 
  ModelicaAdditions.MultiBody.Parts.Body body[ndimMass](
    each rCM=rCM, 
    each m=m, 
    each I11=I11, 
    each I22=I22, 
    each I33=I33, 
    each I21=I21, 
    each I31=I31, 
    each I32=I32);
equation 
  
  for i in 1:ndimMass loop
    connect(body[i].frame_a, frame_a);
  end for;
  for i in 1:ndimVis loop
    connect(vis[i].frame_a, frame_a);
  end for;
  connect(frame_a, translation.frame_a);
  connect(frame_b, translation.frame_b);
end Body;

VehicleDynamics.Utilities.Parts.FrameAxesNoAcceleration VehicleDynamics.Utilities.Parts.FrameAxesNoAcceleration

Identical to FrameAxes but acceleration is set to zero

VehicleDynamics.Utilities.Parts.FrameAxesNoAcceleration

Parameters

NameDefaultDescription
r[3]{0,0,0}Vector from frame_a to frame_b resolved in frame_a [m]
nx[3]{1,0,0}x-axis of frame_b resolved in frame_a
ny[3]{0,1,0}y-axis of frame_b resolved in frame_a
label1"x"Label of horizontal axis in icon
label2"y"Label of vertical axis in icon

Modelica definition

model FrameAxesNoAcceleration 
  "Identical to FrameAxes but acceleration is set to zero" 
  import SI = Modelica.SIunits;
  
  ModelicaAdditions.MultiBody.Interfaces.Frame_a frame_a;
  ModelicaAdditions.MultiBody.Interfaces.Frame_b frame_b;
  parameter SI.Position r[3]={0,0,0} 
    "Vector from frame_a to frame_b resolved in frame_a";
  parameter Real nx[3]={1,0,0} "x-axis of frame_b resolved in frame_a";
  parameter Real ny[3]={0,1,0} "y-axis of frame_b resolved in frame_a";
  parameter String label1="x" "Label of horizontal axis in icon";
  parameter String label2="y" "Label of vertical axis in icon";
  final parameter Real nz[3]=cross(nx, ny);
  final parameter Real nnz[3]=nz/sqrt(nz*nz);
  final parameter Real nnx[3]=nx/sqrt(nx*nx);
  final parameter Real nny[3]=cross(nnz, nnx);
  final parameter Real S_rel[3, 3]=transpose([nnx, nny, nnz]) 
    "relative transformation matrix from frame_a to frame_b";
equation 
  frame_b.S = frame_a.S*transpose(S_rel);
  frame_b.r0 = frame_a.r0 + frame_a.S*r;
  frame_b.v = S_rel*(frame_a.v + cross(frame_a.w, r));
  frame_b.w = S_rel*frame_a.w;
  frame_b.a = zeros(3);
  frame_b.z = zeros(3);
  
  /* Transform the force and torque acting at frame_b to frame_a */
  frame_a.f = transpose(S_rel)*(-frame_b.f);
  frame_a.t = transpose(S_rel)*(-frame_b.t) + cross(r, frame_a.f);
end FrameAxesNoAcceleration;

VehicleDynamics.Utilities.Parts.Shape VehicleDynamics.Utilities.Parts.Shape

Rigid body with visual shape (also used for animation)

VehicleDynamics.Utilities.Parts.Shape

Information

Rigid body with two cuts and an additional shape used in animation.
All the mass and inertia properties must be supplied with respect
to the center of mass. All parameter vectors are resolved in frame_a
in [m].
Parameters:
  Shape        : Type of visual shape. Predefined shapes are
                   Shape = "box"
                           "sphere"
                           "cylinder"
                           "cone"
                           "pipe"
                           "beam"
                           "gearwheel"
                           "wirebox"
                 External shapes are specified as DXF-files (only 3DFace is supported).
                 External shapes must be named "1", "2"  etc. The corresponding definitions
                 should be in files "1.dxf", "2.dxf" etc.Since the DXF-files contain color
                 and dimensions for the individual faces, the corresponding information
                 in the model is currently ignored, but the specular coefficient is
                 utilized. The DXF-files must be found in the current directory.
  r0[3]        : Position vector from the origin of frame_a to the origin
                 of the visual object.
  LengthDirection[3]: Unit vector in direction of length (will be normalized).
  WidthDirection[3] : Unit vector in direction of width (will be normalized).
  Length       : Length of visual shape in [m].
  Width        : Width of visual shape in [m].
  Height       : Height of visual shape in direction of a vector which is
                 orthogonal to  LengthDirection  and  WidthDirection.
  Material[4]  : = {r, g, b, specular} specifies the color of the shape.
                 [r,g,b] affects the color of diffuse and ambient reflected
                 light. Specular is a coefficient defining white specular
                 reflection. What color that is reflected also depends on the
                 color of the light sources. Note, r g, b and specular are
                 given in the range 0 . 1. Specular=1 gives a metallic appearance.
  Extra        : Additional parameter for cone and pipe.
                 "pipe"     : A hollow cylinder. Extra = InnerRadius/Radius of the cylinder.
                 "gearwheel": A ring with gear wheel teeth. Extra = number of teeth.

Parameters

NameDefaultDescription
animationtrueTrue if part should be animated
Material[4]{1,0,0,0.5}Color and specular coefficient
shape"box"shape
height0.03height of shape [m]
width0.03width of shape [m]
length0.03length of shape [m]
r0[3]{0,0,0}Vector from frame_a to shape frame, resolved in frame_a [m]
lengthDirection[3]{1,0,0}Vector in direction of cylinder axis, resolved in frame_a [m]
widthDirection[3]{0,0,1}Vector in direction perpendiculare to cylinder axis, resolved in frame_a [m]
material[4]{0.5,0.5,0.5,0.5}Color and specular coefficient
extra1.0Additional parameter

Modelica definition

model Shape "Rigid body with visual shape (also used for animation)" 
  extends ModelicaAdditions.MultiBody.Interfaces.OneFrame_a;
  parameter Boolean animation=true 
    "|Animation||True if part should be animated";
  parameter Real Material[4]={1,0,0,0.5} 
    "|Animation||Color and specular coefficient";
  parameter String shape="box" "|Animation||shape";
  parameter SI.Length height=0.03 "|Animation||height of shape";
  parameter SI.Length width=0.03 "|Animation||width of shape";
  parameter SI.Length length=0.03 "|Animation||length of shape";
  parameter SI.Position r0[3]={0,0,0} 
    "|Animation||Vector from frame_a to shape frame, resolved in frame_a";
  parameter SI.Position lengthDirection[3]={1,0,0} 
    "|Animation||Vector in direction of cylinder axis, resolved in frame_a";
  parameter SI.Position widthDirection[3]={0,0,1} 
    "|Animation||Vector in direction perpendiculare to cylinder axis, resolved in frame_a";
  parameter Real material[4]={0.5,0.5,0.5,0.5} 
    "|Animation||Color and specular coefficient";
  parameter Real extra=1.0 "|Animation||Additional parameter";
  
  
  ModelicaAdditions.MultiBody.Parts.Shape vis[ndimVis](
    each Shape=shape, 
    each r0=r0, 
    each LengthDirection=lengthDirection, 
    each WidthDirection=widthDirection, 
    each Length=length, 
    each Width=width, 
    each Height=height, 
    each Material=material, 
    each Extra=extra);
protected 
  final parameter Integer ndimVis=if animation then 1 else 0;
equation 
  
  for i in 1:ndimVis loop
    connect(vis[i].frame_a, frame_a);
  end for;
end Shape;

VehicleDynamics.Utilities.Parts.Inertia3D VehicleDynamics.Utilities.Parts.Inertia3D

1D-rotational component with inertia taking into account 3D-effects

VehicleDynamics.Utilities.Parts.Inertia3D

Parameters

NameDefaultDescription
J1Moment of inertia [kg.m2]
n[3]{1,0,0}Axle of rotation resolved in bearing_frame
exacttruetrue, if exact calculations; false if influence of bearing acceleration is neglected
startValueFixedfalse 

Modelica definition

model Inertia3D 
  "1D-rotational component with inertia taking into account 3D-effects"
   
  
  import SI = Modelica.SIunits;
  extends Modelica.Mechanics.Rotational.Interfaces.Rigid(phi(fixed=startValueFixed));
  parameter SI.Inertia J=1 "Moment of inertia";
  parameter Real n[3]={1,0,0} "Axle of rotation resolved in bearing_frame";
  parameter Boolean exact=true 
    "true, if exact calculations; false if influence of bearing acceleration is neglected";
  parameter Boolean startValueFixed=false;
  
  SI.AngularVelocity w 
    "Angular velocity of component with respect to bearing_frame";
  SI.AngularAcceleration a 
    "Angular acceleration of component with respect to bearing_frame";
  
protected 
  SI.Inertia nJ[3]=J*n/sqrt(n*n);
public 
  ModelicaAdditions.MultiBody.Interfaces.Frame_a bearing_frame;
equation 
  
  w = der(phi);
  a = der(w);
  
  if exact then
    J*a = flange_a.tau + flange_b.tau - nJ*bearing_frame.z;
  else
    J*a = flange_a.tau + flange_b.tau;
  end if;
  
  // reaction torque in bearing
  bearing_frame.t = nJ*a + cross(bearing_frame.w, nJ)*w;
  bearing_frame.f = zeros(3);
end Inertia3D;

HTML-documentation generated by Dymola Tue Jul 15 13:22:37 2003 .