- Index
- » Users
- » jamesclementsiii
- » Profile
Posts
Posts
Newby question: What is the intended use of the terminate() function? I would like a simulation to run 10 seconds unless there is a reason to stop it sooner. I would like the data for plotting to stop early too. When running the following test case for 10 seconds, the simulation does not seem to stop. Am I missing something? What is the proper way to end a simulation early? I'm using OMEdit 1.7.0 under Ubuntu. The simulation code for test_terminate was generated by the OpenModelica Compiler 1.7.0 (r9861).
Thanks in advance,
Jim
model test_terminate
Real x(start = 0);
Real y(start = 0.0);
annotation(experiment(StartTime = 0.0, StopTime = 10.0, Tolerance = 1e-06));
algorithm
if time > 3 then
x:=time;
end if;
if time > 5 then
y:=time;
end if;
if time > 7 then
terminate("done");
end if;
end test_terminate;
- Index
- » Users
- » jamesclementsiii
- » Profile