Opened 10 years ago
Closed 10 years ago
#3151 closed defect (fixed)
PowerSystems: BackendDAEOptimize.createJacobian failed
Reported by: | Rüdiger Franke | Owned by: | Willi Braun |
---|---|---|---|
Priority: | high | Milestone: | 1.9.2 |
Component: | FMI | Version: | trunk |
Keywords: | Cc: | Lennart Ochel, Willi Braun |
Description
The new head revision 2e0ca56 of PowerSystems
$ git clone https://github.com/modelica/PowerSystems.git
fixes some problems that showed up with OpenModelica (syntax error with array indexing and explicit instantiation of a global system model).
Now the code generation still fails for some models. In particular for models as simple as:
PowerSystems.Test.GenericComponentsTest.PMeterTest PowerSystems.Test.GenericComponentsTest.GeneratorTest PowerSystems.Test.GenericComponentsTest.GeneratorTest2
For instance PMeterTest gives the translation errors:
[1] 15:32:16 Translation Error Internal error BackendDAEOptimize.createJacobian failed [2] 15:32:16 Translation Error Internal error BackendDAEOptimize.optimizeJacobianMatrix failed [3] 15:32:16 Translation Error Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed! [4] 15:32:16 Symbolic Error [/home/user/PowerSystems/PowerSystems/Generic.mo: 321:5-321:89]: Model is structurally singular, error found sorting equations 1: $CSE1$lB2$rB$pDERNLSJac12$P$CSE1$lB2$rB = 0.0; for variables $res1$pDERNLSJac12$PdummyVarNLSJac12(1)
Followed by the runtime error
residual function pointer is invalid Simulation process failed. Exited with code 255.
Attachments (1)
Change History (9)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Component: | Backend → FMI |
---|---|
Owner: | changed from | to
comment:4 by , 10 years ago
I was positively surprised to see the FMU export working using r24573. Then I played around with the model and got some fuzzy results.
It appears that the error shows up if the model file has DOS line endings, contains multi-line doc strings and is treated with OMEdit under Linux!?
See attached model file -- FMI export raises the errors below. It works if the multi-line doc string is removed or if using Unix line endings.
[3] 18:56:09 Translation Error Error building simulator. Build log: clang -fPIC -O0 -march=native -I"/usr/include/omc/c" -I"/usr/include/omc/c/fmi2" -I. -c -o PMeterTestWithIO_FMU.o PMeterTestWithIO_FMU.c PMeterTestWithIO_FMU.c:447:79: warning: assigning to 'modelica_string' (aka 'void *') from 'fmi2String' (aka 'const char *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] case $Psystem$Pini_ : comp->fmuData->simulationInfo.stringParameter[0]=value; break; ^~~~~~ PMeterTestWithIO_FMU.c:448:79: warning: assigning to 'modelica_string' (aka 'void *') from 'fmi2String' (aka 'const char *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] case $Psystem$Pref_ : comp->fmuData->simulationInfo.stringParameter[1]=value; break; ^~~~~~ PMeterTestWithIO_FMU.c:449:79: warning: assigning to 'modelica_string' (aka 'void *') from 'fmi2String' (aka 'const char *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] case $Psystem$Psim_ : comp->fmuData->simulationInfo.stringParameter[2]=value; break; ^~~~~~ 3 warnings generated. clang -fPIC -O0 -march=native -I"/usr/include/omc/c" -I"/usr/include/omc/c/fmi2" -I. -c -o PMeterTestWithIO.o PMeterTestWithIO.c In file included from PMeterTestWithIO.c:495: ./PMeterTestWithIO_init.c:1:1: warning: missing terminating '"' character [-Winvalid-pp-token] "\n\n\n: recipe for target 'PMeterTestWithIO.o' failed make: *** [PMeterTestWithIO.o] Error 1 [4] 18:56:09 Translation Error Internal error BackendDAEOptimize.createJacobian failed [5] 18:56:09 Translation Error Internal error BackendDAEOptimize.optimizeJacobianMatrix failed [6] 18:56:09 Translation Error Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed! [7] 18:56:09 Translation Error Internal error pre-optimization module removeSimpleEquations failed. [8] 18:56:09 Symbolic Error [/home/user/PowerSystems/PowerSystems/Generic.mo: 294:9-294:60]: Found equation without time-dependent variables: system$Ptheta$pDERD$PdummyVarD = 0.0
by , 10 years ago
Attachment: | PMeterTestWithIO.mo added |
---|
comment:5 by , 10 years ago
Btw. the attached model fails to simulate from OMEdit with +cseCall
(see initial report of this ticket).
Can it be that the BackendDAEOptimize errors are things that are treated internally and that the error message buffer isn't cleaned up appropriately, so that the messages show up if something else goes wrong, like a DOS line ending?
comment:6 by , 10 years ago
This issue with +cseCall seems to be caused by a wrong adjacency matrix.
For the following system:
eqns: 1/1 (1): $CSE1[2] = $CSE4[2] [dynamic] 2/2 (1): $CSE1[1] = $CSE4[1] [dynamic] [...] vars: [...] 22: $CSE4[2]:VARIABLE() type: Real 23: $CSE4[1]:VARIABLE() type: Real 24: $CSE1[2]:VARIABLE() type: Real 25: $CSE1[1]:VARIABLE() type: Real
we get following corresponding adjacency rows:
[...] 1:23 22 25 24 2:23 22 25 24 [...]
This results into a really wrong strong component and generated code is wrong.
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I was wondering why yesterday's tests done with r24515 report success for
PowerSystems.Examples.PowerWorld.PowerWorld
, even though it exhibits the same problem. Indeed I was using the option+cseCall
. The reported problem disappears with the default OMC flags.However, the problem shows up again when adding external IO to the model. Simulation in OMEdit works despite of the translation errors (r24510). Export of FMU 2.0 fails for this
PMeterTest
withIO
: