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 problem

  1. Oct 2, 2009 #1
    I've been doing some work with coupled ODEs in Matlab. I've been using ODE15s, and calculating the solutions of 40 coupled equations between t=0.....0.01, but Matlab seems to be calculating far more accurately than I want, it's taking 40 minutes to produce a solution and determining the function at over a million points on the domain.

    Any suggestions on how to make things a little less precise? If I only had one of every thousand of the points it calculates, I'd be happy.
  2. jcsd
  3. Oct 3, 2009 #2


    User Avatar
    Science Advisor
    Gold Member

    You can specify the points for which the solution is found if you give a vector for the tspan argument. So, if you're saying that it's calculating for too many points when you use t = [0 .01], then you can just specify t = (0:.001:.01) or whatever values it is that you want there. I hope that helps.
  4. Oct 3, 2009 #3
    Thanks james. the problem with that is that odeXX continues to calculate the intermediate points regardless, and at the end just spits out the points you requested. So the computation time is exactly the same.
  5. Oct 3, 2009 #4


    User Avatar
    Science Advisor
    Gold Member

    Oh - sorry about that. Have you tried playing with the tolerance? If you relax the default settings on RelTol and AbsTol, maybe it won't require such a small step size.

    Other than that I'm not really sure - that might just be the best you can do with the complexity of your system.
    Last edited: Oct 3, 2009
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Matlab ODE problem
  1. ODE in Matlab (Replies: 3)

  2. ODE matlab (Replies: 2)