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 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by