Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Error when simulating

Error when simulating

Hey,

I have strange error when simulating my model. Simulation gives IND and INF values. I have removed everything except the following from the model, so now the model doesnt make any sense for any other purpose than testing. If I remove anything else from the model, then it works. Why is this example model broken? This also works if I change the simulation parameters, but in the real model I cannot get rid of the problem by just changing the simulation parameters or removing something from the model. Im using OMNotebook.

model TestModel
  Real Auxiliary1;
  Real Valve1;
  Real Stock1(start = 0.0, fixed = true);

equation
  Auxiliary1 = if time > 0 then 0 else 1;
  Valve1 = delay(Stock1, 1);
  der(Stock1) = +Valve1;
end TestModel;

simulate(TestModel, startTime=0, stopTime=10, numberOfIntervals=1000, method="euler");
val(Valve1, 2)

Results:
record SimulationResult
    resultFile = "TestModel_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 1000, tolerance = 1e-06, method = 'euler', fileNamePrefix = 'TestModel', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
    messages = "",
    timeFrontend = 0.00256010191239389,
    timeBackend = 0.000445028627940143,
    timeSimCode = 0.000227961933709452,
    timeTemplates = 0.0053828070327374,
    timeCompile = 2.03155987702348,
    timeSimulation = 0.946426990022475,
    timeTotal = 2.98665528719432
end SimulationResult;
-1.#IND

Any ideas?

Regards
Tomi

Re: Error when simulating

I created a bug in the tracker for this: http://openmodelica.org:8080/cb/issue/1614
Changing solver to dassl seems to work; I am assuming it detects some problem and retries; someone with more knowledge of the runtime should have a closer look.

Re: Error when simulating

Willi fixed this in r9767, so this will work in the next build we release.

Re: Error when simulating

thanks

There are 0 guests and 0 other users also viewing this topic