#5592 closed defect (fixed)
Issue with NF and index reduction
Reported by: | Francesco Casella | Owned by: | Per Östlund |
---|---|---|---|
Priority: | blocker | Milestone: | 2.0.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: | Karim Adbdelhak, Lennart Ochel, Andreas Heuermann |
Description
Please check ModelicaTest.Rotational.AllComponents
. It runs fine with the old frontend, but it fails with the NF, giving the following error:
[OMCompiler/Compiler/BackEnd/Differentiate.mo:404:3-404:155:writable] Error: Derivative of expression "der(move.phi) = Modelica.Mechanics.Rotational.Sources.Move.position_der({sine5[1].y, sine5[2].y, sine5[3].y}, time, 1.0)" w.r.t. "time" is non-existent. [OMCompiler/build/lib/omlibrary/Modelica 3.2.3/Mechanics/Rotational.mo:6424:7-6424:30:writable] Error: Internal error Differentiate.differentiateEquationTime failed for der(move.phi) = Modelica.Mechanics.Rotational.Sources.Move.position_der({sine5[1].y, sine5[2].y, sine5[3].y}, time, 1.0) Error: Internal error - IndexReduction.pantelidesIndexReduction1 failed! Use -d=bltdump to get more information.
The only relevant difference I could spot in the flattened models was that the OF gives
move.phi = Modelica.Mechanics.Rotational.Sources.Move$move.position({move.u[1], move.u[2], move.u[3]}, time);
while the NF gives
move.phi = ModelicaTest.Rotational.AllComponents.move.position(move.u, time);
One difference is that the OF expands the scalar components of the array, while the NF doesn't.
The other one is that the path of the position
function is different. Maybe this prevents the backend from using the information provided by the derivative
annotation (which has a relative path) to find the derivative function?
Change History (4)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Good :)
Please proceed with the merging of PR 336, so we can see the impact on libraries at large, maybe there are other such cases around.
comment:3 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
With the fix in b7e35afb the model now verifies, along with a couple of other models in ModelicaTest.Rotational
and ModelicaTest.Translational
. In fact, there are now 455 models in ModelicaTest
that verify, compared to 453 when using the OF.
I noticed that the OF had a list of lower order derivatives in the derivative data for each function, so that
position_der
knew that it was a derivative ofposition
.The NF didn't do that though, on the basis of "I don't know what this does and it doesn't seem to matter". But I've now implemented that functionality in the NF too, in #336, and it turns out that it actually did matter since the model now simulates sucessfully.