- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » When-Equations
When-Equations
When-Equations
Hi there,
I'm having difficulties with simulation of the example model from Peter Fritzson book (page 248)
This is the model:
model WhenValidResult
Real x,y;
equation
x + y = 5;
when sample(0,2) then
y = 7 - 2*x;
end when;
end WhenValidResult;
and here is the outcome:
>>simulate(WhenValidResult, startTime=0, stopTime=20, numberOfIntervals=500, tolerance=1e-4)
record SimulationResult
resultFile = "Simulation failed.
Error: Internal error generate_compute_output failed
Error: Internal error Generation of simulation code failed
"
end simulationResult;
I have a very similar problem to model and I was wondering if I can do anything about it in OpenModelica.
My system is:
OpenModelica 1.5. RC3
Windows XP Pro 32-bit
Many thanks,
Ivan
Re: When-Equations
I tried to change the problem a bit, but it only worked using pre(x) in the when-equations. But that changes its semantics a lot.
I opened up a bug report for this as I have had similar problems in the past: https://openmodelica.org:8443/cb/issue/ … ation=true
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » When-Equations