- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Call Modelica Limiter
Call Modelica Limiter
Call Modelica Limiter
Hello all,
I am using to use openmodelica 1.7.0, with Eclipse 0.7.7. I want to use Modelica libraries I've create test model see bellow.
Simulating this model I am getting the errors see bellow. I use Eclipse, MDT console to call the model. I can note that Integrator, Abs, Sine works O.K. My question is if I am incorrectly using/calling Modelica libraries (Limiter), if so what is correct call for Modelica libs?
Thanks.
Best regards,
peb
MODEL:
model test
import Modelica.Blocks.Sources;
import Modelica.Blocks.Continuous;
Real s;
Modelica.Blocks.Sources.Sine sin1(phase=90,amplitude=2);
Modelica.Blocks.Continuous.Integrator integ;
Modelica.Blocks.Math.Abs bs;
Modelica.Blocks.Nonlinear.Limiter lim;
equation
s = sin1.y;
integ.u=s;
bs.u = s;
//connect(sin1.y,lim.u);
lim.u=s;
end test;
ERRORS:
record SimulationResult
resultFile = "",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'test', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
messages = "Simulation failed for model: kruh
[C:/OpenModelica1.7.0/lib/omlibrary/msl31/Modelica/Blocks/Nonlinear.mo:19:12-23:97:writable] Warning: If-equations are only partially supported. Ignoring assert(lim.u >= lim.uMin - 0.01 * abs(lim.uMin) and lim.u <= lim.uMax + 0.01 * abs(lim.uMax),\"Limiter: During initialization the limits have been ignored.However, the result is that the input u is not within the required limits: u = \" + String(lim.u,0,true,6) + \", uMin = \" + String(lim.uMin,0,true,6) + \", uMax = \" + String(lim.uMax,0,true,6));
Error: Error building simulator. Buildlog: Nespr vn syntaxe pý?kazu
perl C:/OpenModelica1.7.0//share/omc/scripts/convert_lines.pl kruh.cpp kruh.conv.cpp.tmp
g++ -I. -o kruh.exe kruh.conv.cpp -L\"C:/Workspace/test\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library/mingw32\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library/win32\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library\" -lModelicaExternalC -lsim -linteractive -I\"C:/OpenModelica1.7.0//include/omc\" -O3 -falign-functions -msse2 -mfpmath=sse -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32 -L\"C:/OpenModelica1.7.0//lib/omc\" -lc_runtime -lregex -Wl,-Bstatic -lf2c -Wl,-Bdynamic kruh_records.c
kruh.cpp: In function `int checkForAsserts()':
kruh.cpp:1034: error: `mmc_GC_local_state' was not declared in this scope
kruh.cpp:1044: error: invalid conversion from `const void*' to `void*'
kruh.cpp:1044: error: initializing argument 1 of `void* const stringAppend(void*, void*)'
kruh.cpp:1044: error: invalid conversion from `const void*' to `void*'
kruh.cpp:1044: error: initializing argument 2 of `void* const stringAppend(void*, void*)'
kruh.cpp:1045: error: invalid conversion from `const void*' to `void*'
kruh.cpp:1045: error: initializing argument 2 of `void* const stringAppend(void*, void*)'
kruh.cpp:1047: error: invalid conversion from `const void*' to `void*'
kruh.cpp:1047: error: initializing argument 2 of `void* const stringAppend(void*, void*)'
kruh.cpp:1048: error: invalid conversion from `const void*' to `void*'
kruh.cpp:1048: error: initializing argument 2 of `void* const stringAppend(void*, void*)'
\\MinGW\\bin\\mingw32-make: *** [kruh] Error 1
",
timeFrontend = 0.0,
timeBackend = 0.0,
timeSimCode = 0.0,
timeTemplates = 0.0,
timeCompile = 0.0,
timeSimulation = 0.0,
timeTotal = 0.0
end SimulationResult;
Re: Call Modelica Limiter
Hi,
The problem seems to be that you're trying to simulate from MTD Eclipse.
By default, MDT starts omc with +g=MetaModelica, see in Eclipse: Window->Preferences->Modelica.
The +g=MetaModelica flag tells the compiler to support MetaModelica and because of that the
code generation and compilation is done a bit different.
I suggest you remove +g=MetaModelica from Window->Preferences->Modelica tab, restart Eclipse
and try to simulate again again. Alternatively you can load your model inside OMEdit or OMShell and
simulate it there.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Call Modelica Limiter
I changed it within Eclipse/MDT and removed +g=MetaModelica parameter as you suggested but it does not help - the same results.
Then I tried it with OMShell and simulation runs with following warning but it runs at least.
OUTPUT:
record SimulationResult
resultFile = "kruh_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'test', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
messages = "",
timeFrontend = 0.203040510888774,
timeBackend = 0.00654214385838666,
timeSimCode = 0.00436536431159411,
timeTemplates = 0.0235498701169384,
timeCompile = 6.57502087727141,
timeSimulation = 0.269681993090355,
timeTotal = 7.0823182984472
end SimulationResult;
[C:/OpenModelica1.7.0/lib/omlibrary/msl31/Modelica/Blocks/Nonlinear.mo:19:12-23:97:writable] Warning: If-equations are only partially supported. Ignoring assert(lim.u >= lim.uMin - 0.01 * abs(lim.uMin) and lim.u <= lim.uMax + 0.01 * abs(lim.uMax),"Limiter: During initialization the limits have been ignored.However, the result is that the input u is not within the required limits: u = " + String(lim.u,0,true,6) + ", uMin = " + String(lim.uMin,0,true,6) + ", uMax = " + String(lim.uMax,0,true,6));
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Call Modelica Limiter