Is it possible to adjust the maximum step size ('MaxStep') while an ode15i solver is running according to a certain value?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lukas Siebler
el 19 de Ag. de 2022
Comentada: Lukas Siebler
el 19 de Ag. de 2022
Hi everyone, hi Matlab-Support-Team,
I've built up a quite complexe set of differential algebraic equations. I used also some 'heaviside' and 'rectangularPulse' functions, to change equation with reagrd to changing values. Unfortunately this opens some numeric troubles, since a certain value or its derivative can change abruptly, which might cause a non-stabile solver afterwards.
I thought about two tasks which might help:
- building kind of a time dependant ramp, which smoothes the course of a value or its derivative
- reducing the maximum step size 'MaxStep' while the ode15i solver is running.
However both ways did not work out to my pleasure, since there are still boundary conditions, which causes these numerical mistakes. Could you give me a few hints in general, please?
Thank you very much in advance.
Have a nice weekend.
Lukas
0 comentarios
Respuesta aceptada
Steven Lord
el 19 de Ag. de 2022
If you know the times at which you want to change functions and/or initial conditions ahead of time, run ode15i repeatedly for small pieces of the time step. So for example run ode15i from time t = 0 to time t = 2, change functions and/or ICs, then run ode15i a second time from time t = 2 to time t = 5. Change, run, change, run, etc.
If you don't know the times at which you want to change functions and/or initial conditions, use the Events functionality. The ballode example is the standard one that I recommend as a model. That example doesn't hard code when the ball will reach the ground, it detects when the ball's height above the ground crosses through 0.
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!