Help with evaluating a solution of ODE45 at specific times?
7 views (last 30 days)
Show older comments
Hi,
I am trying to find the stability conditions on an equation of motion, which means evaluating the solution at t = 2*pi. I have to specify the initial conditions as well which means I also need to evaluate at time t = 0. I do not care about all the points in between as they get discarded. The whole thing is inside two "for" loops which means it is taking ages to compute. I'm wondering if there is a way to either only compute the solution at times t=0 and t=2*pi... or can I at least drastically reduce the number of times at which the soltuion is evaluated. Hope this is clear, and any help will be much appreciated!
Tom
0 Comments
Answers (1)
Jan
on 1 Apr 2012
If the equation, you want to integrate, has no closed form solution, you have to calculate it to all intermediate time steps to get the final position. Otherwise you would not need an integrator.
You can increase the tolerances for the local discretization error. But this reduces the accuracy of the final position.
There could further methods to increase the processing speed. Without seeing the code it is impossible to give any advice.
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!