Opened 8 years ago
Last modified 7 years ago
#4411 new defect
Odd error-message for over-determined system
Reported by: | Vestal | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Cc: |
Description (last modified by )
Seems like a bug in verison 1.12.0 of 3 May 2017
model SpinArtistry import Modelica.SIunits; import Modelica.Mechanics.MultiBody.Frames.Orientation; import Modelica.Mechanics.MultiBody.Frames.axisRotation; import Modelica.Mechanics.MultiBody.Visualizers; import Modelica.Mechanics.MultiBody.Frames; import Modelica.Mechanics.MultiBody.Types.Color; // Running "simulate" on this model will result in a // Translation Error "The given system is mixed-determined. // [index > 3]" // If you comment/uncomment the following lines to change // the following declaration from a parameter to a constant, // it will succeed. parameter SIunits.AngularVelocity der_angle = 10.0; //constant SIunits.AngularVelocity der_angle = 10.0; //parameter Frames.Orientation Rtilt = Frames.axisRotation(3, -0.7, 0); constant Frames.Orientation Rtilt = Frames.axisRotation(3, -0.7, 0); SIunits.Angle angle; Frames.Orientation R; initial equation angle = 0.0; R = Frames.absoluteRotation(Frames.Orientation(T=identity(3),w={0,der_angle,0}), Rtilt); equation der_angle = der(angle); R = Frames.absoluteRotation(Frames.axisRotation(2, angle, der_angle), Rtilt); end SpinArtistry;
Attachments (1)
Change History (4)
by , 8 years ago
Attachment: | SpinArtistry.mo added |
---|
comment:1 by , 7 years ago
Component: | *unknown* → Backend |
---|---|
Owner: | changed from | to
comment:2 by , 7 years ago
Description: | modified (diff) |
---|
comment:3 by , 7 years ago
Summary: | OMEdit 1.12 simulate fails with parameter but works when changed to constant → Odd error-message for over-determined system |
---|
The problem stems from defining R
twice: once for initialization and once for the regular equation system. This is not really allowed in Modelica although OpenModelica will look for redundant equations and remove some (which is why it works when derangle is a constant).
Using something like the following works:
R = Frames.absoluteRotation(if initial() then Frames.Orientation(T=identity(3),w={0,der_angle,0}) else Frames.axisRotation(2, angle, der_angle), Rtilt);
Although it is probably better to use:
R = Frames.absoluteRotation(Frames.axisRotation(2, angle, der_angle), Rtilt);
I suppose what could be lacking is a better error-message stating that the system is over-determined and listing the equations. @lochel is probably better than myself for that task though.
Model with comment characters