Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Modelica.Mechanics.MultiBody.Frames.Quaternions.Orientation.equalityConstraint #1817

Closed
modelica-trac-importer opened this issue Jan 15, 2017 · 4 comments
Assignees
Labels
bug Critical/severe issue L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody P: low Low priority issue
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by hansolsson on 3 Nov 2015 10:43 UTC
Modelica.Mechanics.MultiBody.Frames.Quaternions.Orientation.equalityConstraint seems to allow invalid ("mirrored") solutions.

E.g.:

Modelica.Mechanics.MultiBody.Frames.Quaternions.Orientation.equalityConstraint({1,0,0,0}, {-1,0,0,0});
# {0.0, 0.0, 0.0}
Modelica.Mechanics.MultiBody.Frames.Quaternions.orientationConstraint({1,0,0,0});
# {0.0}
Modelica.Mechanics.MultiBody.Frames.Quaternions.orientationConstraint({-1,0,0,0});
# {0.0}

They are generated from planarRotation({+/-1,0,0}, pi);

One solution would be (similarly to rotation matrices) to use atan2(..., Q1*Q2).

The "obvious" solution:

residue := [Q1[4], Q1[3], -Q1[2], -Q1[1]; -Q1[3], Q1[4], Q1[1], Q1[1], Q1[2], Q1[3], Q1[4]]*Q2-{0,0,1}

(assuming it has a unique solution) leads to an illconditioned Jacobian in combination with the orientationConstraint.

This is not good at all, but the quaternion class is not used in the connectors, which explains the low priority and high severity

I believe I earlier reported a similar issue in
Modelica.Mechanics.MultiBody.Frames.Orientation.equalityConstraint
which has now been corrected, but couldn't find the ticket-number.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1817

@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody P: low Low priority issue labels Jan 15, 2017
@modelica-trac-importer
Copy link
Author

Comment by beutlich on 3 Nov 2015 13:47 UTC
Replying to [ticket:1817 hansolsson]:

I believe I earlier reported a similar issue in
Modelica.Mechanics.MultiBody.Frames.Orientation.equalityConstraint
which has now been corrected, but couldn't find the ticket-number.

#313 perhaps?

@modelica-trac-importer
Copy link
Author

Comment by hansolsson on 3 Nov 2015 14:24 UTC
Replying to [comment:1 beutlich]:

Replying to [ticket:1817 hansolsson]:

I believe I earlier reported a similar issue in
Modelica.Mechanics.MultiBody.Frames.Orientation.equalityConstraint
which has now been corrected, but couldn't find the ticket-number.
#313 perhaps?

No, and it turns out that it wasn't reported on trac.modelica.org for the obvious reason that the error was from 2007-07-03 which predates trac.modelica.org by a few months.

It was still committed to svn.modelica.org.

@modelica-trac-importer
Copy link
Author

Comment by otter on 12 Jan 2016 16:13 UTC
Fixed in ca2852e as suggested

@modelica-trac-importer
Copy link
Author

Changelog modified by otter on 12 Jan 2016 16:13 UTC
Quaternions equality constraints formulation improved to avoid wrong "mirror" solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody P: low Low priority issue
Projects
None yet
Development

No branches or pull requests

2 participants