Opened 12 years ago
Closed 12 years ago
#2095 closed defect (fixed)
Problems simulating simple nonlinear model
Reported by: | Leonardo Laguna | Owned by: | probably noone |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | Willi Braun, Jens Frenkel, Lennart Ochel |
Description
I have the following simple nonlinear model
model SimpleNonlinear Real y2; Real y3; equation y2+y3=0; y2*y3=-3; end SimpleNonlinear;
This model cannot be simulated. It reports the following errors.
Translation 09:32:05 0:0-0:0 Internal error Transformation Module PFPlusExt index Reduction Method Pantelites failed! Translation 09:32:05 0:0-0:0 Internal error Circular Equalities Detected Translation 09:32:53 0:0-0:0 Error building simulator. Buildlog: gcc -falign-functions -march=native -mfpmath=sse -I"/usr/include/omc" -I. -c -o ExtractionSetS_NL_Test.o ExtractionSetS_NL_Test.c gcc -falign-functions -march=native -mfpmath=sse -I"/usr/include/omc" -I. -c -o ExtractionSetS_NL_Test_records.o ExtractionSetS_NL_Test_records.c g++ -I. -o ExtractionSetS_NL_Test ExtractionSetS_NL_Test.o ExtractionSetS_NL_Test_records.o -I"/usr/include/omc" -I. -falign-functions -march=native -mfpmath=sse -L"/usr/lib/omc" -Wl,-rpath,'/usr/lib/omc' -lSimulationRuntimeC -ldl -linteractive -lexpat -Wl,-Bsymbolic-functions -Wl,-z,relro -lrt -lgc -fopenmp -lsundials_kinsol -lsundials_nvecserial -llapack -lpthread -Wl,-Bstatic -lf2c -Wl,-Bdynamic /usr/bin/ld: cannot find -lf2c collect2: error: ld returned 1 exit status make: *** [omc_main_target] Error 1 Translation 09:32:05 0:0-0:0 Internal error Optimisation Module removeSimpleEquations failed.
This model is a reduced version of one of the models in the uncertainties test bank.
Change History (14)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I have a nightly build version. I'm not sure the date but is less that a week old. I'm running on linux.
The main problem is that this model does not pass the "lower" part in the backend, therefore it cannot be used in the uncertainties algorithm.
The linking error is not an issue for me since the models for uncertainties are not compiled.
comment:3 by , 12 years ago
It most certainly does pass the lowering part of the backend. I just tested it and there were no errors. Run dpkg -s omc
to get me the version you are using.
comment:4 by , 12 years ago
Status: install ok installed
Priority: optional
Section: math
Installed-Size: 48129
Maintainer: OpenModelica Build System <build@…>
Architecture: i386
Source: openmodelica
Version: 15292-1
comment:5 by , 12 years ago
Actually, some of the error messages come from the full model (see below). I copied the all the error messages in the message window (my bad). This is the full model:
model ExtractionSetS_NL_Test Real x1; Real x2; Real x3; Real y1; Real y2; Real y3; equation x1+x2 = 0; x1-x2 = 0; y1=x2+2*x3; x3-y1+y2=x2; y2+y3=0; y2*y3=-3; end ExtractionSetS_NL_Test;
Even with circular equalities, this model is valid and it should simulate.
follow-up: 11 comment:6 by , 12 years ago
Cc: | added |
---|
OK, the following is a smaller model that does still have the same error:
model M Real x1; Real x2; equation x1+x2 = 0; x1-x2 = 0; end M;
It's equivalent to:
x1 = x2; 0 = 0;
Which OpenModelica cannot solve, and I'm not sure it's supposed to either... Jens or Willi can tell you more.
comment:7 by , 12 years ago
Cc: | added |
---|
comment:8 by , 12 years ago
Or wait... Hmmm... Shouldn't it be
x1 = x2; // alias 2*x1 = 0; => x1 = 0.0
It should be possible to ignore the two potential aliases (x1=x2 or x1=-x2), and keep going using one of them.
comment:9 by , 12 years ago
For me the models works as expected.
if you add both equations you get
x1+x2 = 0; x1-x2 = 0; + x1 = 0;
Hence the solution is x1=x2=0;
Known Variables (constants) (2) ======================================== 1: x2:VARIABLE(start = 0.0 ) = 0.0 .Wire.M, .Real type: Real 2: x1:VARIABLE(start = 0.0 ) = 0.0 .Wire.M, .Real type: Real
comment:10 by , 12 years ago
Works, yes. But not as expected. You get:
Error: Internal error Circular Equalities Detected Error: Internal error Optimisation Module removeSimpleEquations failed.
Which I assume should not be there.
comment:11 by , 12 years ago
Replying to sjoelund.se:
It's equivalent to:
x1 = x2; 0 = 0;
Not, it is not. It is equivalent to:
x1 = x2; x1 = 0;
edit: not fast enough ...
comment:12 by , 12 years ago
Ok, so I have fixed this on my local copy. I will push in my changes when testsuite was succesfull.
What OS / how did you install omc?