Skip to content

Failed

tests / testsuite-gcc / flattening_modelica_scoping.InnerOuterSamePrefix.mo (from (result.xml))

Failing for the past 3 builds (Since #1 )
Took 1 sec.

Stacktrace

Output mismatch (see stdout for details)

Standard Output

 + InnerOuterSamePrefix.mo [BUG: #2650]                                              ... equation mismatch [time: 1]

==== Log /tmp/omc-rtest-unknown/flattening/modelica/scoping/InnerOuterSamePrefix.mo_temp5589/log-InnerOuterSamePrefix.mo
function Modelica.Math.Vectors.length "Inline before index reduction" "Return length of a vector (better as norm(), if further symbolic processing is performed)"
  input Real[:] v "Vector";
  output Real result "Length of vector v";
algorithm
  result := sqrt(v * v);
end Modelica.Math.Vectors.length;

function Modelica.Math.Vectors.normalize "Inline before index reduction" "Return normalized vector such that length = 1 and prevent zero-division for zero vector"
  input Real[:] v "Vector";
  input Real eps(min = 0.0) = 1e-13 "if |v| < eps then result = v/eps";
  output Real[size(v, 1)] result "Input vector v normalized to length=1";
algorithm
  result := smooth(0, if noEvent(Modelica.Math.Vectors.length(v) >= eps) then v / Modelica.Math.Vectors.length(v) else v / eps);
end Modelica.Math.Vectors.normalize;

function Modelica.Math.Vectors.normalizeWithAssert "Inline before index reduction" "Return normalized vector such that length = 1 (trigger an assert for zero vector)"
  input Real[:] v "Vector";
  output Real[size(v, 1)] result "Input vector v normalized to length=1";
algorithm
  assert(Modelica.Math.Vectors.length(v) > 0.0, "Vector v={0,0,0} shall be normalized (= v/sqrt(v*v)), but this results in a division by zero.
  Provide a non-zero vector!");
  result := v / Modelica.Math.Vectors.length(v);
end Modelica.Math.Vectors.normalizeWithAssert;

function Modelica.Mechanics.MultiBody.Frames.Internal.resolve1_der "Inline before index reduction" "Derivative of function Frames.resolve1(..)"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real[3] v2 "Vector resolved in frame 2";
  input Real[3] v2_der "= der(v2)";
  output Real[3] v1_der "Derivative of vector v resolved in frame 1";
algorithm
  v1_der := Modelica.Mechanics.MultiBody.Frames.resolve1(R, {v2_der[1] + R.w[2] * v2[3] - R.w[3] * v2[2], v2_der[2] + R.w[3] * v2[1] - R.w[1] * v2[3], v2_der[3] + R.w[1] * v2[2] - R.w[2] * v2[1]});
end Modelica.Mechanics.MultiBody.Frames.Internal.resolve1_der;

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

function Modelica.Mechanics.MultiBody.Frames.Orientation "Automatically generated record constructor for Modelica.Mechanics.MultiBody.Frames.Orientation"
  input Real[3, 3] T;
  input Real[3] w(quantity = "AngularVelocity", unit = "rad/s");
  output Orientation res;
end Modelica.Mechanics.MultiBody.Frames.Orientation;

function Modelica.Mechanics.MultiBody.Frames.Orientation.equalityConstraint "Inline before index reduction" "Return the constraint residues to express that two frames have the same orientation"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R1 "Orientation object to rotate frame 0 into frame 1";
  input Modelica.Mechanics.MultiBody.Frames.Orientation R2 "Orientation object to rotate frame 0 into frame 2";
  output Real[3] residue "The rotation angles around x-, y-, and z-axis of frame 1 to rotate frame 1 into frame 2 for a small rotation (should be zero)";
algorithm
  residue := {atan2((R1.T[1,2] * R1.T[2,3] - R1.T[1,3] * R1.T[2,2]) * R2.T[2,1] + (R1.T[1,3] * R1.T[2,1] - R1.T[1,1] * R1.T[2,3]) * R2.T[2,2] + (R1.T[1,1] * R1.T[2,2] - R1.T[1,2] * R1.T[2,1]) * R2.T[2,3], R1.T[1,1] * R2.T[1,1] + R1.T[1,2] * R2.T[1,2] + R1.T[1,3] * R2.T[1,3]), atan2((R1.T[1,1] * R1.T[2,3] - R1.T[1,3] * R1.T[2,1]) * R2.T[1,2] - (R1.T[1,1] * R1.T[2,2] - R1.T[1,2] * R1.T[2,1]) * R2.T[1,3] - (R1.T[1,2] * R1.T[2,3] - R1.T[1,3] * R1.T[2,2]) * R2.T[1,1], R1.T[2,1] * R2.T[2,1] + R1.T[2,2] * R2.T[2,2] + R1.T[2,3] * R2.T[2,3]), atan2(R1.T[2,1] * R2.T[1,1] + R1.T[2,2] * R2.T[1,2] + R1.T[2,3] * R2.T[1,3], R1.T[3,1] * R2.T[3,1] + R1.T[3,2] * R2.T[3,2] + R1.T[3,3] * R2.T[3,3])};
end Modelica.Mechanics.MultiBody.Frames.Orientation.equalityConstraint;

function Modelica.Mechanics.MultiBody.Frames.Quaternions.angularVelocity2 "Inline before index reduction" "Compute angular velocity resolved in frame 2 from quaternions orientation object and its derivative"
  input Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2";
  input Real[4] der_Q(unit = "1/s") "Derivative of Q";
  output Real[3] w(quantity = "AngularVelocity", unit = "rad/s") "Angular velocity of frame 2 with respect to frame 1 resolved in frame 2";
algorithm
  w := {Q[4] * 2.0 * der_Q[1] + Q[3] * 2.0 * der_Q[2] + (-Q[2]) * 2.0 * der_Q[3] + (-Q[1]) * 2.0 * der_Q[4], (-Q[3]) * 2.0 * der_Q[1] + Q[4] * 2.0 * der_Q[2] + Q[1] * 2.0 * der_Q[3] + (-Q[2]) * 2.0 * der_Q[4], Q[2] * 2.0 * der_Q[1] + (-Q[1]) * 2.0 * der_Q[2] + Q[4] * 2.0 * der_Q[3] + (-Q[3]) * 2.0 * der_Q[4]};
end Modelica.Mechanics.MultiBody.Frames.Quaternions.angularVelocity2;

function Modelica.Mechanics.MultiBody.Frames.Quaternions.from_T "Return quaternion orientation object Q from transformation matrix T"
  input Real[3, 3] T "Transformation matrix to transform vector from frame 1 to frame 2 (v2=T*v1)";
  input Real[4] Q_guess = {0.0, 0.0, 0.0, 1.0} "Guess value for Q (there are 2 solutions; the one close to Q_guess is used";
  output Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2 (Q and -Q have same transformation matrix)";
  protected Real paux;
  protected Real paux4;
  protected Real c1;
  protected Real c2;
  protected Real c3;
  protected Real c4;
  protected constant Real p4limit = 0.1;
  protected constant Real c4limit = 0.04000000000000001;
algorithm
  c1 := 1.0 + T[1,1] + (-T[2,2]) - T[3,3];
  c2 := 1.0 + T[2,2] + (-T[1,1]) - T[3,3];
  c3 := 1.0 + T[3,3] + (-T[1,1]) - T[2,2];
  c4 := 1.0 + T[1,1] + T[2,2] + T[3,3];
  if c4 > 0.04000000000000001 or c4 > c1 and c4 > c2 and c4 > c3 then
    paux := 0.5 * sqrt(c4);
    paux4 := 4.0 * paux;
    Q := {(T[2,3] - T[3,2]) / paux4, (T[3,1] - T[1,3]) / paux4, (T[1,2] - T[2,1]) / paux4, paux};
  elseif c1 > c2 and c1 > c3 and c1 > c4 then
    paux := 0.5 * sqrt(c1);
    paux4 := 4.0 * paux;
    Q := {paux, (T[1,2] + T[2,1]) / paux4, (T[1,3] + T[3,1]) / paux4, (T[2,3] - T[3,2]) / paux4};
  elseif c2 > c1 and c2 > c3 and c2 > c4 then
    paux := 0.5 * sqrt(c2);
    paux4 := 4.0 * paux;
    Q := {(T[1,2] + T[2,1]) / paux4, paux, (T[2,3] + T[3,2]) / paux4, (T[3,1] - T[1,3]) / paux4};
  else
    paux := 0.5 * sqrt(c3);
    paux4 := 4.0 * paux;
    Q := {(T[1,3] + T[3,1]) / paux4, (T[2,3] + T[3,2]) / paux4, paux, (T[1,2] - T[2,1]) / paux4};
  end if;
  if Q[1] * Q_guess[1] + Q[2] * Q_guess[2] + Q[3] * Q_guess[3] + Q[4] * Q_guess[4] < 0.0 then
    Q := {-Q[1], -Q[2], -Q[3], -Q[4]};
  end if;
end Modelica.Mechanics.MultiBody.Frames.Quaternions.from_T;

function Modelica.Mechanics.MultiBody.Frames.Quaternions.nullRotation "Inline before index reduction" "Return quaternion orientation object that does not rotate a frame"
  output Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2";
algorithm
  Q := {0.0, 0.0, 0.0, 1.0};
end Modelica.Mechanics.MultiBody.Frames.Quaternions.nullRotation;

function Modelica.Mechanics.MultiBody.Frames.Quaternions.orientationConstraint "Inline before index reduction" "Return residues of orientation constraints (shall be zero)"
  input Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2";
  output Real[1] residue "Residue constraint (shall be zero)";
algorithm
  residue := {-1.0 + Q[1] ^ 2.0 + Q[2] ^ 2.0 + Q[3] ^ 2.0 + Q[4] ^ 2.0};
end Modelica.Mechanics.MultiBody.Frames.Quaternions.orientationConstraint;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation "Inline before index reduction" "Return absolute orientation object from another absolute and a relative orientation object"
  input Real[3, 3] T1 "Orientation object to rotate frame 0 into frame 1";
  input Real[3, 3] T_rel "Orientation object to rotate frame 1 into frame 2";
  output Real[3, 3] T2 "Orientation object to rotate frame 0 into frame 2";
algorithm
  T2 := {{T_rel[1,1] * T1[1,1] + T_rel[1,2] * T1[2,1] + T_rel[1,3] * T1[3,1], T_rel[1,1] * T1[1,2] + T_rel[1,2] * T1[2,2] + T_rel[1,3] * T1[3,2], T_rel[1,1] * T1[1,3] + T_rel[1,2] * T1[2,3] + T_rel[1,3] * T1[3,3]}, {T_rel[2,1] * T1[1,1] + T_rel[2,2] * T1[2,1] + T_rel[2,3] * T1[3,1], T_rel[2,1] * T1[1,2] + T_rel[2,2] * T1[2,2] + T_rel[2,3] * T1[3,2], T_rel[2,1] * T1[1,3] + T_rel[2,2] * T1[2,3] + T_rel[2,3] * T1[3,3]}, {T_rel[3,1] * T1[1,1] + T_rel[3,2] * T1[2,1] + T_rel[3,3] * T1[3,1], T_rel[3,1] * T1[1,2] * T1[1,2 + T_rel[3,2] * T1[2,2] + T_rel[3,3] * T1[3,2], T_rel[3,1] * T1[1,3] + T_rel[3,2] * T1[2,3] + T_rel[3,3] * T1[3,3]}};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation "Inline before index reduction" "Return rotation object to rotate around one frame axis"
  input Integer axis(min = 1, max = 3) "Rotate around 'axis' of frame 1";
  input Real angle(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angle to rotate frame 1 into frame 2 along 'axis' of frame 1";
  output Real[3, 3] T "Orientation object to rotate frame 1 into frame 2";
algorithm
  T := if axis == 1 then {{1.0, 0.0, 0.0}, {0.0, cos(angle), sin(angle)}, {0.0, -sin(angle), cos(angle)}} else if axis == 2 then {{cos(angle), 0.0, -sin(angle)}, {0.0, 1.0, 0.0}, {sin(angle), 0.0, cos(angle)}} else {{cos(angle), sin(angle), 0.0}, {-sin(angle), cos(angle), 0.0}, {0.0, 0.0, 1.0}};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy "Return orientation object from n_x and n_y vectors"
  input Real[3] n_x(unit = "1") "Vector in direction of x-axis of frame 2, resolved in frame 1";
  input Real[3] n_y(unit = "1") "Vector in direction of y-axis of frame 2, resolved in frame 1";
  output Real[3, 3] T "Orientation object to rotate frame 1 into frame 2";
  protected Real abs_n_x = sqrt(n_x[1] ^ 2.0 + n_x[2] ^ 2.0 + n_x[3] ^ 2.0);
  protected Real[3] e_x(unit = "1") = if abs_n_x < 1e-10 then {1.0, 0.0, 0.0} else {n_x[1] / abs_n_x, n_x[2] / abs_n_x, n_x[3] / abs_n_x};
  protected Real[3] n_z_aux(unit = "1") = {e_x[2] * n_y[3] - e_x[3] * n_y[2], e_x[3] * n_y[1] - e_x[1] * n_y[3], e_x[1] * n_y[2] - e_x[2] * n_y[1]};
  protected Real[3] n_y_aux(unit = "1") = if n_z_aux[1] ^ 2.0 + n_z_aux[2] ^ 2.0 + n_z_aux[3] ^ 2.0 > 1e-06 then {n_y[1], n_y[2], n_y[3]} else if abs(e_x[1]) > 1e-06 then {0.0, 1.0, 0.0} else {1.0, 0.0, 0.0};
  protected Real[3] e_z_aux(unit = "1") = {e_x[2] * n_y_aux[3] - e_x[3] * n_y_aux[2], e_x[3] * n_y_aux[1] - e_x[1] * n_y_aux[3], e_x[1] * n_y_aux[2] - e_x[2] * n_y_aux[1]};
  protected Real[3] e_z(unit = "1") = {e_z_aux[1] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0), e_z_aux[2] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0), e_z_aux[3] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0)};
algorithm
  T := {{e_x[1], e_x[2], e_x[3]}, {e_z[2] * e_x[3] - e_z[3] * e_x[2], e_z[3] * e_x[1] - e_z[1] * e_x[3], e_z[1] * e_x[2] - e_z[2] * e_x[1]}, {e_z[1], e_z[2], e_z[3]}};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.planarRotation "Inline before index reduction" "Return orientation object of a planar rotation"
  input Real[3] e(unit = "1") "Normalized axis of rotation (must have length=1)";
  input Real angle(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angle to rotate frame 1 into frame 2 along axis e";
  output Real[3, 3] T "Orientation object to rotate frame 1 into frame 2";
algorithm
  T := {{e[1] ^ 2.0 + (1.0 - e[1] ^ 2.0) * cos(angle), (e[1] - e[1] * cos(angle)) * e[2] + e[3] * sin(angle), (e[1] - e[1] * cos(angle)) * e[3] - e[2] * sin(angle)}, {(e[2] - e[2] * cos(angle)) * e[1] - e[3] * sin(angle), e[2] ^ 2.0 + (1.0 - e[2] ^ 2.0) * cos(angle), (e[2] - e[2] * cos(angle)) * e[3] + e[1] * sin(angle)}, {(e[3] - e[3] * cos(angle)) * e[1] + e[2] * sin(angle), (e[3] - e[3] * cos(angle)) * e[2] - e[1] * sin(angle), e[3] ^ 2.0 + (1.0 - e[3] ^ 2.0) * cos(angle)}};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.planarRotation;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1 "Inline before index reduction" "Transform vector from frame 2 to frame 1"
  input Real[3, 3] T "Orientation object to rotate frame 1 into frame 2";
  input Real[3] v2 "Vector in frame 2";
  output Real[3] v1 "Vector in frame 1";
algorithm
  v1 := {T[1,1] * v2[1] + T[2,1] * v2[2] + T[3,1] * v2[3], T[1,2] * v2[1] + T[2,2] * v2[2] + T[3,2] * v2[3], T[1,3] * v2[1] + T[2,3] * v2[2] + T[3,3] * v2[3]};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1;

function Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2 "Inline before index reduction" "Transform vector from frame 1 to frame 2"
  input Real[3, 3] T "Orientation object to rotate frame 1 into frame 2";
  input Real[3] v1 "Vector in frame 1";
  output Real[3] v2 "Vector in frame 2";
algorithm
  v2 := {T[1,1] * v1[1] + T[1,2] * v1[2] + T[1,3] * v1[3], T[2,1] * v1[1] + T[2,2] * v1[2] + T[2,3] * v1[3], T[3,1] * v1[1] + T[3,2] * v1[2] + T[3,3] * v1[3]};
end Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2;

function Modelica.Mechanics.MultiBody.Frames.absoluteRotation "Inline before index reduction" "Return absolute orientation object from another absolute and a relative orientation object"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R1 "Orientation object to rotate frame 0 into frame 1";
  input Modelica.Mechanics.MultiBody.Frames.Orientation R_rel "Orientation object to rotate frame 1 into frame 2";
  output Modelica.Mechanics.MultiBody.Frames.Orientation R2 "Orientation object to rotate frame 0 into frame 2";
algorithm
  R2 := Modelica.Mechanics.MultiBody.Frames.Orientation({{R_rel.T[1,1] * R1.T[1,1] + R_rel.T[1,2] * R1.T[2,1] + R_rel.T[1,3] * R1.T[3,1], R_rel.T[1,1] * R1.T[1,2] + R_rel.T[1,2] * R1.T[2,2] + R_rel.T[1,3] * R1.T[3,2], R_rel.T[1,1] * R1.T[1,3] + R_rel.T[1,2] * R1.T[2,3] + R_rel.T[1,3] * R1.T[3,3]}, {R_rel.T[2,1] * R1.T[1,1] + R_rel.T[2,2] * R1.T[2,1] + R_rel.T[2,3] * R1.T[3,1], R_rel.T[2,1] * R1.T[1,2] + R_rel.T[2,2] * R1.T[2,2] + R_rel.T[2,3] * R1.T[3,2], R_rel.T[2,1] * R1.T[1,3] + R_rel.T[2,2] * R1.T[2,3] + R_rel.T[2,3] * R1.T[3,3]}, {R_rel.T[3,1] * R1.T[1,1] + R_rel.T[3,2] * R1.T[2,1] + R_rel.T[3,3] * R1.T[3,1], R_rel.T[3,1] * R1.T[1,2] + R_rel.T[3,2] * R1.T[2,2] + R_rel.T[3,3] * R1.T[3,2], R_rel.T[3,1] * R1.T[1,3] + R_rel.T[3,2] * R1.T[2,3] + R_rel.T[3,3] * R1.T[3,3]}}, Modelica.Mechanics.MultiBody.Frames.resolve2(R_rel, {R1.w[1], R1.w[2], R1.w[3]}) + {R_rel.w[1], R_rel.w[2], R_rel.w[3]});
end Modelica.Mechanics.MultiBody.Frames.absoluteRotation;

function Modelica.Mechanics.MultiBody.Frames.angularVelocity2 "Inline before index reduction" "Return angular velocity resolved in frame 2 from orientation object"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  output Real[3] w(quantity = "AngularVelocity", unit = "rad/s") "Angular velocity of frame 2 with respect to frame 1 resolved in frame 2";
algorithm
  w := {R.w[1], R.w[2], R.w[3]};
end Modelica.Mechanics.MultiBody.Frames.angularVelocity2;

function Modelica.Mechanics.MultiBody.Frames.axesRotations "Inline before index reduction" "Return fixed rotation object to rotate in sequence around fixed angles along 3 axes"
  input Integer[3] sequence = {1, 2, 3} "Sequence of rotations from frame 1 to frame 2 along axis sequence[i]";
  input Real[3] angles(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angles around the axes defined in 'sequence'";
  input Real[3] der_angles(quantity = "AngularVelocity", unit = "rad/s") "= der(angles)";
  output Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
algorithm
  R := Modelica.Mechanics.MultiBody.Frames.Orientation(Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[3], angles[3]) * Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[2], angles[2]) * Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[1], angles[1]), Modelica.Mechanics.MultiBody.Frames.axis(sequence[3]) * der_angles[3] + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2(Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[3], angles[3]), Modelica.Mechanics.MultiBody.Frames.axis(sequence[2]) * der_angles[2]) + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2(Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[3], angles[3]) * Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation(sequence[2], angles[2]), Modelica.Mechanics.MultiBody.Frames.axis(sequence[1]) * der_angles[1]));
end Modelica.Mechanics.MultiBody.Frames.axesRotations;

function Modelica.Mechanics.MultiBody.Frames.axesRotationsAngles "Return the 3 angles to rotate in sequence around 3 axes to construct the given orientation object"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Integer[3] sequence = {1, 2, 3} "Sequence of rotations from frame 1 to frame 2 along axis sequence[i]";
  input Real guessAngle1(quantity = "Angle", unit = "rad", displayUnit = "deg") = 0.0 "Select angles[1] such that |angles[1] - guessAngle1| is a minimum";
  output Real[3] angles(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angles around the axes defined in 'sequence' such that R=Frames.axesRotation(sequence,angles); -pi < angles[i] <= pi";
  protected Real[3] e1_1(unit = "1") "First rotation axis, resolved in frame 1";
  protected Real[3] e2_1a(unit = "1") "Second rotation axis, resolved in frame 1a";
  protected Real[3] e3_1(unit = "1") "Third rotation axis, resolved in frame 1";
  protected Real[3] e3_2(unit = "1") "Third rotation axis, resolved in frame 2";
  protected Real A "Coefficient A in the equation A*cos(angles[1])+B*sin(angles[1]) = 0";
  protected Real B "Coefficient B in the equation A*cos(angles[1])+B*sin(angles[1]) = 0";
  protected Real angle_1a(quantity = "Angle", unit = "rad", displayUnit = "deg") "Solution 1 for angles[1]";
  protected Real angle_1b(quantity = "Angle", unit = "rad", displayUnit = "deg") "Solution 2 for angles[1]";
  protected Real[3, 3] T_1a "Orientation object to rotate frame 1 into frame 1a";
algorithm
  assert(sequence[1] <> sequence[2] and sequence[2] <> sequence[3], "input argument 'sequence[1:3]' is not valid");
  e1_1 := if sequence[1] == 1 then {1.0, 0.0, 0.0} else if sequence[1] == 2 then {0.0, 1.0, 0.0} else {0.0, 0.0, 1.0};
  e2_1a := if sequence[2] == 1 then {1.0, 0.0, 0.0} else if sequence[2] == 2 then {0.0, 1.0, 0.0} else {0.0, 0.0, 1.0};
  e3_1 := {R.T[sequence[3],1], R.T[sequence[3],2], R.T[sequence[3],3]};
  e3_2 := if sequence[3] == 1 then {1.0, 0.0, 0.0} else if sequence[3] == 2 then {0.0, 1.0, 0.0} else {0.0, 0.0, 1.0};
  A := e2_1a[1] * e3_1[1] + e2_1a[2] * e3_1[2] + e2_1a[3] * e3_1[3];
  B := (e1_1[2] * e2_1a[3] - e1_1[3] * e2_1a[2]) * e3_1[1] + (e1_1[3] * e2_1a[1] - e1_1[1] * e2_1a[3]) * e3_1[2] + (e1_1[1] * e2_1a[2] - e1_1[2] * e2_1a[1]) * e3_1[3];
  if abs(A) <= 1e-12 and abs(B) <= 1e-12 then
    angles[1] := guessAngle1;
  else
    angle_1a := atan2(A, -B);
    angle_1b := atan2(-A, B);
    angles[1] := if abs(angle_1a - guessAngle1) <= abs(angle_1b - guessAngle1) then angle_1a else angle_1b;
  end if;
  T_1a := Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.planarRotation({e1_1[1], e1_1[2], e1_1[3]}, angles[1]);
  angles[2] := Modelica.Mechanics.MultiBody.Frames.planarRotationAngle({e2_1a[1], e2_1a[2], e2_1a[3]}, Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2({{T_1a[1,1], T_1a[1,2], T_1a[1,3]}, {T_1a[2,1], T_1a[2,2], T_1a[2,3]}, {T_1a[3,1], T_1a[3,2], T_1a[3,3]}}, {e3_1[1], e3_1[2], e3_1[3]}), {e3_2[1], e3_2[2], e3_2[3]});
  angles[3] := Modelica.Mechanics.MultiBody.Frames.planarRotationAngle({e3_2[1], e3_2[2], e3_2[3]}, {e2_1a[1], e2_1a[2], e2_1a[3]}, Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2({{R.T[1,1], R.T[1,2], R.T[1,3]}, {R.T[2,1], R.T[2,2], R.T[2,3]}, {R.T[3,1], R.T[3,2], R.T[3,3]}}, Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{T_1a[1,1], T_1a[1,2], T_1a[1,3]}, {T_1a[2,1], T_1a[2,2], T_1a[2,3]}, {T_1a[3,1], T_1a[3,2], T_1a[3,3]}}, {e2_1a[1], e2_1a[2], e2_1a[3]})));
end Modelica.Mechanics.MultiBody.Frames.axesRotationsAngles;

function Modelica.Mechanics.MultiBody.Frames.axis "Inline before index reduction" "Return unit vector for x-, y-, or z-axis"
  input Integer axis(min = 1, max = 3) "Axis vector to be returned";
  output Real[3] e(unit = "1") "Unit axis vector";
algorithm
  e := if axis == 1 then {1.0, 0.0, 0.0} else if axis == 2 then {0.0, 1.0, 0.0} else {0.0, 0.0, 1.0};
end Modelica.Mechanics.MultiBody.Frames.axis;

function Modelica.Mechanics.MultiBody.Frames.from_Q "Inline before index reduction" "Return orientation object R from quaternion orientation object Q"
  input Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2";
  input Real[3] w(quantity = "AngularVelocity", unit = "rad/s") "Angular velocity from frame 2 with respect to frame 1, resolved in frame 2";
  output Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
algorithm
  R := Modelica.Mechanics.MultiBody.Frames.Orientation({{-1.0 + 2.0 * (Q[1] ^ 2.0 + Q[4] ^ 2.0), 2.0 * (Q[1] * Q[2] + Q[3] * Q[4]), 2.0 * (Q[1] * Q[3] - Q[2] * Q[4])}, {2.0 * (Q[2] * Q[1] - Q[3] * Q[4]), -1.0 + 2.0 * (Q[2] ^ 2.0 + Q[4] ^ 2.0), 2.0 * (Q[2] * Q[3] + Q[1] * Q[4])}, {2.0 * (Q[3] * Q[1] + Q[2] * Q[4]), 2.0 * (Q[3] * Q[2] - Q[1] * Q[4]), -1.0 + 2.0 * (Q[3] ^ 2.0 + Q[4] ^ 2.0)}}, {w[1], w[2], w[3]});
end Modelica.Mechanics.MultiBody.Frames.from_Q;

function Modelica.Mechanics.MultiBody.Frames.from_nxy "Return fixed orientation object from n_x and n_y vectors"
  input Real[3] n_x(unit = "1") "Vector in direction of x-axis of frame 2, resolved in frame 1";
  input Real[3] n_y(unit = "1") "Vector in direction of y-axis of frame 2, resolved in frame 1";
  output Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  protected Real abs_n_x = sqrt(n_x[1] ^ 2.0 + n_x[2] ^ 2.0 + n_x[3] ^ 2.0);
  protected Real[3] e_x(unit = "1") = if abs_n_x < 1e-10 then {1.0, 0.0, 0.0} else {n_x[1] / abs_n_x, n_x[2] / abs_n_x, n_x[3] / abs_n_x};
  protected Real[3] n_z_aux(unit = "1") = {e_x[2] * n_y[3] - e_x[3] * n_y[2], e_x[3] * n_y[1] - e_x[1] * n_y[3], e_x[1] * n_y[2] - e_x[2] * n_y[1]};
  protected Real[3] n_y_aux(unit = "1") = if n_z_aux[1] ^ 2.0 + n_z_aux[2] ^ 2.0 + n_z_aux[3] ^ 2.0 > 1e-06 then {n_y[1], n_y[2], n_y[3]} else if abs(e_x[1]) > 1e-06 then {0.0, 1.0, 0.0} else {1.0, 0.0, 0.0};
  protected Real[3] e_z_aux(unit = "1") = {e_x[2] * n_y_aux[3] - e_x[3] * n_y_aux[2], e_x[3] * n_y_aux[1] - e_x[1] * n_y_aux[3], e_x[1] * n_y_aux[2] - e_x[2] * n_y_aux[1]};
  protected Real[3] e_z(unit = "1") = {e_z_aux[1] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0), e_z_aux[2] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0), e_z_aux[3] / sqrt(e_z_aux[1] ^ 2.0 + e_z_aux[2] ^ 2.0 + e_z_aux[3] ^ 2.0)};
algorithm
  R := Modelica.Mechanics.MultiBody.Frames.Orientation({{e_x[1], e_x[2], e_x[3]}, {e_z[2] * e_x[3] - e_z[3] * e_x[2], e_z[3] * e_x[1] - e_z[1] * e_x[3], e_z[1] * e_x[2] - e_z[2] * e_x[1]}, {e_z[1], e_z[2], e_z[3]}}, {0.0, 0.0, 0.0});
end Modelica.Mechanics.MultiBody.Frames.from_nxy;

function Modelica.Mechanics.MultiBody.Frames.nullRotation "Inline before index reduction" "Return orientation object that does not rotate a frame"
  output Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object such that frame 1 and frame 2 are identical";
algorithm
  R := Modelica.Mechanics.MultiBody.Frames.Orientation({{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}, {0.0, 0.0, 0.0});
end Modelica.Mechanics.MultiBody.Frames.nullRotation;

function Modelica.Mechanics.MultiBody.Frames.planarRotation "Inline before index reduction" "Return orientation object of a planar rotation"
  input Real[3] e(unit = "1") "Normalized axis of rotation (must have length=1)";
  input Real angle(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angle to rotate frame 1 into frame 2 along axis e";
  input Real der_angle(quantity = "AngularVelocity", unit = "rad/s") "= der(angle)";
  output Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
algorithm
  R := Modelica.Mechanics.MultiBody.Frames.Orientation({{e[1] ^ 2.0 + (1.0 - e[1] ^ 2.0) * cos(angle), (e[1] - e[1] * cos(angle)) * e[2] + e[3] * sin(angle), (e[1] - e[1] * cos(angle)) * e[3] - e[2] * sin(angle)}, {(e[2] - e[2] * cos(angle)) * e[1] - e[3] * sin(angle), e[2] ^ 2.0 + (1.0 - e[2] ^ 2.0) * cos(angle), (e[2] - e[2] * cos(angle)) * e[3] + e[1] * sin(angle)}, {(e[3] - e[3] * cos(angle)) * e[1] + e[2] * sin(angle), (e[3] - e[3] * cos(angle)) * e[2] - e[1] * sin(angle), e[3] ^ 2.0 + (1.0 - e[3] ^ 2.0) * cos(angle)}}, {e[1] * der_angle, e[2] * der_angle, e[3] * der_angle});
end Modelica.Mechanics.MultiBody.Frames.planarRotation;

function Modelica.Mechanics.MultiBody.Frames.planarRotationAngle "Inline before index reduction" "Return angle of a planar rotation, given the rotation axis and the representations of a vector in frame 1 and frame 2"
  input Real[3] e(unit = "1") "Normalized axis of rotation to rotate frame 1 around e into frame 2 (must have length=1)";
  input Real[3] v1 "A vector v resolved in frame 1 (shall not be parallel to e)";
  input Real[3] v2 "Vector v resolved in frame 2, i.e., v2 = resolve2(planarRotation(e,angle),v1)";
  output Real angle(quantity = "Angle", unit = "rad", displayUnit = "deg") "Rotation angle to rotate frame 1 into frame 2 along axis e in the range: -pi <= angle <= pi";
algorithm
  angle := atan2((e[1] * v1[3] - e[3] * v1[1]) * v2[2] - (e[1] * v1[2] - e[2] * v1[1]) * v2[3] - (e[2] * v1[3] - e[3] * v1[2]) * v2[1], v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3] + ((-e[2]) * v2[2] - e[3] * v2[3] - e[1] * v2[1]) * (e[1] * v1[1] + e[2] * v1[2] + e[3] * v1[3]));
end Modelica.Mechanics.MultiBody.Frames.planarRotationAngle;

function Modelica.Mechanics.MultiBody.Frames.resolve1 "Inline after index reduction" "Transform vector from frame 2 to frame 1"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real[3] v2 "Vector in frame 2";
  output Real[3] v1 "Vector in frame 1";
algorithm
  v1 := {R.T[1,1] * v2[1] + R.T[2,1] * v2[2] + R.T[3,1] * v2[3], R.T[1,2] * v2[1] + R.T[2,2] * v2[2] + R.T[3,2] * v2[3], R.T[1,3] * v2[1] + R.T[2,3] * v2[2] + R.T[3,3] * v2[3]};
end Modelica.Mechanics.MultiBody.Frames.resolve1;

function Modelica.Mechanics.MultiBody.Frames.resolve2 "Inline after index reduction" "Transform vector from frame 1 to frame 2"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real[3] v1 "Vector in frame 1";
  output Real[3] v2 "Vector in frame 2";
algorithm
  v2 := {R.T[1,1] * v1[1] + R.T[1,2] * v1[2] + R.T[1,3] * v1[3], R.T[2,1] * v1[1] + R.T[2,2] * v1[2] + R.T[2,3] * v1[3], R.T[3,1] * v1[1] + R.T[3,2] * v1[2] + R.T[3,3] * v1[3]};
end Modelica.Mechanics.MultiBody.Frames.resolve2;

function Modelica.Mechanics.MultiBody.Frames.resolveDyade1 "Inline before index reduction" "Transform second order tensor from frame 2 to frame 1"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real[3, 3] D2 "Second order tensor resolved in frame 2";
  output Real[3, 3] D1 "Second order tensor resolved in frame 1";
algorithm
  D1 := {{(R.T[1,1] * D2[1,1] + R.T[2,1] * D2[2,1] + R.T[3,1] * D2[3,1]) * R.T[1,1] + (R.T[1,1] * D2[1,2] + R.T[2,1] * D2[2,2] + R.T[3,1] * D2[3,2]) * R.T[2,1] + (R.T[1,1] * D2[1,3] + R.T[2,1] * D2[2,3] + R.T[3,1] * D2[3,3]) * R.T[3,1], (R.T[1,1] * D2[1,1] + R.T[2,1] * D2[2,1] + R.T[3,1] * D2[3,1]) * R.T[1,2] + (R.T[1,1] * D2[1,2] + R.T[2,1] * D2[2,2] + R.T[3,1] * D2[3,2]) * R.T[2,2] + (R.T[1,1] * D2[1,3] + R.T[2,1] * D2[2,3] + R.T[3,1] * D2[3,3]) * R.T[3,2], (R.T[1,1] * D2[1,1] + R.T[2,1] * D2[2,1] + R.T[3,1] * D2[3,1]) * R.T[1,3] + (R.T[1,1] * D2[1,2] + R.T[2,1] * D2[2,2] + R.T[3,1] * D2[3,2]) * R.T[2,3] + (R.T[1,1] * D2[1,3] + R.T[2,1] * D2[2,3] + R.T[3,1] * D2[3,3]) * R.T[3,3]}, {(R.T[1,2] * D2[1,1] + R.T[2,2] * D2[2,1] + R.T[3,2] * D2[3,1]) * R.T[1,1] + (R.T[1,2] * D2[1,2] + R.T[2,2] * D2[2,2] + R.T[3,2] * D2[3,2]) * R.T[2,1] + (R.T[1,2] * D2[1,3] + R.T[2,2] * D2[2,3] + R.T[3,2] * D2[3,3]) * R.T[3,1], (R.T[1,2] * D2[1,1] + R.T[2,2] * D2[2,1] + R.T[3,2] * D2[3,1]) * R.T[1,2] + (R.T[1,2] * D2[1,2] + R.T[2,2] * D2[2,2] + R.T[3,2] * D2[3,2]) * R.T[2,2] + (R.T[1,2] * D2[1,3] + R.T[2,2] * D2[2,3] + R.T[3,2] * D2[3,3]) * R.T[3,2], (R.T[1,2] * D2[1,1] + R.T[2,2] * D2[2,1] + R.T[3,2] * D2[3,1]) * R.T[1,3] + (R.T[1,2] * D2[1,2] + R.T[2,2] * D2[2,2] + R.T[3,2] * D2[3,2]) * R.T[2,3] + (R.T[1,2] * D2[1,3] + R.T[2,2] * D2[2,3] + R.T[3,2] * D2[3,3]) * R.T[3,3]}, {(R.T[1,3] * D2[1,1] + R.T[2,3] * D2[2,1] + R.T[3,3] * D2[3,1]) * R.T[1,1] + (R.T[1,3] * D2[1,2] + R.T[2,3] * D2[2,2] + R.T[3,3] * D2[3,2]) * R.T[2,1] + (R.T[1,3] * D2[1,3] + R.T[2,3] * D2[2,3] + R.T[3,3] * D2[3,3]) * R.T[3,1], (R.T[1,3] * D2[1,1] + R.T[2,3] * D2[2,1] + R.T[3,3] * D2[3,1]) * R.T[1,2] + (R.T[1,3] * D2[1,2] + R.T[2,3] * D2[2,2] + R.T[3,3] * D2[3,2]) * R.T[2,2] + (R.T[1,3] * D2[1,3] + R.T[2,3] * D2[2,3] + R.T[3,3] * D2[3,3]) * R.T[3,2], (R.T[1,3] * D2[1,1] + R.T[2,3] * D2[2,1] + R.T[3,3] * D2[3,1]) * R.T[1,3] + (R.T[1,3] * D2[1,2] + R.T[2,3] * D2[2,2] + R.T[3,3] * D2[3,2]) * R.T[2,3] + (R.T[1,3] * D2[1,3] + R.T[2,3] * D2[2,3] + R.T[3,3] * D2[3,3]) * R.T[3,3]}};
end Modelica.Mechanics.MultiBody.Frames.resolveDyade1;

function Modelica.Mechanics.MultiBody.Frames.to_Q "Inline before index reduction" "Return quaternion orientation object Q from orientation object R"
  input Modelica.Mechanics.MultiBody.Frames.Orientation R "Orientation object to rotate frame 1 into frame 2";
  input Real[4] Q_guess = {0.0, 0.0, 0.0, 1.0} "Guess value for output Q (there are 2 solutions; the one closer to Q_guess is used";
  output Real[4] Q "Quaternions orientation object to rotate frame 1 into frame 2";
algorithm
  Q := Modelica.Mechanics.MultiBody.Frames.Quaternions.from_T({{R.T[1,1], R.T[1,2], R.T[1,3]}, {R.T[2,1], R.T[2,2], R.T[2,3]}, {R.T[3,1], R.T[3,2], R.T[3,3]}}, {Q_guess[1], Q_guess[2], Q_guess[3], Q_guess[4]});
end Modelica.Mechanics.MultiBody.Frames.to_Q;

function Modelica.Mechanics.MultiBody.World.gravityAcceleration "Inline before index reduction" "Gravity field acceleration depending on field type and position"
  input Real[3] r(quantity = "Length", unit = "m") "Position vector from world frame to actual point, resolved in world frame";
  input enumeration(NoGravity, UniformGravity, PointGravity) gravityType = gravityType "Type of gravity field";
  input Real[3] g(quantity = "Acceleration", unit = "m/s2") = {0.0, -g, 0.0} "Constant gravity acceleration, resolved in world frame, if gravityType=1";
  input Real mue(unit = "m3/s2") = mue "Field constant of point gravity field, if gravityType=2";
  output Real[3] gravity(quantity = "Acceleration", unit = "m/s2") "Gravity acceleration at point r, resolved in world frame";
algorithm
  gravity := if gravityType == Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity then {g[1], g[2], g[3]} else if gravityType == Modelica.Mechanics.MultiBody.Types.GravityTypes.PointGravity then {(-r[1]) * mue / (r[1] ^ 2.0 + r[2] ^ 2.0 + r[3] ^ 2.0) / Modelica.Math.Vectors.length({r[1], r[2], r[3]}), (-r[2]) * mue / (r[1] ^ 2.0 + r[2] ^ 2.0 + r[3] ^ 2.0) / Modelica.Math.Vectors.length({r[1], r[2], r[3]}), (-r[3]) * mue / (r[1] ^ 2.0 + r[2] ^ 2.0 + r[3] ^ 2.0) / Modelica.Math.Vectors.length({r[1], r[2], r[3]})} else {0.0, 0.0, 0.0};
end Modelica.Mechanics.MultiBody.World.gravityAcceleration;

function Modelica.SIunits.Conversions.to_unit1 "Inline before index reduction" "Change the unit of a Real number to unit=\"1\""
  input Real r "Real number";
  output Real result(unit = "1") "Real number r with unit=\"1\"";
algorithm
  result := r;
end Modelica.SIunits.Conversions.to_unit1;

class InnerOuterSamePrefix
  Real pendulum.world.frame_b.r_0[1](quantity = "Length", unit = "m") "Position vector from world frame to the connector frame origin, resolved in world frame";
  Real pendulum.world.frame_b.r_0[2](quantity = "Length", unit = "m") "Position vector from world frame to the connector frame origin, resolved in world frame";
  Real pendulum.world.frame_b.r_0[3](quantity = "Length", unit = "m") "Position vector from world frame to the connector frame origin, resolved in world frame";
  Real pendulum.world.frame_b.R.T[1,1] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[1,2] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[1,3] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[2,1] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[2,2] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[2,3] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[3,1] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[3,2] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.T[3,3] "Transformation matrix from world frame to local frame";
  Real pendulum.world.frame_b.R.w[1](quantity = "AngularVelocity", unit = "rad/s") "Absolute angular velocity of local frame, resolved in local frame";
  Real pendulum.world.frame_b.R.w[2](quantity = "AngularVelocity", unit = "rad/s") "Absolute angular velocity of local frame, resolved in local frame";
  Real pendulum.world.frame_b.R.w[3](quantity = "AngularVelocity", unit = "rad/s") "Absolute angular velocity of local frame, resolved in local frame";
  Real pendulum.world.frame_b.f[1](quantity = "Force", unit = "N") "Cut-force resolved in connector frame";
  Real pendulum.world.frame_b.f[2](quantity = "Force", unit = "N") "Cut-force resolved in connector frame";
  Real pendulum.world.frame_b.f[3](quantity = "Force", unit = "N") "Cut-force resolved in connector frame";
  Real pendulum.world.frame_b.t[1](quantity = "Torque", unit = "N.m") "Cut-torque resolved in connector frame";
  Real pendulum.world.frame_b.t[2](quantity = "Torque", unit = "N.m") "Cut-torque resolved in connector frame";
  Real pendulum.world.frame_b.t[3](quantity = "Torque", unit = "N.m") "Cut-torque resolved in connector frame";
  parameter Boolean pendulum.world.enableAnimation = true "= true, if animation of all components is enabled";
  parameter Boolean pendulum.world.animateWorld = true "= true, if world coordinate system shall be visualized";
  parameter Boolean pendulum.world.animateGravity = true "= true, if gravity field shall be visualized (acceleration vector or field center)";
  parameter String pendulum.world.label1 = "x" "Label of horizontal axis in icon";
  parameter String pendulum.world.label2 = "y" "Label of vertical axis in icon";
  parameter enumeration(NoGravity, UniformGravity, PointGravity) pendulum.world.gravityType = Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity "Type of gravity field";
  parameter Real pendulum.world.g(quantity = "Acceleration", unit = "m/s2") = 9.81 "Constant gravity acceleration";
  parameter Real pendulum.world.n[1](unit = "1") = 0.0 "Direction of gravity resolved in world frame (gravity = g*n/length(n))";
  parameter Real pendulum.world.n[2](unit = "1") = -1.0 "Direction of gravity resolved in world frame (gravity = g*n/length(n))";
  parameter Real pendulum.world.n[3](unit = "1") = 0.0 "Direction of gravity resolved in world frame (gravity = g*n/length(n))";
  parameter Real pendulum.world.mue(unit = "m3/s2", min = 0.0) = 398600000000000.0 "Gravity field constant (default = field constant of earth)";
  parameter Boolean pendulum.world.driveTrainMechanics3D = true "= true, if 3-dim. mechanical effects of Parts.Mounting1D/Rotor1D/BevelGear1D shall be taken into account";
  parameter Real pendulum.world.axisLength(quantity = "Length", unit = "m", min = 0.0) = 0.5 * pendulum.world.nominalLength "Length of world axes arrows";
  parameter Real pendulum.world.axisDiameter(quantity = "Length", unit = "m", min = 0.0) = pendulum.world.axisLength / pendulum.world.defaultFrameDiameterFraction "Diameter of world axes arrows";
  parameter Boolean pendulum.world.axisShowLabels = true "= true, if labels shall be shown";
  Integer pendulum.world.axisColor_x[1](min = 0, max = 255) "Color of x-arrow";
  Integer pendulum.world.axisColor_x[2](min = 0, max = 255) "Color of x-arrow";
  Integer pendulum.world.axisColor_x[3](min = 0, max = 255) "Color of x-arrow";
  Integer pendulum.world.axisColor_y[1](min = 0, max = 255);
  Integer pendulum.world.axisColor_y[2](min = 0, max = 255);
  Integer pendulum.world.axisColor_y[3](min = 0, max = 255);
  Integer pendulum.world.axisColor_z[1](min = 0, max = 255) "Color of z-arrow";
  Integer pendulum.world.axisColor_z[2](min = 0, max = 255) "Color of z-arrow";
  Integer pendulum.world.axisColor_z[3](min = 0, max = 255) "Color of z-arrow";
  parameter Real pendulum.world.gravityArrowTail[1](quantity = "Length", unit = "m") = 0.0 "Position vector from origin of world frame to arrow tail, resolved in world frame";
  parameter Real pendulum.world.gravityArrowTail[2](quantity = "Length", unit = "m") = 0.0 "Position vector from origin of world frame to arrow tail, resolved in world frame";
  parameter Real pendulum.world.gravityArrowTail[3](quantity = "Length", unit = "m") = 0.0 "Position vector from origin of world frame to arrow tail, resolved in world frame";
  parameter Real pendulum.world.gravityArrowLength(quantity = "Length", unit = "m") = 0.5 * pendulum.world.axisLength "Length of gravity arrow";
  parameter Real pendulum.world.gravityArrowDiameter(quantity = "Length", unit = "m", min = 0.0) = pendulum.world.gravityArrowLength / pendulum.world.defaultWidthFraction "Diameter of gravity arrow";
  Integer pendulum.world.gravityArrowColor[1](min = 0, max = 255) "Color of gravity arrow";
  Integer pendulum.world.gravityArrowColor[2](min = 0, max = 255) "Color of gravity arrow";
  Integer pendulum.world.gravityArrowColor[3](min = 0, max = 255) "Color of gravity arrow";
  parameter Real pendulum.world.gravitySphereDiameter(quantity = "Length", unit = "m", min = 0.0) = 12742000.0 "Diameter of sphere representing gravity center (default = mean diameter of earth)";
  Integer pendulum.world.gravitySphereColor[1](min = 0, max = 255) "Color of gravity sphere";
  Integer pendulum.world.gravitySphereColor[2](min = 0, max = 255) "Color of gravity sphere";
  Integer pendulum.world.gravitySphereColor[3](min = 0, max = 255) "Color of gravity sphere";
  parameter Real pendulum.world.nominalLength(quantity = "Length", unit = "m") = 1.0 "\"Nominal\" length of multi-body system";
  parameter Real pendulum.world.defaultAxisLength(quantity = "Length", unit = "m") = 0.2 * pendulum.world.nominalLength "Default for length of a frame axis (but not world frame)";
  parameter Real pendulum.world.defaultJointLength(quantity = "Length", unit = "m") = 0.1 * pendulum.world.nominalLength "Default for the fixed length of a shape representing a joint";
  parameter Real pendulum.world.defaultJointWidth(quantity = "Length", unit = "m") = 0.05 * pendulum.world.nominalLength "Default for the fixed width of a shape representing a joint";
  parameter Real pendulum.world.defaultForceLength(quantity = "Length", unit = "m") = 0.1 * pendulum.world.nominalLength "Default for the fixed length of a shape representing a force (e.g., damper)";
  parameter Real pendulum.world.defaultForceWidth(quantity = "Length", unit = "m") = 0.05 * pendulum.world.nominalLength "Default for the fixed width of a shape representing a force (e.g., spring, bushing)";
  parameter Real pendulum.world.defaultBodyDiameter(quantity = "Length", unit = "m") = 0.1111111111111111 * pendulum.world.nominalLength "Default for diameter of sphere representing the center of mass of a body";
  parameter Real pendulum.world.defaultWidthFraction = 20.0 "Default for shape width as a fraction of shape length (e.g., for Parts.FixedTranslation)";
  parameter Real pendulum.world.defaultArrowDiameter(quantity = "Length", unit = "m") = 0.025 * pendulum.world.nominalLength "Default for arrow diameter (e.g., of forces, torques, sensors)";
  parameter Real pendulum.world.defaultFrameDiameterFraction = 40.0 "Default for arrow diameter of a coordinate system as a fraction of axis length";
  parameter Real pendulum.world.defaultSpecularCoefficient(min = 0.0) = 0.7 "Default reflection of ambient light (= 0: light is completely absorbed)";
  parameter Real pendulum.world.defaultN_to_m(unit = "N/m", min = 0.0) = 1000.0 "Default scaling of force arrows (length = force/defaultN_to_m)";
  parameter Real pendulum.world.defaultNm_to_m(unit = "N.m/m", min = 0.0) = 1000.0 "Default scaling of torque arrows (length = torque/defaultNm_to_m)";
  protected parameter Integer pendulum.world.ndim = if pendulum.world.enableAnimation and pendulum.world.animateWorld then 1 else 0;
  protected parameter Integer pendulum.world.ndim2 = if pendulum.world.enableAnimation and pendulum.world.animateWorld and pendulum.world.axisShowLabels then 1 else 0;
  protected parameter Real pendulum.world.headLength(quantity = "Length", unit = "m") = min(pendulum.world.axisLength, 5.0 * pendulum.world.axisDiameter);
  protected parameter Real pendulum.world.headWidth(quantity = "Length", unit = "m") = 3.0 * pendulum.world.axisDiameter;
  protected parameter Real pendulum.world.lineLength(quantity = "Length", unit = "m") = max(0.0, pendulum.world.axisLength - pendulum.world.headLength);
  protected parameter Real pendulum.world.lineWidth(quantity = "Length", unit = "m") = pendulum.world.axisDiameter;
  protected parameter Real pendulum.world.scaledLabel(quantity = "Length", unit = "m") = 3.0 * pendulum.world.axisDiameter;
  protected parameter Real pendulum.world.labelStart(quantity = "Length", unit = "m") = 1.05 * pendulum.world.axisLength;
  protected parameter Real pendulum.world.gravityHeadLength(quantity = "Length", unit = "m") = min(pendulum.world.gravityArrowLength, 4.0 * pendulum.world.gravityArrowDiameter);
  protected parameter Real pendulum.world.gravityHeadWidth(quantity = "Length", unit = "m") = 3.0 * pendulum.world.gravityArrowDiameter;
  protected parameter Real pendulum.world.gravityLineLength(quantity = "Length", unit = "m") = max(0.0, pendulum.world.gravityArrowLength - pendulum.world.gravityHeadLength);
  protected parameter Integer pendulum.world.ndim_pointGravity = if pendulum.world.enableAnimation and pendulum.world.animateGravity and pendulum.world.gravityType == Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity then 1 else 0;
  protected parameter String pendulum.world.x_arrowLine.shapeType = "cylinder" "Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, <external shape>)";
  protected Real pendulum.world.x_arrowLine.R.T[1,1] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[1,2] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[1,3] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[2,1] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[2,2] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[2,3] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[3,1] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[3,2] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.T[3,3] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowLine.R.w[1](quantity = "AngularVelocity", unit = "rad/s") = 0.0 "Absolute angular velocity of local frame, resolved in local frame";
  protected Real pendulum.world.x_arrowLine.R.w[2](quantity = "AngularVelocity", unit = "rad/s") = 0.0 "Absolute angular velocity of local frame, resolved in local frame";
  protected Real pendulum.world.x_arrowLine.R.w[3](quantity = "AngularVelocity", unit = "rad/s") = 0.0 "Absolute angular velocity of local frame, resolved in local frame";
  protected Real pendulum.world.x_arrowLine.r[1](quantity = "Length", unit = "m") "Position vector from origin of world frame to origin of object frame, resolved in world frame";
  protected Real pendulum.world.x_arrowLine.r[2](quantity = "Length", unit = "m") "Position vector from origin of world frame to origin of object frame, resolved in world frame";
  protected Real pendulum.world.x_arrowLine.r[3](quantity = "Length", unit = "m") "Position vector from origin of world frame to origin of object frame, resolved in world frame";
  protected Real pendulum.world.x_arrowLine.r_shape[1]
  protected Real pendulum.world.x_arrowLine.r_shape[1(quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.r_shape[2](quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.r_shape[3](quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.lengthDirection[1](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.lengthDirection[2](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.lengthDirection[3](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.widthDirection[1](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.widthDirection[2](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.widthDirection[3](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.world.x_arrowLine.length(quantity = "Length", unit = "m") = pendulum.world.lineLength "Length of visual object";
  protected Real pendulum.world.x_arrowLine.width(quantity = "Length", unit = "m") = pendulum.world.lineWidth "Width of visual object";
  protected Real pendulum.world.x_arrowLine.height(quantity = "Length", unit = "m") = pendulum.world.lineWidth "Height of visual object";
  protected Real pendulum.world.x_arrowLine.extra = 0.0 "Additional size data for some of the shape types";
  protected Real pendulum.world.x_arrowLine.color[1] "Color of shape";
  protected Real pendulum.world.x_arrowLine.color[2] "Color of shape";
  protected Real pendulum.world.x_arrowLine.color[3] "Color of shape";
  protected Real pendulum.world.x_arrowLine.specularCoefficient(min = 0.0) = 0.0 "Reflection of ambient light (= 0: light is completely absorbed)";
  protected parameter String pendulum.world.x_arrowHead.shapeType = "cone" "Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, <external shape>)";
  protected Real pendulum.world.x_arrowHead.R.T[1,1] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[1,2] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[1,3] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[2,1] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[2,2] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[2,3] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[3,1] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[3,2] = 0.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.T[3,3] = 1.0 "Transformation matrix from world frame to local frame";
  protected Real pendulum.world.x_arrowHead.R.w[1](quantity = "AngularVelocity", unit = "rad/s") = 0.0 "Absolute angular velocity of local frame, resolved in local frame";
  protected Real pen
...[truncated 160780 chars]...
 "Position vector from origin of world frame to origin of object frame, resolved in world frame";
  protected Real pendulum.revolute.cylinder.r[3](quantity = "Length", unit = "m") "Position vector from origin of world frame to origin of object frame, resolved in world frame";
  protected Real pendulum.revolute.cylinder.r_shape[1](quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.revolute.cylinder.r_shape[2](quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.revolute.cylinder.r_shape[3](quantity = "Length", unit = "m") "Position vector from origin of object frame to shape origin, resolved in object frame";
  protected Real pendulum.revolute.cylinder.lengthDirection[1](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.lengthDirection[2](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.lengthDirection[3](unit = "1") "Vector in length direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.widthDirection[1](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.widthDirection[2](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.widthDirection[3](unit = "1") "Vector in width direction, resolved in object frame";
  protected Real pendulum.revolute.cylinder.length(quantity = "Length", unit = "m") = pendulum.revolute.cylinderLength "Length of visual object";
  protected Real pendulum.revolute.cylinder.width(quantity = "Length", unit = "m") = pendulum.revolute.cylinderDiameter "Width of visual object";
  protected Real pendulum.revolute.cylinder.height(quantity = "Length", unit = "m") = pendulum.revolute.cylinderDiameter "Height of visual object";
  protected Real pendulum.revolute.cylinder.extra = 0.0 "Additional size data for some of the shape types";
  protected Real pendulum.revolute.cylinder.color[1] "Color of shape";
  protected Real pendulum.revolute.cylinder.color[2] "Color of shape";
  protected Real pendulum.revolute.cylinder.color[3] "Color of shape";
  protected Real pendulum.revolute.cylinder.specularCoefficient(min = 0.0) = pendulum.revolute.specularCoefficient "Reflection of ambient light (= 0: light is completely absorbed)";
  protected parameter Boolean pendulum.revolute.constantTorque.useSupport = false "= true, if support flange enabled, otherwise implicitly grounded";
  protected Real pendulum.revolute.constantTorque.flange.phi(quantity = "Angle", unit = "rad", displayUnit = "deg") "Absolute rotation angle of flange";
  protected Real pendulum.revolute.constantTorque.flange.tau(quantity = "Torque", unit = "N.m") "Cut torque in the flange";
  protected Real pendulum.revolute.constantTorque.phi_support(quantity = "Angle", unit = "rad", displayUnit = "deg") "Absolute angle of support flange";
  protected Real pendulum.revolute.constantTorque.phi(quantity = "Angle", unit = "rad", displayUnit = "deg") "Angle of flange with respect to support (= flange.phi - support.phi)";
  protected parameter Real pendulum.revolute.constantTorque.tau_constant(quantity = "Torque", unit = "N.m") = 0.0 "Constant torque (if negative, torque is acting as load)";
  protected Real pendulum.revolute.constantTorque.tau(quantity = "Torque", unit = "N.m") "Accelerating torque acting at flange (= -flange.tau)";
equation
  pendulum.world.axisColor_x = {0, 0, 0};
  pendulum.world.axisColor_y = {pendulum.world.axisColor_x[1], pendulum.world.axisColor_x[2], pendulum.world.axisColor_x[3]};
  pendulum.world.axisColor_z = {pendulum.world.axisColor_x[1], pendulum.world.axisColor_x[2], pendulum.world.axisColor_x[3]};
  pendulum.world.gravityArrowColor = {0, 230, 0};
  pendulum.world.gravitySphereColor = {0, 230, 0};
  pendulum.world.x_arrowLine.r = {0.0, 0.0, 0.0};
  pendulum.world.x_arrowLine.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.x_arrowLine.lengthDirection = {1.0, 0.0, 0.0};
  pendulum.world.x_arrowLine.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.x_arrowLine.color = {/*Real*/(pendulum.world.axisColor_x[1]), /*Real*/(pendulum.world.axisColor_x[2]), /*Real*/(pendulum.world.axisColor_x[3])};
  pendulum.world.x_arrowHead.r = {pendulum.world.lineLength, 0.0, 0.0};
  pendulum.world.x_arrowHead.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.x_arrowHead.lengthDirection = {1.0, 0.0, 0.0};
  pendulum.world.x_arrowHead.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.x_arrowHead.color = {/*Real*/(pendulum.world.axisColor_x[1]), /*Real*/(pendulum.world.axisColor_x[2]), /*Real*/(pendulum.world.axisColor_x[3])};
  pendulum.world.x_label.r = {0.0, 0.0, 0.0};
  pendulum.world.x_label.r_lines = {pendulum.world.labelStart, 0.0, 0.0};
  pendulum.world.x_label.n_x = {1.0, 0.0, 0.0};
  pendulum.world.x_label.n_y = {0.0, 1.0, 0.0};
  pendulum.world.x_label.lines = {{{0.0, 0.0}, {pendulum.world.scaledLabel, pendulum.world.scaledLabel}}, {{0.0, pendulum.world.scaledLabel}, {pendulum.world.scaledLabel, 0.0}}};
  pendulum.world.x_label.color = {pendulum.world.axisColor_x[1], pendulum.world.axisColor_x[2], pendulum.world.axisColor_x[3]};
  pendulum.world.x_label.R_rel = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy({pendulum.world.x_label.n_x[1], pendulum.world.x_label.n_x[2], pendulum.world.x_label.n_x[3]}, {pendulum.world.x_label.n_y[1], pendulum.world.x_label.n_y[2], pendulum.world.x_label.n_y[3]});
  pendulum.world.x_label.R_lines = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation({{pendulum.world.x_label.R.T[1,1], pendulum.world.x_label.R.T[1,2], pendulum.world.x_label.R.T[1,3]}, {pendulum.world.x_label.R.T[2,1], pendulum.world.x_label.R.T[2,2], pendulum.world.x_label.R.T[2,3]}, {pendulum.world.x_label.R.T[3,1], pendulum.world.x_label.R.T[3,2], pendulum.world.x_label.R.T[3,3]}}, {{pendulum.world.x_label.R_rel[1,1], pendulum.world.x_label.R_rel[1,2], pendulum.world.x_label.R_rel[1,3]}, {pendulum.world.x_label.R_rel[2,1], pendulum.world.x_label.R_rel[2,2], pendulum.world.x_label.R_rel[2,3]}, {pendulum.world.x_label.R_rel[3,1], pendulum.world.x_label.R_rel[3,2], pendulum.world.x_label.R_rel[3,3]}});
  pendulum.world.x_label.r_abs = {pendulum.world.x_label.r[1], pendulum.world.x_label.r[2], pendulum.world.x_label.r[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.x_label.R.T[1,1], pendulum.world.x_label.R.T[1,2], pendulum.world.x_label.R.T[1,3]}, {pendulum.world.x_label.R.T[2,1], pendulum.world.x_label.R.T[2,2], pendulum.world.x_label.R.T[2,3]}, {pendulum.world.x_label.R.T[3,1], pendulum.world.x_label.R.T[3,2], pendulum.world.x_label.R.T[3,3]}}, {pendulum.world.x_label.r_lines[1], pendulum.world.x_label.r_lines[2], pendulum.world.x_label.r_lines[3]});
  pendulum.world.x_label.cylinders[1].r = {pendulum.world.x_label.r_abs[1], pendulum.world.x_label.r_abs[2], pendulum.world.x_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.x_label.R_lines[1,1], pendulum.world.x_label.R_lines[1,2], pendulum.world.x_label.R_lines[1,3]}, {pendulum.world.x_label.R_lines[2,1], pendulum.world.x_label.R_lines[2,2], pendulum.world.x_label.R_lines[2,3]}, {pendulum.world.x_label.R_lines[3,1], pendulum.world.x_label.R_lines[3,2], pendulum.world.x_label.R_lines[3,3]}}, {pendulum.world.x_label.lines[1,1,1], pendulum.world.x_label.lines[1,1,2], 0.0});
  pendulum.world.x_label.cylinders[1].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.x_label.cylinders[1].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.x_label.R_rel[1,1], pendulum.world.x_label.R_rel[1,2], pendulum.world.x_label.R_rel[1,3]}, {pendulum.world.x_label.R_rel[2,1], pendulum.world.x_label.R_rel[2,2], pendulum.world.x_label.R_rel[2,3]}, {pendulum.world.x_label.R_rel[3,1], pendulum.world.x_label.R_rel[3,2], pendulum.world.x_label.R_rel[3,3]}}, {pendulum.world.x_label.lines[1,2,1] - pendulum.world.x_label.lines[1,1,1], pendulum.world.x_label.lines[1,2,2] - pendulum.world.x_label.lines[1,1,2], 0.0});
  pendulum.world.x_label.cylinders[1].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.x_label.cylinders[1].color = {/*Real*/(pendulum.world.x_label.color[1]), /*Real*/(pendulum.world.x_label.color[2]), /*Real*/(pendulum.world.x_label.color[3])};
  pendulum.world.x_label.cylinders[2].r = {pendulum.world.x_label.r_abs[1], pendulum.world.x_label.r_abs[2], pendulum.world.x_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.x_label.R_lines[1,1], pendulum.world.x_label.R_lines[1,2], pendulum.world.x_label.R_lines[1,3]}, {pendulum.world.x_label.R_lines[2,1], pendulum.world.x_label.R_lines[2,2], pendulum.world.x_label.R_lines[2,3]}, {pendulum.world.x_label.R_lines[3,1], pendulum.world.x_label.R_lines[3,2], pendulum.world.x_label.R_lines[3,3]}}, {pendulum.world.x_label.lines[2,1,1], pendulum.world.x_label.lines[2,1,2], 0.0});
  pendulum.world.x_label.cylinders[2].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.x_label.cylinders[2].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.x_label.R_rel[1,1], pendulum.world.x_label.R_rel[1,2], pendulum.world.x_label.R_rel[1,3]}, {pendulum.world.x_label.R_rel[2,1], pendulum.world.x_label.R_rel[2,2], pendulum.world.x_label.R_rel[2,3]}, {pendulum.world.x_label.R_rel[3,1], pendulum.world.x_label.R_rel[3,2], pendulum.world.x_label.R_rel[3,3]}}, {pendulum.world.x_label.lines[2,2,1] - pendulum.world.x_label.lines[2,1,1], pendulum.world.x_label.lines[2,2,2] - pendulum.world.x_label.lines[2,1,2], 0.0});
  pendulum.world.x_label.cylinders[2].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.x_label.cylinders[2].color = {/*Real*/(pendulum.world.x_label.color[1]), /*Real*/(pendulum.world.x_label.color[2]), /*Real*/(pendulum.world.x_label.color[3])};
  pendulum.world.y_arrowLine.r = {0.0, 0.0, 0.0};
  pendulum.world.y_arrowLine.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.y_arrowLine.lengthDirection = {0.0, 1.0, 0.0};
  pendulum.world.y_arrowLine.widthDirection = {1.0, 0.0, 0.0};
  pendulum.world.y_arrowLine.color = {/*Real*/(pendulum.world.axisColor_y[1]), /*Real*/(pendulum.world.axisColor_y[2]), /*Real*/(pendulum.world.axisColor_y[3])};
  pendulum.world.y_arrowHead.r = {0.0, pendulum.world.lineLength, 0.0};
  pendulum.world.y_arrowHead.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.y_arrowHead.lengthDirection = {0.0, 1.0, 0.0};
  pendulum.world.y_arrowHead.widthDirection = {1.0, 0.0, 0.0};
  pendulum.world.y_arrowHead.color = {/*Real*/(pendulum.world.axisColor_y[1]), /*Real*/(pendulum.world.axisColor_y[2]), /*Real*/(pendulum.world.axisColor_y[3])};
  pendulum.world.y_label.r = {0.0, 0.0, 0.0};
  pendulum.world.y_label.r_lines = {0.0, pendulum.world.labelStart, 0.0};
  pendulum.world.y_label.n_x = {0.0, 1.0, 0.0};
  pendulum.world.y_label.n_y = {-1.0, 0.0, 0.0};
  pendulum.world.y_label.lines = {{{0.0, 0.0}, {pendulum.world.scaledLabel, 1.5 * pendulum.world.scaledLabel}}, {{0.0, 1.5 * pendulum.world.scaledLabel}, {0.5 * pendulum.world.scaledLabel, 0.75 * pendulum.world.scaledLabel}}};
  pendulum.world.y_label.color = {pendulum.world.axisColor_y[1], pendulum.world.axisColor_y[2], pendulum.world.axisColor_y[3]};
  pendulum.world.y_label.R_rel = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy({pendulum.world.y_label.n_x[1], pendulum.world.y_label.n_x[2], pendulum.world.y_label.n_x[3]}, {pendulum.world.y_label.n_y[1], pendulum.world.y_label.n_y[2], pendulum.world.y_label.n_y[3]});
  pendulum.world.y_label.R_lines = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation({{pendulum.world.y_label.R.T[1,1], pendulum.world.y_label.R.T[1,2], pendulum.world.y_label.R.T[1,3]}, {pendulum.world.y_label.R.T[2,1], pendulum.world.y_label.R.T[2,2], pendulum.world.y_label.R.T[2,3]}, {pendulum.world.y_label.R.T[3,1], pendulum.world.y_label.R.T[3,2], pendulum.world.y_label.R.T[3,3]}}, {{pendulum.world.y_label.R_rel[1,1], pendulum.world.y_label.R_rel[1,2], pendulum.world.y_label.R_rel[1,3]}, {pendulum.world.y_label.R_rel[2,1], pendulum.world.y_label.R_rel[2,2], pendulum.world.y_label.R_rel[2,3]}, {pendulum.world.y_label.R_rel[3,1], pendulum.world.y_label.R_rel[3,2], pendulum.world.y_label.R_rel[3,3]}});
  pendulum.world.y_label.r_abs = {pendulum.world.y_label.r[1], pendulum.world.y_label.r[2], pendulum.world.y_label.r[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.y_label.R.T[1,1], pendulum.world.y_label.R.T[1,2], pendulum.world.y_label.R.T[1,3]}, {pendulum.world.y_label.R.T[2,1], pendulum.world.y_label.R.T[2,2], pendulum.world.y_label.R.T[2,3]}, {pendulum.world.y_label.R.T[3,1], pendulum.world.y_label.R.T[3,2], pendulum.world.y_label.R.T[3,3]}}, {pendulum.world.y_label.r_lines[1], pendulum.world.y_label.r_lines[2], pendulum.world.y_label.r_lines[3]});
  pendulum.world.y_label.cylinders[1].r = {pendulum.world.y_label.r_abs[1], pendulum.world.y_label.r_abs[2], pendulum.world.y_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.y_label.R_lines[1,1], pendulum.world.y_label.R_lines[1,2], pendulum.world.y_label.R_lines[1,3]}, {pendulum.world.y_label.R_lines[2,1], pendulum.world.y_label.R_lines[2,2], pendulum.world.y_label.R_lines[2,3]}, {pendulum.world.y_label.R_lines[3,1], pendulum.world.y_label.R_lines[3,2], pendulum.world.y_label.R_lines[3,3]}}, {pendulum.world.y_label.lines[1,1,1], pendulum.world.y_label.lines[1,1,2], 0.0});
  pendulum.world.y_label.cylinders[1].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.y_label.cylinders[1].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.y_label.R_rel[1,1], pendulum.world.y_label.R_rel[1,2], pendulum.world.y_label.R_rel[1,3]}, {pendulum.world.y_label.R_rel[2,1], pendulum.world.y_label.R_rel[2,2], pendulum.world.y_label.R_rel[2,3]}, {pendulum.world.y_label.R_rel[3,1], pendulum.world.y_label.R_rel[3,2], pendulum.world.y_label.R_rel[3,3]}}, {pendulum.world.y_label.lines[1,2,1] - pendulum.world.y_label.lines[1,1,1], pendulum.world.y_label.lines[1,2,2] - pendulum.world.y_label.lines[1,1,2], 0.0});
  pendulum.world.y_label.cylinders[1].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.y_label.cylinders[1].color = {/*Real*/(pendulum.world.y_label.color[1]), /*Real*/(pendulum.world.y_label.color[2]), /*Real*/(pendulum.world.y_label.color[3])};
  pendulum.world.y_label.cylinders[2].r = {pendulum.world.y_label.r_abs[1], pendulum.world.y_label.r_abs[2], pendulum.world.y_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.y_label.R_lines[1,1], pendulum.world.y_label.R_lines[1,2], pendulum.world.y_label.R_lines[1,3]}, {pendulum.world.y_label.R_lines[2,1], pendulum.world.y_label.R_lines[2,2], pendulum.world.y_label.R_lines[2,3]}, {pendulum.world.y_label.R_lines[3,1], pendulum.world.y_label.R_lines[3,2], pendulum.world.y_label.R_lines[3,3]}}, {pendulum.world.y_label.lines[2,1,1], pendulum.world.y_label.lines[2,1,2], 0.0});
  pendulum.world.y_label.cylinders[2].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.y_label.cylinders[2].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.y_label.R_rel[1,1], pendulum.world.y_label.R_rel[1,2], pendulum.world.y_label.R_rel[1,3]}, {pendulum.world.y_label.R_rel[2,1], pendulum.world.y_label.R_rel[2,2], pendulum.world.y_label.R_rel[2,3]}, {pendulum.world.y_label.R_rel[3,1], pendulum.world.y_label.R_rel[3,2], pendulum.world.y_label.R_rel[3,3]}}, {pendulum.world.y_label.lines[2,2,1] - pendulum.world.y_label.lines[2,1,1], pendulum.world.y_label.lines[2,2,2] - pendulum.world.y_label.lines[2,1,2], 0.0});
  pendulum.world.y_label.cylinders[2].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.y_label.cylinders[2].color = {/*Real*/(pendulum.world.y_label.color[1]), /*Real*/(pendulum.world.y_label.color[2]), /*Real*/(pendulum.world.y_label.color[3])};
  pendulum.world.z_arrowLine.r = {0.0, 0.0, 0.0};
  pendulum.world.z_arrowLine.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.z_arrowLine.lengthDirection = {0.0, 0.0, 1.0};
  pendulum.world.z_arrowLine.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.z_arrowLine.color = {/*Real*/(pendulum.world.axisColor_z[1]), /*Real*/(pendulum.world.axisColor_z[2]), /*Real*/(pendulum.world.axisColor_z[3])};
  pendulum.world.z_arrowHead.r = {0.0, 0.0, pendulum.world.lineLength};
  pendulum.world.z_arrowHead.r_shape = {0.0, 0.0, 0.0};
  pendulum.world.z_arrowHead.lengthDirection = {0.0, 0.0, 1.0};
  pendulum.world.z_arrowHead.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.z_arrowHead.color = {/*Real*/(pendulum.world.axisColor_z[1]), /*Real*/(pendulum.world.axisColor_z[2]), /*Real*/(pendulum.world.axisColor_z[3])};
  pendulum.world.z_label.r = {0.0, 0.0, 0.0};
  pendulum.world.z_label.r_lines = {0.0, 0.0, pendulum.world.labelStart};
  pendulum.world.z_label.n_x = {0.0, 0.0, 1.0};
  pendulum.world.z_label.n_y = {0.0, 1.0, 0.0};
  pendulum.world.z_label.lines = {{{0.0, 0.0}, {pendulum.world.scaledLabel, 0.0}}, {{0.0, pendulum.world.scaledLabel}, {pendulum.world.scaledLabel, pendulum.world.scaledLabel}}, {{0.0, pendulum.world.scaledLabel}, {pendulum.world.scaledLabel, 0.0}}};
  pendulum.world.z_label.color = {pendulum.world.axisColor_z[1], pendulum.world.axisColor_z[2], pendulum.world.axisColor_z[3]};
  pendulum.world.z_label.R_rel = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy({pendulum.world.z_label.n_x[1], pendulum.world.z_label.n_x[2], pendulum.world.z_label.n_x[3]}, {pendulum.world.z_label.n_y[1], pendulum.world.z_label.n_y[2], pendulum.world.z_label.n_y[3]});
  pendulum.world.z_label.R_lines = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation({{pendulum.world.z_label.R.T[1,1], pendulum.world.z_label.R.T[1,2], pendulum.world.z_label.R.T[1,3]}, {pendulum.world.z_label.R.T[2,1], pendulum.world.z_label.R.T[2,2], pendulum.world.z_label.R.T[2,3]}, {pendulum.world.z_label.R.T[3,1], pendulum.world.z_label.R.T[3,2], pendulum.world.z_label.R.T[3,3]}}, {{pendulum.world.z_label.R_rel[1,1], pendulum.world.z_label.R_rel[1,2], pendulum.world.z_label.R_rel[1,3]}, {pendulum.world.z_label.R_rel[2,1], pendulum.world.z_label.R_rel[2,2], pendulum.world.z_label.R_rel[2,3]}, {pendulum.world.z_label.R_rel[3,1], pendulum.world.z_label.R_rel[3,2], pendulum.world.z_label.R_rel[3,3]}});
  pendulum.world.z_label.r_abs = {pendulum.world.z_label.r[1], pendulum.world.z_label.r[2], pendulum.world.z_label.r[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R.T[1,1], pendulum.world.z_label.R.T[1,2], pendulum.world.z_label.R.T[1,3]}, {pendulum.world.z_label.R.T[2,1], pendulum.world.z_label.R.T[2,2], pendulum.world.z_label.R.T[2,3]}, {pendulum.world.z_label.R.T[3,1], pendulum.world.z_label.R.T[3,2], pendulum.world.z_label.R.T[3,3]}}, {pendulum.world.z_label.r_lines[1], pendulum.world.z_label.r_lines[2], pendulum.world.z_label.r_lines[3]});
  pendulum.world.z_label.cylinders[1].r = {pendulum.world.z_label.r_abs[1], pendulum.world.z_label.r_abs[2], pendulum.world.z_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_lines[1,1], pendulum.world.z_label.R_lines[1,2], pendulum.world.z_label.R_lines[1,3]}, {pendulum.world.z_label.R_lines[2,1], pendulum.world.z_label.R_lines[2,2], pendulum.world.z_label.R_lines[2,3]}, {pendulum.world.z_label.R_lines[3,1], pendulum.world.z_label.R_lines[3,2], pendulum.world.z_label.R_lines[3,3]}}, {pendulum.world.z_label.lines[1,1,1], pendulum.world.z_label.lines[1,1,2], 0.0});
  pendulum.world.z_label.cylinders[1].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.z_label.cylinders[1].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_rel[1,1], pendulum.world.z_label.R_rel[1,2], pendulum.world.z_label.R_rel[1,3]}, {pendulum.world.z_label.R_rel[2,1], pendulum.world.z_label.R_rel[2,2], pendulum.world.z_label.R_rel[2,3]}, {pendulum.world.z_label.R_rel[3,1], pendulum.world.z_label.R_rel[3,2], pendulum.world.z_label.R_rel[3,3]}}, {pendulum.world.z_label.lines[1,2,1] - pendulum.world.z_label.lines[1,1,1], pendulum.world.z_label.lines[1,2,2] - pendulum.world.z_label.lines[1,1,2], 0.0});
  pendulum.world.z_label.cylinders[1].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.z_label.cylinders[1].color = {/*Real*/(pendulum.world.z_label.color[1]), /*Real*/(pendulum.world.z_label.color[2]), /*Real*/(pendulum.world.z_label.color[3])};
  pendulum.world.z_label.cylinders[2].r = {pendulum.world.z_label.r_abs[1], pendulum.world.z_label.r_abs[2], pendulum.world.z_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_lines[1,1], pendulum.world.z_label.R_lines[1,2], pendulum.world.z_label.R_lines[1,3]}, {pendulum.world.z_label.R_lines[2,1], pendulum.world.z_label.R_lines[2,2], pendulum.world.z_label.R_lines[2,3]}, {pendulum.world.z_label.R_lines[3,1], pendulum.world.z_label.R_lines[3,2], pendulum.world.z_label.R_lines[3,3]}}, {pendulum.world.z_label.lines[2,1,1], pendulum.world.z_label.lines[2,1,2], 0.0});
  pendulum.world.z_label.cylinders[2].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.z_label.cylinders[2].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_rel[1,1], pendulum.world.z_label.R_rel[1,2], pendulum.world.z_label.R_rel[1,3]}, {pendulum.world.z_label.R_rel[2,1], pendulum.world.z_label.R_rel[2,2], pendulum.world.z_label.R_rel[2,3]}, {pendulum.world.z_label.R_rel[3,1], pendulum.world.z_label.R_rel[3,2], pendulum.world.z_label.R_rel[3,3]}}, {pendulum.world.z_label.lines[2,2,1] - pendulum.world.z_label.lines[2,1,1], pendulum.world.z_label.lines[2,2,2] - pendulum.world.z_label.lines[2,1,2], 0.0});
  pendulum.world.z_label.cylinders[2].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.z_label.cylinders[2].color = {/*Real*/(pendulum.world.z_label.color[1]), /*Real*/(pendulum.world.z_label.color[2]), /*Real*/(pendulum.world.z_label.color[3])};
  pendulum.world.z_label.cylinders[3].r = {pendulum.world.z_label.r_abs[1], pendulum.world.z_label.r_abs[2], pendulum.world.z_label.r_abs[3]} + Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_lines[1,1], pendulum.world.z_label.R_lines[1,2], pendulum.world.z_label.R_lines[1,3]}, {pendulum.world.z_label.R_lines[2,1], pendulum.world.z_label.R_lines[2,2], pendulum.world.z_label.R_lines[2,3]}, {pendulum.world.z_label.R_lines[3,1], pendulum.world.z_label.R_lines[3,2], pendulum.world.z_label.R_lines[3,3]}}, {pendulum.world.z_label.lines[3,1,1], pendulum.world.z_label.lines[3,1,2], 0.0});
  pendulum.world.z_label.cylinders[3].r_shape = {0.0, 0.0, 0.0};
  pendulum.world.z_label.cylinders[3].lengthDirection = Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1({{pendulum.world.z_label.R_rel[1,1], pendulum.world.z_label.R_rel[1,2], pendulum.world.z_label.R_rel[1,3]}, {pendulum.world.z_label.R_rel[2,1], pendulum.world.z_label.R_rel[2,2], pendulum.world.z_label.R_rel[2,3]}, {pendulum.world.z_label.R_rel[3,1], pendulum.world.z_label.R_rel[3,2], pendulum.world.z_label.R_rel[3,3]}}, {pendulum.world.z_label.lines[3,2,1] - pendulum.world.z_label.lines[3,1,1], pendulum.world.z_label.lines[3,2,2] - pendulum.world.z_label.lines[3,1,2], 0.0});
  pendulum.world.z_label.cylinders[3].widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.z_label.cylinders[3].color = {/*Real*/(pendulum.world.z_label.color[1]), /*Real*/(pendulum.world.z_label.color[2]), /*Real*/(pendulum.world.z_label.color[3])};
  pendulum.world.gravityArrowLine.r = {0.0, 0.0, 0.0};
  pendulum.world.gravityArrowLine.r_shape = {pendulum.world.gravityArrowTail[1], pendulum.world.gravityArrowTail[2], pendulum.world.gravityArrowTail[3]};
  pendulum.world.gravityArrowLine.lengthDirection = {pendulum.world.n[1], pendulum.world.n[2], pendulum.world.n[3]};
  pendulum.world.gravityArrowLine.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.gravityArrowLine.color = {/*Real*/(pendulum.world.gravityArrowColor[1]), /*Real*/(pendulum.world.gravityArrowColor[2]), /*Real*/(pendulum.world.gravityArrowColor[3])};
  pendulum.world.gravityArrowHead.r = {0.0, 0.0, 0.0};
  pendulum.world.gravityArrowHead.r_shape = {pendulum.world.gravityArrowTail[1], pendulum.world.gravityArrowTail[2] - pendulum.world.gravityLineLength, pendulum.world.gravityArrowTail[3]};
  pendulum.world.gravityArrowHead.lengthDirection = {pendulum.world.n[1], pendulum.world.n[2], pendulum.world.n[3]};
  pendulum.world.gravityArrowHead.widthDirection = {0.0, 1.0, 0.0};
  pendulum.world.gravityArrowHead.color = {/*Real*/(pendulum.world.gravityArrowColor[1]), /*Real*/(pendulum.world.gravityArrowColor[2]), /*Real*/(pendulum.world.gravityArrowColor[3])};
  assert(Modelica.Math.Vectors.length({pendulum.world.n[1], pendulum.world.n[2], pendulum.world.n[3]}) > 1e-10, "Parameter n of World object is wrong (length(n) > 0 required)");
  pendulum.world.frame_b.r_0[1] = 0.0;
  pendulum.world.frame_b.r_0[2] = 0.0;
  pendulum.world.frame_b.r_0[3] = 0.0;
  pendulum.world.frame_b.R.T[1,1] = 1.0;
  pendulum.world.frame_b.R.T[1,2] = 0.0;
  pendulum.world.frame_b.R.T[1,3] = 0.0;
  pendulum.world.frame_b.R.T[2,1] = 0.0;
  pendulum.world.frame_b.R.T[2,2] = 1.0;
  pendulum.world.frame_b.R.T[2,3] = 0.0;
  pendulum.world.frame_b.R.T[3,1] = 0.0;
  pendulum.world.frame_b.R.T[3,2] = 0.0;
  pendulum.world.frame_b.R.T[3,3] = 1.0;
  pendulum.world.frame_b.R.w[1] = 0.0;
  pendulum.world.frame_b.R.w[2] = 0.0;
  pendulum.world.frame_b.R.w[3] = 0.0;
  pendulum.pendulum.color = {0, 128, 255};
  pendulum.pendulum.body.sphereColor = {0, 128, 255};
  pendulum.pendulum.body.cylinderColor = {pendulum.pendulum.body.sphereColor[1], pendulum.pendulum.body.sphereColor[2], pendulum.pendulum.body.sphereColor[3]};
  pendulum.pendulum.body.r_0[1] = pendulum.pendulum.body.frame_a.r_0[1];
  pendulum.pendulum.body.r_0[2] = pendulum.pendulum.body.frame_a.r_0[2];
  pendulum.pendulum.body.r_0[3] = pendulum.pendulum.body.frame_a.r_0[3];
  pendulum.pendulum.body.Q[1] = 0.0;
  pendulum.pendulum.body.Q[2] = 0.0;
  pendulum.pendulum.body.Q[3] = 0.0;
  pendulum.pendulum.body.Q[4] = 1.0;
  pendulum.pendulum.body.phi[1] = 0.0;
  pendulum.pendulum.body.phi[2] = 0.0;
  pendulum.pendulum.body.phi[3] = 0.0;
  pendulum.pendulum.body.phi_d[1] = 0.0;
  pendulum.pendulum.body.phi_d[2] = 0.0;
  pendulum.pendulum.body.phi_d[3] = 0.0;
  pendulum.pendulum.body.phi_dd[1] = 0.0;
  pendulum.pendulum.body.phi_dd[2] = 0.0;
  pendulum.pendulum.body.phi_dd[3] = 0.0;
  pendulum.pendulum.body.g_0 = Modelica.Mechanics.MultiBody.World.gravityAcceleration({pendulum.pendulum.body.frame_a.r_0[1], pendulum.pendulum.body.frame_a.r_0[2], pendulum.pendulum.body.frame_a.r_0[3]} + Modelica.Mechanics.MultiBody.Frames.resolve1(pendulum.pendulum.body.frame_a.R, {pendulum.pendulum.body.r_CM[1], pendulum.pendulum.body.r_CM[2], pendulum.pendulum.body.r_CM[3]}), Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -9.81, 0.0}, 398600000000000.0);
  pendulum.pendulum.body.v_0[1] = der(pendulum.pendulum.body.frame_a.r_0[1]);
  pendulum.pendulum.body.v_0[2] = der(pendulum.pendulum.body.frame_a.r_0[2]);
  pendulum.pendulum.body.v_0[3] = der(pendulum.pendulum.body.frame_a.r_0[3]);
  pendulum.pendulum.body.a_0[1] = der(pendulum.pendulum.body.v_0[1]);
  pendulum.pendulum.body.a_0[2] = der(pendulum.pendulum.body.v_0[2]);
  pendulum.pendulum.body.a_0[3] = der(pendulum.pendulum.body.v_0[3]);
  pendulum.pendulum.body.w_a = Modelica.Mechanics.MultiBody.Frames.angularVelocity2(pendulum.pendulum.body.frame_a.R);
  pendulum.pendulum.body.z_a[1] = der(pendulum.pendulum.body.w_a[1]);
  pendulum.pendulum.body.z_a[2] = der(pendulum.pendulum.body.w_a[2]);
  pendulum.pendulum.body.z_a[3] = der(pendulum.pendulum.body.w_a[3]);
  pendulum.pendulum.body.frame_a.f = (Modelica.Mechanics.MultiBody.Frames.resolve2(pendulum.pendulum.body.frame_a.R, {pendulum.pendulum.body.a_0[1] - pendulum.pendulum.body.g_0[1], pendulum.pendulum.body.a_0[2] - pendulum.pendulum.body.g_0[2], pendulum.pendulum.body.a_0[3] - pendulum.pendulum.body.g_0[3]}) + {pendulum.pendulum.body.z_a[2] * pendulum.pendulum.body.r_CM[3] - pendulum.pendulum.body.z_a[3] * pendulum.pendulum.body.r_CM[2], pendulum.pendulum.body.z_a[3] * pendulum.pendulum.body.r_CM[1] - pendulum.pendulum.body.z_a[1] * pendulum.pendulum.body.r_CM[3], pendulum.pendulum.body.z_a[1] * pendulum.pendulum.body.r_CM[2] - pendulum.pendulum.body.z_a[2] * pendulum.pendulum.body.r_CM[1]} + {pendulum.pendulum.body.w_a[2] * (pendulum.pendulum.body.w_a[1] * pendulum.pendulum.body.r_CM[2] - pendulum.pendulum.body.w_a[2] * pendulum.pendulum.body.r_CM[1]) - pendulum.pendulum.body.w_a[3] * (pendulum.pendulum.body.w_a[3] * pendulum.pendulum.body.r_CM[1] - pendulum.pendulum.body.w_a[1] * pendulum.pendulum.body.r_CM[3]), pendulum.pendulum.body.w_a[3] * (pendulum.pendulum.body.w_a[2] * pendulum.pendulum.body.r_CM[3] - pendulum.pendulum.body.w_a[3] * pendulum.pendulum.body.r_CM[2]) - pendulum.pendulum.body.w_a[1] * (pendulum.pendulum.body.w_a[1] * pendulum.pendulum.body.r_CM[2] - pendulum.pendulum.body.w_a[2] * pendulum.pendulum.body.r_CM[1]), pendulum.pendulum.body.w_a[1] * (pendulum.pendulum.body.w_a[3] * pendulum.pendulum.body.r_CM[1] - pendulum.pendulum.body.w_a[1] * pendulum.pendulum.body.r_CM[3]) - pendulum.pendulum.body.w_a[2] * (pendulum.pendulum.body.w_a[2] * pendulum.pendulum.body.r_CM[3] - pendulum.pendulum.body.w_a[3] * pendulum.pendulum.body.r_CM[2])}) * pendulum.pendulum.body.m;
  pendulum.pendulum.body.frame_a.t[1] = pendulum.pendulum.body.I[1,1] * pendulum.pendulum.body.z_a[1] + pendulum.pendulum.body.I[1,2] * pendulum.pendulum.body.z_a[2] + pendulum.pendulum.body.I[1,3] * pendulum.pendulum.body.z_a[3] + pendulum.pendulum.body.w_a[2] * (pendulum.pendulum.body.I[3,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[3,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[3,3] * pendulum.pendulum.body.w_a[3]) - pendulum.pendulum.body.w_a[3] * (pendulum.pendulum.body.I[2,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[2,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[2,3] * pendulum.pendulum.body.w_a[3]) + pendulum.pendulum.body.r_CM[2] * pendulum.pendulum.body.frame_a.f[3] - pendulum.pendulum.body.r_CM[3] * pendulum.pendulum.body.frame_a.f[2];
  pendulum.pendulum.body.frame_a.t[2] = pendulum.pendulum.body.I[2,1] * pendulum.pendulum.body.z_a[1] + pendulum.pendulum.body.I[2,2] * pendulum.pendulum.body.z_a[2] + pendulum.pendulum.body.I[2,3] * pendulum.pendulum.body.z_a[3] + pendulum.pendulum.body.w_a[3] * (pendulum.pendulum.body.I[1,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[1,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[1,3] * pendulum.pendulum.body.w_a[3]) - pendulum.pendulum.body.w_a[1] * (pendulum.pendulum.body.I[3,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[3,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[3,3] * pendulum.pendulum.body.w_a[3]) + pendulum.pendulum.body.r_CM[3] * pendulum.pendulum.body.frame_a.f[1] - pendulum.pendulum.body.r_CM[1] * pendulum.pendulum.body.frame_a.f[3];
  pendulum.pendulum.body.frame_a.t[3] = pendulum.pendulum.body.I[3,1] * pendulum.pendulum.body.z_a[1] + pendulum.pendulum.body.I[3,2] * pendulum.pendulum.body.z_a[2] + pendulum.pendulum.body.I[3,3] * pendulum.pendulum.body.z_a[3] + pendulum.pendulum.body.w_a[1] * (pendulum.pendulum.body.I[2,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[2,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[2,3] * pendulum.pendulum.body.w_a[3]) - pendulum.pendulum.body.w_a[2] * (pendulum.pendulum.body.I[1,1] * pendulum.pendulum.body.w_a[1] + pendulum.pendulum.body.I[1,2] * pendulum.pendulum.body.w_a[2] + pendulum.pendulum.body.I[1,3] * pendulum.pendulum.body.w_a[3]) + pendulum.pendulum.body.r_CM[1] * pendulum.pendulum.body.frame_a.f[2] - pendulum.pendulum.body.r_CM[2] * pendulum.pendulum.body.frame_a.f[1];
  pendulum.pendulum.frameTranslation.color = {pendulum.pendulum.color[1], pendulum.pendulum.color[2], pendulum.pendulum.color[3]};
  pendulum.pendulum.frameTranslation.shape.r = {pendulum.pendulum.frameTranslation.frame_a.r_0[1], pendulum.pendulum.frameTranslation.frame_a.r_0[2], pendulum.pendulum.frameTranslation.frame_a.r_0[3]};
  pendulum.pendulum.frameTranslation.shape.r_shape = {pendulum.pendulum.frameTranslation.r_shape[1], pendulum.pendulum.frameTranslation.r_shape[2], pendulum.pendulum.frameTranslation.r_shape[3]};
  pendulum.pendulum.frameTranslation.shape.lengthDirection = {pendulum.pendulum.frameTranslation.lengthDirection[1], pendulum.pendulum.frameTranslation.lengthDirection[2], pendulum.pendulum.frameTranslation.lengthDirection[3]};
  pendulum.pendulum.frameTranslation.shape.widthDirection = {pendulum.pendulum.frameTranslation.widthDirection[1], pendulum.pendulum.frameTranslation.widthDirection[2], pendulum.pendulum.frameTranslation.widthDirection[3]};
  pendulum.pendulum.frameTranslation.shape.color = {/*Real*/(pendulum.pendulum.frameTranslation.color[1]), /*Real*/(pendulum.pendulum.frameTranslation.color[2]), /*Real*/(pendulum.pendulum.frameTranslation.color[3])};
  pendulum.pendulum.frameTranslation.frame_b.r_0 = pendulum.pendulum.frameTranslation.frame_a.r_0 + Modelica.Mechanics.MultiBody.Frames.resolve1(pendulum.pendulum.frameTranslation.frame_a.R, {pendulum.pendulum.frameTranslation.r[1], pendulum.pendulum.frameTranslation.r[2], pendulum.pendulum.frameTranslation.r[3]});
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,3];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,3];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,3];
  pendulum.pendulum.frameTranslation.frame_b.R.w[1] = pendulum.pendulum.frameTranslation.frame_a.R.w[1];
  pendulum.pendulum.frameTranslation.frame_b.R.w[2] = pendulum.pendulum.frameTranslation.frame_a.R.w[2];
  pendulum.pendulum.frameTranslation.frame_b.R.w[3] = pendulum.pendulum.frameTranslation.frame_a.R.w[3];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.f[1] + pendulum.pendulum.frameTranslation.frame_b.f[1];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.f[2] + pendulum.pendulum.frameTranslation.frame_b.f[2];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.f[3] + pendulum.pendulum.frameTranslation.frame_b.f[3];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.t[1] + pendulum.pendulum.frameTranslation.frame_b.t[1] + pendulum.pendulum.frameTranslation.r[2] * pendulum.pendulum.frameTranslation.frame_b.f[3] - pendulum.pendulum.frameTranslation.r[3] * pendulum.pendulum.frameTranslation.frame_b.f[2];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.t[2] + pendulum.pendulum.frameTranslation.frame_b.t[2] + pendulum.pendulum.frameTranslation.r[3] * pendulum.pendulum.frameTranslation.frame_b.f[1] - pendulum.pendulum.frameTranslation.r[1] * pendulum.pendulum.frameTranslation.frame_b.f[3];
  0.0 = pendulum.pendulum.frameTranslation.frame_a.t[3] + pendulum.pendulum.frameTranslation.frame_b.t[3] + pendulum.pendulum.frameTranslation.r[1] * pendulum.pendulum.frameTranslation.frame_b.f[2] - pendulum.pendulum.frameTranslation.r[2] * pendulum.pendulum.frameTranslation.frame_b.f[1];
  pendulum.pendulum.r_0[1] = pendulum.pendulum.frame_a.r_0[1];
  pendulum.pendulum.r_0[2] = pendulum.pendulum.frame_a.r_0[2];
  pendulum.pendulum.r_0[3] = pendulum.pendulum.frame_a.r_0[3];
  pendulum.pendulum.v_0[1] = der(pendulum.pendulum.r_0[1]);
  pendulum.pendulum.v_0[2] = der(pendulum.pendulum.r_0[2]);
  pendulum.pendulum.v_0[3] = der(pendulum.pendulum.r_0[3]);
  pendulum.pendulum.a_0[1] = der(pendulum.pendulum.v_0[1]);
  pendulum.pendulum.a_0[2] = der(pendulum.pendulum.v_0[2]);
  pendulum.pendulum.a_0[3] = der(pendulum.pendulum.v_0[3]);
  assert(pendulum.pendulum.innerDiameter < pendulum.pendulum.diameter, "parameter innerDiameter is greater than parameter diameter");
  pendulum.revolute.cylinderColor = {255, 0, 0};
  pendulum.revolute.fixed.flange.phi = pendulum.revolute.fixed.phi0;
  pendulum.revolute.internalAxis.flange.tau = pendulum.revolute.internalAxis.tau;
  pendulum.revolute.internalAxis.flange.phi = pendulum.revolute.internalAxis.phi;
  pendulum.revolute.cylinder.r = {pendulum.revolute.frame_a.r_0[1], pendulum.revolute.frame_a.r_0[2], pendulum.revolute.frame_a.r_0[3]};
  pendulum.revolute.cylinder.r_shape = {(-0.5) * pendulum.revolute.e[1] * pendulum.revolute.cylinderLength, (-0.5) * pendulum.revolute.e[2] * pendulum.revolute.cylinderLength, (-0.5) * pendulum.revolute.e[3] * pendulum.revolute.cylinderLength};
  pendulum.revolute.cylinder.lengthDirection = {pendulum.revolute.e[1], pendulum.revolute.e[2], pendulum.revolute.e[3]};
  pendulum.revolute.cylinder.widthDirection = {0.0, 1.0, 0.0};
  pendulum.revolute.cylinder.color = {/*Real*/(pendulum.revolute.cylinderColor[1]), /*Real*/(pendulum.revolute.cylinderColor[2]), /*Real*/(pendulum.revolute.cylinderColor[3])};
  pendulum.revolute.constantTorque.tau = -pendulum.revolute.constantTorque.flange.tau;
  pendulum.revolute.constantTorque.tau = pendulum.revolute.constantTorque.tau_constant;
  pendulum.revolute.constantTorque.phi = pendulum.revolute.constantTorque.flange.phi - pendulum.revolute.constantTorque.phi_support;
  pendulum.revolute.constantTorque.phi_support = 0.0;
  pendulum.revolute.angle = pendulum.revolute.phi;
  pendulum.revolute.w = der(pendulum.revolute.phi);
  pendulum.revolute.a = der(pendulum.revolute.w);
  pendulum.revolute.frame_b.r_0[1] = pendulum.revolute.frame_a.r_0[1];
  pendulum.revolute.frame_b.r_0[2] = pendulum.revolute.frame_a.r_0[2];
  pendulum.revolute.frame_b.r_0[3] = pendulum.revolute.frame_a.r_0[3];
  pendulum.revolute.R_rel = Modelica.Mechanics.MultiBody.Frames.planarRotation({pendulum.revolute.e[1], pendulum.revolute.e[2], pendulum.revolute.e[3]}, pendulum.revolute.phi, pendulum.revolute.w);
  pendulum.revolute.frame_b.R = Modelica.Mechanics.MultiBody.Frames.absoluteRotation(pendulum.revolute.frame_a.R, pendulum.revolute.R_rel);
  pendulum.revolute.frame_a.f = -Modelica.Mechanics.MultiBody.Frames.resolve1(pendulum.revolute.R_rel, {pendulum.revolute.frame_b.f[1], pendulum.revolute.frame_b.f[2], pendulum.revolute.frame_b.f[3]});
  pendulum.revolute.frame_a.t = -Modelica.Mechanics.MultiBody.Frames.resolve1(pendulum.revolute.R_rel, {pendulum.revolute.frame_b.t[1], pendulum.revolute.frame_b.t[2], pendulum.revolute.frame_b.t[3]});
  pendulum.revolute.tau = (-pendulum.revolute.frame_b.t[3]) * pendulum.revolute.e[3] - pendulum.revolute.frame_b.t[1] * pendulum.revolute.e[1] - pendulum.revolute.frame_b.t[2] * pendulum.revolute.e[2];
  pendulum.revolute.phi = pendulum.revolute.internalAxis.phi;
  pendulum.world.frame_b.t[1] + pendulum.revolute.frame_a.t[1] = 0.0;
  pendulum.world.frame_b.t[2] + pendulum.revolute.frame_a.t[2] = 0.0;
  pendulum.world.frame_b.t[3] + pendulum.revolute.frame_a.t[3] = 0.0;
  pendulum.world.frame_b.f[1] + pendulum.revolute.frame_a.f[1] = 0.0;
  pendulum.world.frame_b.f[2] + pendulum.revolute.frame_a.f[2] = 0.0;
  pendulum.world.frame_b.f[3] + pendulum.revolute.frame_a.f[3] = 0.0;
  pendulum.pendulum.frame_a.t[1] + pendulum.revolute.frame_b.t[1] = 0.0;
  pendulum.pendulum.frame_a.t[2] + pendulum.revolute.frame_b.t[2] = 0.0;
  pendulum.pendulum.frame_a.t[3] + pendulum.revolute.frame_b.t[3] = 0.0;
  pendulum.pendulum.frame_a.f[1] + pendulum.revolute.frame_b.f[1] = 0.0;
  pendulum.pendulum.frame_a.f[2] + pendulum.revolute.frame_b.f[2] = 0.0;
  pendulum.pendulum.frame_a.f[3] + pendulum.revolute.frame_b.f[3] = 0.0;
  pendulum.pendulum.frame_b.t[1] = 0.0;
  pendulum.pendulum.frame_b.t[2] = 0.0;
  pendulum.pendulum.frame_b.t[3] = 0.0;
  pendulum.pendulum.frame_b.f[1] = 0.0;
  pendulum.pendulum.frame_b.f[2] = 0.0;
  pendulum.pendulum.frame_b.f[3] = 0.0;
  (-pendulum.pendulum.frame_a.t[1]) + pendulum.pendulum.frameTranslation.frame_a.t[1] + pendulum.pendulum.body.frame_a.t[1] = 0.0;
  (-pendulum.pendulum.frame_a.t[2]) + pendulum.pendulum.frameTranslation.frame_a.t[2] + pendulum.pendulum.body.frame_a.t[2] = 0.0;
  (-pendulum.pendulum.frame_a.t[3]) + pendulum.pendulum.frameTranslation.frame_a.t[3] + pendulum.pendulum.body.frame_a.t[3] = 0.0;
  (-pendulum.pendulum.frame_a.f[1]) + pendulum.pendulum.frameTranslation.frame_a.f[1] + pendulum.pendulum.body.frame_a.f[1] = 0.0;
  (-pendulum.pendulum.frame_a.f[2]) + pendulum.pendulum.frameTranslation.frame_a.f[2] + pendulum.pendulum.body.frame_a.f[2] = 0.0;
  (-pendulum.pendulum.frame_a.f[3]) + pendulum.pendulum.frameTranslation.frame_a.f[3] + pendulum.pendulum.body.frame_a.f[3] = 0.0;
  (-pendulum.pendulum.frame_b.t[1]) + pendulum.pendulum.frameTranslation.frame_b.t[1] = 0.0;
  (-pendulum.pendulum.frame_b.t[2]) + pendulum.pendulum.frameTranslation.frame_b.t[2] = 0.0;
  (-pendulum.pendulum.frame_b.t[3]) + pendulum.pendulum.frameTranslation.frame_b.t[3] = 0.0;
  (-pendulum.pendulum.frame_b.f[1]) + pendulum.pendulum.frameTranslation.frame_b.f[1] = 0.0;
  (-pendulum.pendulum.frame_b.f[2]) + pendulum.pendulum.frameTranslation.frame_b.f[2] = 0.0;
  (-pendulum.pendulum.frame_b.f[3]) + pendulum.pendulum.frameTranslation.frame_b.f[3] = 0.0;
  pendulum.pendulum.body.frame_a.R.T[1,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,1];
  pendulum.pendulum.body.frame_a.R.T[1,1] = pendulum.pendulum.frame_a.R.T[1,1];
  pendulum.pendulum.body.frame_a.R.T[1,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,2];
  pendulum.pendulum.body.frame_a.R.T[1,2] = pendulum.pendulum.frame_a.R.T[1,2];
  pendulum.pendulum.body.frame_a.R.T[1,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[1,3];
  pendulum.pendulum.body.frame_a.R.T[1,3] = pendulum.pendulum.frame_a.R.T[1,3];
  pendulum.pendulum.body.frame_a.R.T[2,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,1];
  pendulum.pendulum.body.frame_a.R.T[2,1] = pendulum.pendulum.frame_a.R.T[2,1];
  pendulum.pendulum.body.frame_a.R.T[2,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,2];
  pendulum.pendulum.body.frame_a.R.T[2,2] = pendulum.pendulum.frame_a.R.T[2,2];
  pendulum.pendulum.body.frame_a.R.T[2,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[2,3];
  pendulum.pendulum.body.frame_a.R.T[2,3] = pendulum.pendulum.frame_a.R.T[2,3];
  pendulum.pendulum.body.frame_a.R.T[3,1] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,1];
  pendulum.pendulum.body.frame_a.R.T[3,1] = pendulum.pendulum.frame_a.R.T[3,1];
  pendulum.pendulum.body.frame_a.R.T[3,2] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,2];
  pendulum.pendulum.body.frame_a.R.T[3,2] = pendulum.pendulum.frame_a.R.T[3,2];
  pendulum.pendulum.body.frame_a.R.T[3,3] = pendulum.pendulum.frameTranslation.frame_a.R.T[3,3];
  pendulum.pendulum.body.frame_a.R.T[3,3] = pendulum.pendulum.frame_a.R.T[3,3];
  pendulum.pendulum.body.frame_a.R.w[1] = pendulum.pendulum.frameTranslation.frame_a.R.w[1];
  pendulum.pendulum.body.frame_a.R.w[1] = pendulum.pendulum.frame_a.R.w[1];
  pendulum.pendulum.body.frame_a.R.w[2] = pendulum.pendulum.frameTranslation.frame_a.R.w[2];
  pendulum.pendulum.body.frame_a.R.w[2] = pendulum.pendulum.frame_a.R.w[2];
  pendulum.pendulum.body.frame_a.R.w[3] = pendulum.pendulum.frameTranslation.frame_a.R.w[3];
  pendulum.pendulum.body.frame_a.R.w[3] = pendulum.pendulum.frame_a.R.w[3];
  pendulum.pendulum.body.frame_a.r_0[1] = pendulum.pendulum.frameTranslation.frame_a.r_0[1];
  pendulum.pendulum.body.frame_a.r_0[1] = pendulum.pendulum.frame_a.r_0[1];
  pendulum.pendulum.body.frame_a.r_0[2] = pendulum.pendulum.frameTranslation.frame_a.r_0[2];
  pendulum.pendulum.body.frame_a.r_0[2] = pendulum.pendulum.frame_a.r_0[2];
  pendulum.pendulum.body.frame_a.r_0[3] = pendulum.pendulum.frameTranslation.frame_a.r_0[3];
  pendulum.pendulum.body.frame_a.r_0[3] = pendulum.pendulum.frame_a.r_0[3];
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,1] = pendulum.pendulum.frame_b.R.T[1,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,2] = pendulum.pendulum.frame_b.R.T[1,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[1,3] = pendulum.pendulum.frame_b.R.T[1,3];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,1] = pendulum.pendulum.frame_b.R.T[2,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,2] = pendulum.pendulum.frame_b.R.T[2,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[2,3] = pendulum.pendulum.frame_b.R.T[2,3];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,1] = pendulum.pendulum.frame_b.R.T[3,1];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,2] = pendulum.pendulum.frame_b.R.T[3,2];
  pendulum.pendulum.frameTranslation.frame_b.R.T[3,3] = pendulum.pendulum.frame_b.R.T[3,3];
  pendulum.pendulum.frameTranslation.frame_b.R.w[1] = pendulum.pendulum.frame_b.R.w[1];
  pendulum.pendulum.frameTranslation.frame_b.R.w[2] = pendulum.pendulum.frame_b.R.w[2];
  pendulum.pendulum.frameTranslation.frame_b.R.w[3] = pendulum.pendulum.frame_b.R.w[3];
  pendulum.pendulum.frameTranslation.frame_b.r_0[1] = pendulum.pendulum.frame_b.r_0[1];
  pendulum.pendulum.frameTranslation.frame_b.r_0[2] = pendulum.pendulum.frame_b.r_0[2];
  pendulum.pendulum.frameTranslation.frame_b.r_0[3] = pendulum.pendulum.frame_b.r_0[3];
  pendulum.revolute.fixed.flange.tau = 0.0;
  pendulum.revolute.constantTorque.flange.tau + pendulum.revolute.internalAxis.flange.tau = 0.0;
  pendulum.revolute.constantTorque.flange.phi = pendulum.revolute.internalAxis.flange.phi;
  pendulum.pendulum.frame_a.R.T[1,1] = pendulum.revolute.frame_b.R.T[1,1];
  pendulum.pendulum.frame_a.R.T[1,2] = pendulum.revolute.frame_b.R.T[1,2];
  pendulum.pendulum.frame_a.R.T[1,3] = pendulum.revolute.frame_b.R.T[1,3];
  pendulum.pendulum.frame_a.R.T[2,1] = pendulum.revolute.frame_b.R.T[2,1];
  pendulum.pendulum.frame_a.R.T[2,2] = pendulum.revolute.frame_b.R.T[2,2];
  pendulum.pendulum.frame_a.R.T[2,3] = pendulum.revolute.frame_b.R.T[2,3];
  pendulum.pendulum.frame_a.R.T[3,1] = pendulum.revolute.frame_b.R.T[3,1];
  pendulum.pendulum.frame_a.R.T[3,2] = pendulum.revolute.frame_b.R.T[3,2];
  pendulum.pendulum.frame_a.R.T[3,3] = pendulum.revolute.frame_b.R.T[3,3];
  pendulum.pendulum.frame_a.R.w[1] = pendulum.revolute.frame_b.R.w[1];
  pendulum.pendulum.frame_a.R.w[2] = pendulum.revolute.frame_b.R.w[2];
  pendulum.pendulum.frame_a.R.w[3] = pendulum.revolute.frame_b.R.w[3];
  pendulum.pendulum.frame_a.r_0[1] = pendulum.revolute.frame_b.r_0[1];
  pendulum.pendulum.frame_a.r_0[2] = pendulum.revolute.frame_b.r_0[2];
  pendulum.pendulum.frame_a.r_0[3] = pendulum.revolute.frame_b.r_0[3];
  pendulum.revolute.frame_a.R.T[1,1] = pendulum.world.frame_b.R.T[1,1];
  pendulum.revolute.frame_a.R.T[1,2] = pendulum.world.frame_b.R.T[1,2];
  pendulum.revolute.frame_a.R.T[1,3] = pendulum.world.frame_b.R.T[1,3];
  pendulum.revolute.frame_a.R.T[2,1] = pendulum.world.frame_b.R.T[2,1];
  pendulum.revolute.frame_a.R.T[2,2] = pendulum.world.frame_b.R.T[2,2];
  pendulum.revolute.frame_a.R.T[2,3] = pendulum.world.frame_b.R.T[2,3];
  pendulum.revolute.frame_a.R.T[3,1] = pendulum.world.frame_b.R.T[3,1];
  pendulum.revolute.frame_a.R.T[3,2] = pendulum.world.frame_b.R.T[3,2];
  pendulum.revolute.frame_a.R.T[3,3] = pendulum.world.frame_b.R.T[3,3];
  pendulum.revolute.frame_a.R.w[1] = pendulum.world.frame_b.R.w[1];
  pendulum.revolute.frame_a.R.w[2] = pendulum.world.frame_b.R.w[2];
  pendulum.revolute.frame_a.R.w[3] = pendulum.world.frame_b.R.w[3];
  pendulum.revolute.frame_a.r_0[1] = pendulum.world.frame_b.r_0[1];
  pendulum.revolute.frame_a.r_0[2] = pendulum.world.frame_b.r_0[2];
  pendulum.revolute.frame_a.r_0[3] = pendulum.world.frame_b.r_0[3];
end InnerOuterSamePrefix;
Notification: Skipped loading package Complex (3.2.1,default) using MODELICAPATH /var/lib/jenkins2/ws/OpenModelica_maintenance_v1.14_2/build/bin/../lib/omlibrary (uses-annotation may be wrong).


Equation mismatch: diff says:
--- /tmp/omc-rtest-unknown/flattening/modelica/scoping/InnerOuterSamePrefix.mo_temp5589/equations-expected2019-10-27 11:25:20.959764075 +0000
+++ /tmp/omc-rtest-unknown/flattening/modelica/scoping/InnerOuterSamePrefix.mo_temp5589/equations-got2019-10-27 11:25:21.867753992 +0000
@@ -1874,7 +1874,7 @@
 pendulum.revolute.frame_a.R.w[3] = pendulum.world.frame_b.R.w[3];
 pendulum.revolute.frame_a.r_0[1] = pendulum.world.frame_b.r_0[1];
 pendulum.revolute.frame_a.r_0[2] = pendulum.world.frame_b.r_0[2];
 pendulum.revolute.frame_a.r_0[3] = pendulum.world.frame_b.r_0[3];
 end InnerOuterSamePrefix;
-Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
+Notification: Skipped loading package Complex (3.2.1,default) using MODELICAPATH /var/lib/jenkins2/ws/OpenModelica_maintenance_v1.14_2/build/bin/../lib/omlibrary (uses-annotation may be wrong).
 

Equation mismatch: omc-diff says:
Failed 'A' 'S'
Line 1879: Text differs:
expected: Notification: Automatically loaded package Complex 
got:      Notification: Skipped loading package Complex (

== 1 out of 1 tests failed [flattening/modelica/scoping/InnerOuterSamePrefix.mo_temp5589, time: 1]