Repository navigation
Fix the angular velocity returned by Frames.from_T_inv - #4855
Open
hubertus65 wants to merge 1 commit into
Open
hubertus65 wants to merge 1 commit into
hubertus65 wants to merge 1 commit into
Conversation
The input w is the angular velocity of frame 1 w.r.t. frame 2, resolved in frame 1 (skew(w) = T_inv*der(transpose(T_inv))). The orientation object stores the angular velocity of frame 2 w.r.t. frame 1, resolved in frame 2, which is -transpose(T_inv)*w. Returning -w is only correct when w is parallel to the rotation axis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
I assume an alternative would be to just update the documentation to be consistent with current behavior. |
hubertus65
added a commit
to hubertus65/ModelicaStandardLibrary
that referenced
this pull request
Nov 3, 2026
The case lists now run on Modelon Impact with this branch's Modelica, ModelicaServices, Complex and ModelicaTest instead of Impact's built-in MSL 4.1.0 (see ReviewResults/README.md for the workspace setup). - Move AnalogOpAmpLimited, MutualInductor, TestQuadrature, TestFramesSmallRotation, ComplexStep and ComplexMathConjugateIfExpressions back from OpenModelica to the Impact lists, and remove the emptied OpenModelica lists of ComplexBlocks, Electrical, Math and Mechanics. - Enable TestLAPACKdhgeqz (PR modelica#4854) and TestFramesFromTinv (PR modelica#4855). - Regenerate baselines, results, HTML reports (25 cases per page) and CSV. All checks of the 14 Impact case lists pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Success: Regression testing passed successfully. |
Contributor
|
It seems like Modelica.Mechanics.MultiBody.Frames.from_T_inv is never used in Modelica or ModelicaTest. Such, the regression-testing is without any meaning. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modelica.Mechanics.MultiBody.Frames.from_T_inv(T_inv, w)documents its inputwas the angular velocity of frame 1 with respect to frame 2, resolved in frame 1 (skew(w) = T_inv*der(transpose(T_inv))). The orientation object storesR.w, the angular velocity of frame 2 with respect to frame 1, resolved in frame 2 (skew(R.w) = T*der(transpose(T))withT = transpose(T_inv)).Differentiating
transpose(T_inv)*T_inv = identity(3)givesso
R.w = -transpose(T_inv)*w. The function returnedR.w = -w, which is only correct whenwis parallel to the rotation axis (e.g. planar rotations).Frames.inverseRotationalready does the analogous change of frame,w = -resolve1(R, R.w).This PR changes
to
No model in the MSL calls
Frames.from_T_inv, so no reference results change.Test: with
T = axesRotations({1, 2, 3}, {0.3, -0.2, 0.5})andw = {0.1, 0.2, 0.3},from_T_inv(transpose(T), w)now returnsR.T = TandR.w = -T*w. Found by a new ModelicaTest coverage test, which will be proposed separately.🤖 Generated with Claude Code