Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab ode solvers - adding a separate convergence criteria

  1. 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?
     
  2. jcsd
  3. Dec 10, 2015 #2

    kreil

    User Avatar
    Gold Member

    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 (Text):
    edit ballode
    If you mark an event as terminal, then the solver stops when that event is hit.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Matlab ode solvers - adding a separate convergence criteria
  1. MATLAB ODE solver (Replies: 2)

  2. Matlab ode solver (Replies: 1)

Loading...