Opened 9 years ago
Last modified 7 years ago
#3957 assigned defect
Simulation errors with hierarchical state machines in Modelica 3.3
Reported by: | Owned by: | Bernhard Thiele | |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Backend | Version: | v1.10.0-dev-nightly |
Keywords: | state machines | Cc: |
Description
Hello all,
I am currently doing my Master's thesis and I am building a simple hierarchical state machines with parallel states (see code below) but I have problems when trying to simulate. I get these two errors:
Translation Error
[c:/dev/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 4490:9-4490:145]: Internal error function createSingleWhenEqnCode failed. When equations currently only supported on form v = ...
Translation Error
[c:/dev/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 479:5-479:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
Does anyone know where is the problem? Any help will be appreciated.
Thanks for your time and help.
Attachments (4)
Change History (12)
by , 9 years ago
Attachment: | PickPlace.mo added |
---|
comment:1 by , 9 years ago
Component: | OMEdit → Backend |
---|---|
Milestone: | 1.9.x → 1.10.0 |
Owner: | changed from | to
Status: | new → assigned |
Type: | task → defect |
by , 9 years ago
Attachment: | PickPlace.4.mo added |
---|
comment:3 by , 9 years ago
I have changed the code in some ways and now I get the following errors when trying to simulate:
[1] 16:33:54 Symbolic Error
Too many equations, over-determined system. The model has 302 equation(s) and 301 variable(s).
[2] 16:33:54 Translation Error
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
I have been looking a lot and I can't really find the equation that should be deleted but what I am really wondering is what is the second error. Does anyone know a solution to that?
Thank you very much for your time and help.
comment:4 by , 9 years ago
You should consider starting from a small working model and incrementally add details and states. The error diagnostic for state machines is unfortunately not very good. There are more problems in the model than just a missing equation.
One problem is a wrong type in Line 119 outer input Real count;
(should be Integer). But this doesn't fix it either. Taking the diagnostics by Dymola one gets
The problem is structurally singular. It has 180 scalar unknowns and 181 scalar equations. The Real part has 20 unknowns and 16 equations. The Integer part has 44 unknowns and 44 equations. The Boolean part has 116 unknowns and 121 equations. The String part has 0 unknowns and 0 equations.
So maybe there are some more typing errors?
The reason for the higher number of equations in OpenModelica is that OpenModelica also counts the equations introduced due to the state machine semantics (these are equations which are added by the tool, not by the modeller).
comment:5 by , 9 years ago
I am very sure that all the declared variables have the right type in their respective declarations. I also look at the instantiate model and the class seams to be 100% right.
I am going to look a little bit more at the code but I am not sure what it is really going wrong. I don't think that the equations introduced due to the state machine semantics are the problem here either.
Maybe I will just have to try to build it step by step.
Thank you very much for your help.
comment:7 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:8 by , 7 years ago
Milestone: | 1.12.0 → Future |
---|
The milestone of this ticket has been reassigned to "Future".
If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.
If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".
In both cases, a short informative comment would be welcome.
The state machine is already rather large. I recommend that you build it up more in a step by step fashion.
I get another error from OpenModelica when trying to run it ("Error: Currently, only equations in state machines with a LHS component reference, e.g., x=.., are supported").
I spotted a few errors:
I fixed these errors (see attachment), but I keep getting the same error message. Currently, I don't understand why this error is thrown. Maybe I can change the compiler to give better error diagnostics.
However, I also tried it with the Dymola tool and it doesn't work either, but gives instead the error:
So it seems that there are a few modelling issues in your example. I suppose the best way to get forward is if you start with a very simple state machine which works and then you keep adding additional states and transitions until it doesn't work any more.