Error when running a model in a loop, programmatically, when using fast restart
Show older comments
I have a model that runs in a loop such that the result of first iteration is used in the second iteration, result from second is used in third and so on. The model works fine in normal mode (through script and also through UI). Then I use 'Fast Restart' to run the model through UI, and it works as expected i.e. running the model many times gives the desired behavior of a loop as output from first run is used in the next and so on. The issue comes when running the 'Fast Restart' mode through script (which has loops).
Error message:
Error using TWCmodel_global (line 90)
Can not change the start time when initialized in Fast Restart
I believe the issue is due to the fact that I am using an ill-formed 'sim' function i.e. I am passing a second parameter as the StopTime but I am not able to find any documentation on this usage:
sim('GasFlow', <StopTime>);
But even if the syntax is wrong, the code still works in Normal Mode (without Fast Restart), so not sure what is going on.
How to fix this?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!