Name | Description |
---|---|
TransformationMatrix | |
QuaternionBase | |
maxWithoutEvent | Maximum of the input arguments, without event and without warning message when differentiating |
maxWithoutEvent_d | First derivative of function maxWithoutEvent(..) |
maxWithoutEvent_dd | First derivative of function maxWithoutEvent_d(..) |
resolve1_der | Derivative of function Frames.resolve1(..) |
resolve2_der | Derivative of function Frames.resolve2(..) |
resolveRelative_der | Derivative of function Frames.resolveRelative(..) |
type TransformationMatrix = Real[3, 3];
type QuaternionBase = Real[4];
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.
Type | Name | Default | Description |
---|---|---|---|
Real | u1 | ||
Real | u2 |
Type | Name | Description |
---|---|---|
Real | y |
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;
Type | Name | Default | Description |
---|---|---|---|
Real | u1 | ||
Real | u2 | ||
Real | u1_d | ||
Real | u2_d |
Type | Name | Description |
---|---|---|
Real | y_d |
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;
Type | Name | Default | Description |
---|---|---|---|
Real | u1 | ||
Real | u2 | ||
Real | u1_d | ||
Real | u2_d | ||
Real | u1_dd | ||
Real | u2_dd |
Type | Name | Description |
---|---|---|
Real | y_dd |
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;
Type | Name | Default | Description |
---|---|---|---|
Orientation | R | Orientation object to rotate frame 1 into frame 2 | |
Real | v2[3] | Vector resolved in frame 2 | |
Real | v2_der[3] | = der(v2) |
Type | Name | Description |
---|---|---|
Real | v1_der[3] | Derivative of vector v resolved in frame 1 |
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;
Type | Name | Default | Description |
---|---|---|---|
Orientation | R | Orientation object to rotate frame 1 into frame 2 | |
Real | v1[3] | Vector resolved in frame 1 | |
Real | v1_der[3] | = der(v1) |
Type | Name | Description |
---|---|---|
Real | v2_der[3] | Derivative of vector v resolved in frame 2 |
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;
Type | Name | Default | Description |
---|---|---|---|
Real | v1[3] | Vector in frame 1 | |
Orientation | R1 | Orientation object to rotate frame 0 into frame 1 | |
Orientation | R2 | Orientation object to rotate frame 0 into frame 2 | |
Real | v1_der[3] | = der(v1) |
Type | Name | Description |
---|---|---|
Real | v2_der[3] | Derivative of vector v resolved in frame 2 |
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;