Opened 14 years ago
Last modified 14 years ago
#1275 closed defect (fixed)
Flattenning of Modelica.Mechanics.MultiBody does not work for all components
Reported by: | Jan Brugård | Owned by: | Jan Brugård |
---|---|---|---|
Priority: | blocker | Milestone: | Red October |
Component: | Version: | ||
Keywords: | Cc: | Jan Brugård, Per Östlund |
Description
The following models do not work to check, because flattening fails:
Check of Modelica.Mechanics.MultiBody.Frames.Quaternions.multipleResolve1 failed Check of Modelica.Mechanics.MultiBody.Frames.Quaternions.multipleResolve2 failed Check of Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation failed Check of Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve1 failed Check of Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve2 failed Check of Modelica.Mechanics.MultiBody.Interfaces.PartialLineForce failed Check of Modelica.Mechanics.MultiBody.Types.RotationSequence failed
Attachments (2)
Change History (11)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
comment:3 by , 14 years ago
RotationSequence fixed in r6134.
checkModel now works on all MultiBody models, see test case libraries/msl32/Modelica.Mechanics.MultiBody.
by , 14 years ago
Attachment: | planarRotationTotal.mo added |
---|
Run the mos file and check the results. OpenModelica produces the following for me:
true instantiateDaeFunction failed for Math.sin in scope: Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation instantiateDaeFunction failed for Math.sin in scope: Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation "Error: No matching function found for Math.sin(angle / 2.0) of type function(x:Real) => Real in component <NO COMPONENT>, candidates are function(x:Real) => Real Error: Class Math.sin not found in scope Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation. Error: Wrong type or wrong number of arguments to vector([e * Math.sin(angle / 2);Math.cos(angle / 2)])'. (in component <NO COMPONENT>) Error: No matching function found for Math.sin(angle / 2.0) of type function(x:Real) => Real in component <NO COMPONENT>, candidates are function(x:Real) => Real Error: Class Math.sin not found in scope Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation. Error: Wrong type or wrong number of arguments to vector([e * Math.sin(angle / 2);Math.cos(angle / 2)])'. (in component <NO COMPONENT>) " ""
So it does not seem to work as suggested, hence reopening this ticket.
by , 14 years ago
Attachment: | planarRotationTotal.mos added |
---|
Run the mos file and check the results. OpenModelica produces the following for me:
true instantiateDaeFunction failed for Math.sin in scope: Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation instantiateDaeFunction failed for Math.sin in scope: Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation "Error: No matching function found for Math.sin(angle / 2.0) of type function(x:Real) => Real in component <NO COMPONENT>, candidates are function(x:Real) => Real Error: Class Math.sin not found in scope Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation. Error: Wrong type or wrong number of arguments to vector([e * Math.sin(angle / 2);Math.cos(angle / 2)])'. (in component <NO COMPONENT>) Error: No matching function found for Math.sin(angle / 2.0) of type function(x:Real) => Real in component <NO COMPONENT>, candidates are function(x:Real) => Real Error: Class Math.sin not found in scope Modelica.Mechanics.MultiBody.Frames.Quaternions.planarRotation. Error: Wrong type or wrong number of arguments to vector([e * Math.sin(angle / 2);Math.cos(angle / 2)])'. (in component <NO COMPONENT>) " ""
So it does not seem to work as suggested, hence reopening this ticket.
comment:4 by , 14 years ago
See attachment, planarRotation still seems to produce errors. I tested this with an OpenModelica compiled for mingw some days old.
comment:5 by , 14 years ago
I am unable to reproduce this. checkModel of planarRotation succeeds without any errors with the latest trunk, and has done so since I fixed this bug and added the test case.
comment:6 by , 14 years ago
Your attached model is not TOTAL (not complete).
In package Math
you're missing the sin
function,
i.e. Math.sin
and this is the error you're getting.
Fix your dependency analysis!
comment:7 by , 14 years ago
OpenModelica suffers from the same problem. The only reason you do not notice it is because you do not do a dependency analysis when you save a total model. You collect and save everything. Anyways, I fixed the problem which was in OpenModelica Absyn.traverseExp, see commit/revision 6387. Closing this ticket.
comment:8 by , 14 years ago
We know that OpenModelica has the same problem.
But as we never used the dependency analysis the problem doesn't exist.
I would really suggest you do also a checking if is really faster do do the dependency
instead of directly instantiating the class. For me it seems *really really* weird that
is faster to do dependency+smaller instantiation rather than directly the full instantiation.
The problem is not the strategy, which is sound, the problem is with the implementation
which does instantiation during dependency, so:
Dependency analysis includes instantiation O(dependency) = O(smaller instantiation) + O(traverse) The real question is: O(dependency) + O(smaller instantiation) > O(full instantiation) or O(dependency) + O(smaller instantiation) < O(full instantiation) ??
I don't know the answer to this question, but you could run some checks.
From what tests I ran, doing the dependency analysis is *always* slower than
doing full instantiation directly, but I might be wrong.
BTW, to help you a bit I added a testsuite/dependency directory to check
a bit if the dependency works fine, so if we break it at least we know when
(what revision).
I will add the instantiation of planarRotation to the dependency directory
so we make sure we don't break it in the future.
comment:9 by , 14 years ago
I added more tests to testsuite/dependency.
Note that Modelica.Mechanics.MultiBody.Interfaces.PartialLineForce
does not work yet if +d=usedep
is used, so there are still problems
with the dependency analysis.
MathCore ticket: http://intranet/trac/mathmodelica/ticket/2957