Repeating a loop/iteration in a for loop (for adaptive time stepping)
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to write a code for adaptive time stepping using the explicit euler method.
I was wondering if there is a way to repeat an iteration for a 'for' loop which has an if-else statement like this:
if error is greater than tolerance
Throw current results away, and decrease time step using a specific formula and redo calculations for the current iteration
Else
Accept results and calculate new increased time step, and continue with calculations for next iteration
end
Thank you for the help!
Regards
Ushnik
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!