ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Weird formulas in some spherical joints
Modelica.Mechanics.MultiBody.Joints.SphericalSpherical and Modelica.Mechanics.MultiBody.Joints.UniversalSpherical contain formulas of the kind:
if kinematicConstraint then
rRod_0 = transpose(frame_b.R.T)*(frame_b.R.T*frame_b.r_0) - transpose(
frame_a.R.T)*(frame_a.R.T*frame_a.r_0);
else
rRod_0 = frame_b.r_0 - frame_a.r_0;
end if;
To me this needs additional explanations. The T matrices should be orthogonal matrices meaning transpose(T)*T=identity(3), and thus the two variants should be identical. Is it just making life harder, or is there some purpose behind this? (If so it should probably be explained.)
In MSL examples the odd code doesn't change anything since kinematicConstraint is always false. And in ModelicaTest the results seemed unchanged if merging them, and the only change was the sizes of the systems of equations - especially for the models that compare the two variants.
As far as I can tell it has always been like this.