hoomanya Messages 86 Reaction score 0 Thread starter Dec 10, 2015 #1 Hi, is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped?
Hi, is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped?
kreil Science Advisor Insights Author Messages 665 Reaction score 68 Dec 10, 2015 #2 You can write an event function that is passed to the solver in the options structure (which you create using odeset). More info here: http://www.mathworks.com/help/matlab/ref/odeset.html#f92-1017470 For a simple example, type Code: edit ballode If you mark an event as terminal, then the solver stops when that event is hit.
You can write an event function that is passed to the solver in the options structure (which you create using odeset). More info here: http://www.mathworks.com/help/matlab/ref/odeset.html#f92-1017470 For a simple example, type Code: edit ballode If you mark an event as terminal, then the solver stops when that event is hit.