Optimizing Matlab ODE15s for Coupled ODEs

  • MATLAB
  • Thread starter JohnSimpson
  • Start date
  • Tags
    Matlab Ode
In summary, the conversation discusses the use of coupled ODEs in Matlab and the issue of the program calculating too accurately, resulting in long computation times. The suggestion of specifying the points for which the solution is found using the tspan argument is given, but it is noted that this does not decrease computation time. The idea of adjusting the tolerance settings is also mentioned as a potential solution.
  • #1
JohnSimpson
92
0
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.
 
Physics news on Phys.org
  • #2
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.
 
  • #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.
 
  • #4
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:

1. What is the purpose of optimizing Matlab ODE15s for coupled ODEs?

The purpose of optimizing Matlab ODE15s for coupled ODEs is to improve the efficiency and accuracy of solving systems of ordinary differential equations (ODEs) that are coupled, meaning they are dependent on each other. This optimization can help reduce the computational time and resources required for solving these types of ODEs.

2. How does optimizing ODE15s for coupled ODEs differ from optimizing for single ODEs?

Optimizing ODE15s for coupled ODEs involves taking into account the interactions and dependencies between the equations, while optimizing for single ODEs only considers one equation at a time. This requires different techniques and strategies to achieve the most efficient and accurate solution.

3. What are some techniques for optimizing ODE15s for coupled ODEs?

Some techniques for optimizing ODE15s for coupled ODEs include using adaptive time-stepping methods, utilizing sparse matrix operations, and implementing parallel computing. These techniques can help improve the computational efficiency and accuracy of solving coupled ODEs.

4. What are the benefits of optimizing ODE15s for coupled ODEs?

The benefits of optimizing ODE15s for coupled ODEs include reduced computational time and resources, improved accuracy of solutions, and the ability to handle more complex and larger systems of equations. This can be particularly useful in scientific and engineering applications where coupled ODEs are common.

5. Are there any limitations to optimizing ODE15s for coupled ODEs?

While optimizing ODE15s for coupled ODEs can provide significant benefits, there are some limitations to consider. Depending on the complexity of the system, it may still require a significant amount of computational time and resources. Additionally, some coupled ODEs may not be suitable for optimization, and alternative methods may need to be explored.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Replies
10
Views
153
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
9K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
10K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • Programming and Computer Science
Replies
4
Views
2K
Back
Top