Modelica.Mechanics.MultiBody.Frames.Internal

Internal definitions that may be removed or changed (do not use)

Information

Extends from Modelica.Icons.Library (Icon for library).

Package Content

NameDescription
TransformationMatrix  
QuaternionBase  
Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent maxWithoutEvent Maximum of the input arguments, without event and without warning message when differentiating
Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent_d maxWithoutEvent_d First derivative of function maxWithoutEvent(..)
Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent_dd maxWithoutEvent_dd First derivative of function maxWithoutEvent_d(..)
Modelica.Mechanics.MultiBody.Frames.Internal.resolve1_der resolve1_der Derivative of function Frames.resolve1(..)
Modelica.Mechanics.MultiBody.Frames.Internal.resolve2_der resolve2_der Derivative of function Frames.resolve2(..)
Modelica.Mechanics.MultiBody.Frames.Internal.resolveRelative_der resolveRelative_der Derivative of function Frames.resolveRelative(..)

Types and constants

  type TransformationMatrix = Real[3, 3];

  type QuaternionBase = Real[4];


Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent

Maximum of the input arguments, without event and without warning message when differentiating

Information


Function maxWithoutEvent returns the maximum of its two input arguments. This functions is used instead of the Modelica built-in function "max" or an if-statement with "noEvent(..)", because Dymola prints a warning message when differentiating in these cases. For the special cases as used in the MultiBody library, these warning messages are irrelevant but will potentially irritate the user. The C-function "maxWithoutEvent" and its derivatives provided as additional functions "maxWithoutEvent_d" and "maxWithoutEvent_dd" will not lead to such warning messages.

Inputs

TypeNameDefaultDescription
Realu1  
Realu2  

Outputs

TypeNameDescription
Realy 

Modelica definition

function maxWithoutEvent 
  "Maximum of the input arguments, without event and without warning message when differentiating"
  annotation(derivative=maxWithoutEvent_d);

  input Real u1;
  input Real u2;
  output Real y;
  //  annotation (Header="#include \"MultiBody.h\"");
protected 
  Integer dummy;
algorithm 
  y := if u1 > u2 then u1 else u2;
  dummy := 0;
end maxWithoutEvent;

Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent_d

First derivative of function maxWithoutEvent(..)

Inputs

TypeNameDefaultDescription
Realu1  
Realu2  
Realu1_d  
Realu2_d  

Outputs

TypeNameDescription
Realy_d 

Modelica definition

function maxWithoutEvent_d 
  "First derivative of function maxWithoutEvent(..)"
  annotation(derivative=maxWithoutEvent_dd);
  input Real u1;
  input Real u2;
  input Real u1_d;
  input Real u2_d;
  output Real y_d;
  //annotation (Header="#include \"MultiBody.h\"");
protected 
  Integer dummy;
algorithm 
  y_d := if u1 > u2 then u1_d else u2_d;
  dummy := 0;
end maxWithoutEvent_d;

Modelica.Mechanics.MultiBody.Frames.Internal.maxWithoutEvent_dd

First derivative of function maxWithoutEvent_d(..)

Inputs

TypeNameDefaultDescription
Realu1  
Realu2  
Realu1_d  
Realu2_d  
Realu1_dd  
Realu2_dd  

Outputs

TypeNameDescription
Realy_dd 

Modelica definition

function maxWithoutEvent_dd 
  "First derivative of function maxWithoutEvent_d(..)"
  input Real u1;
  input Real u2;
  input Real u1_d;
  input Real u2_d;
  input Real u1_dd;
  input Real u2_dd;
  output Real y_dd;
algorithm 
  y_dd := if u1 > u2 then u1_dd else u2_dd;
end maxWithoutEvent_dd;

Modelica.Mechanics.MultiBody.Frames.Internal.resolve1_der Modelica.Mechanics.MultiBody.Frames.Internal.resolve1_der

Derivative of function Frames.resolve1(..)

Information

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
OrientationR Orientation object to rotate frame 1 into frame 2
Realv2[3] Vector resolved in frame 2
Realv2_der[3] = der(v2)

Outputs

TypeNameDescription
Realv1_der[3]Derivative of vector v resolved in frame 1

Modelica definition

function resolve1_der "Derivative of function Frames.resolve1(..)"
  import Modelica.Mechanics.MultiBody.Frames;
  extends Modelica.Icons.Function;
  input Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real v2[3] "Vector resolved in frame 2";
  input Real v2_der[3] "= der(v2)";
  output Real v1_der[3] "Derivative of vector v resolved in frame 1";
algorithm 
  v1_der := Frames.resolve1(R, v2_der + cross(R.w, v2));
end resolve1_der;

Modelica.Mechanics.MultiBody.Frames.Internal.resolve2_der Modelica.Mechanics.MultiBody.Frames.Internal.resolve2_der

Derivative of function Frames.resolve2(..)

Information

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
OrientationR Orientation object to rotate frame 1 into frame 2
Realv1[3] Vector resolved in frame 1
Realv1_der[3] = der(v1)

Outputs

TypeNameDescription
Realv2_der[3]Derivative of vector v resolved in frame 2

Modelica definition

function resolve2_der "Derivative of function Frames.resolve2(..)"
  import Modelica.Mechanics.MultiBody.Frames;
  extends Modelica.Icons.Function;
  input Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real v1[3] "Vector resolved in frame 1";
  input Real v1_der[3] "= der(v1)";
  output Real v2_der[3] "Derivative of vector v resolved in frame 2";
algorithm 
  v2_der := Frames.resolve2(R, v1_der) - cross(R.w, Frames.resolve2(R, v1));
end resolve2_der;

Modelica.Mechanics.MultiBody.Frames.Internal.resolveRelative_der Modelica.Mechanics.MultiBody.Frames.Internal.resolveRelative_der

Derivative of function Frames.resolveRelative(..)

Information

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realv1[3] Vector in frame 1
OrientationR1 Orientation object to rotate frame 0 into frame 1
OrientationR2 Orientation object to rotate frame 0 into frame 2
Realv1_der[3] = der(v1)

Outputs

TypeNameDescription
Realv2_der[3]Derivative of vector v resolved in frame 2

Modelica definition

function resolveRelative_der 
  "Derivative of function Frames.resolveRelative(..)"
  import Modelica.Mechanics.MultiBody.Frames;
  extends Modelica.Icons.Function;
  input Real v1[3] "Vector in frame 1";
  input Orientation R1 "Orientation object to rotate frame 0 into frame 1";
  input Orientation R2 "Orientation object to rotate frame 0 into frame 2";
  input Real v1_der[3] "= der(v1)";
  output Real v2_der[3] "Derivative of vector v resolved in frame 2";
algorithm 
  v2_der := Frames.resolveRelative(v1_der+cross(R1.w,v1), R1, R2)
            - cross(R2.w, Frames.resolveRelative(v1, R1, R2));

  /* skew(w) = T*der(T'), -skew(w) = der(T)*T'

     v2 = T2*(T1'*v1)
     der(v2) = der(T2)*T1'*v1 + T2*der(T1')*v1 + T2*T1'*der(v1)
             = der(T2)*T2'*T2*T1'*v1 + T2*T1'*T1*der(T1')*v1 + T2*T1'*der(v1)
             = -w2 x (T2*T1'*v1) + T2*T1'*(w1 x v1) + T2*T1'*der(v1)
             = T2*T1'*(der(v1) + w1 x v1) - w2 x (T2*T1'*v1)
  */
end resolveRelative_der;

HTML-documentation generated by Dymola Sun Jan 17 21:11:28 2010.