- Index
- » Programming
- » Modelica Language
- » Repeating a simulation in a for-loop
Repeating a simulation in a for-loop
Repeating a simulation in a for-loop
Hi,
I try to reach a pseudo-steady state to run simulations of a biological system. The idea is to rerun a certain time period several times and always use the latest result as starting point. I first run the model and save the results in mymodel_start.mat:
Code:
system("mymodel -override startTime=255,stopTime=260 -r mymodel_start.mat")
The following also works, using the startfile to run the same model again and writing the results back to that file:
Code:
system("mymodel -override startTime=255,stopTime=260 -iif C:\\OpenModelica1.9.2\\tmp\\mymodel_start.mat -r mymodel_start.mat")
But when I put this simulation in a for-loop, I get an error (see below)
Code:
for i in 1:20 loop
system("mymodel -override startTime=255,stopTime=260 -iif C:\\OpenModelica1.9.2\\tmp\\mymodel_start.mat -r mymodel_start.mat")
end for;
Error occurred building AST
Syntax Error
[<interactive>:1:0-1:3:writable] Error: Parser error: Unexpected token near: for (FOR)
Any suggestions?
Thank you.
Andre
Re: Repeating a simulation in a for-loop
Missing semicolon.
- sjoelund.se
- 1700 Posts
- Index
- » Programming
- » Modelica Language
- » Repeating a simulation in a for-loop