writing ODE stats to a variable to use for plots.

2 views (last 30 days)
Hallo,
I am doing a study on the efficiency of using different algorithms to solve a number ODEs.
I have wrote every thing in to a loop but I still would like to know if there i sampile why to write out these outputs to variables that i would like to plot and compare: - number of step(correct and incorrect) - time the solver needs ( i am using tic toc, is there a better method?) - open for more ideas!
note: i have already done an error analysis. note 2: i know the efficiency is depended on many parameters but i would to know if there is a way to plot the internal values of a ODE solvers
thank you
  3 Comments
Hasan_3453
Hasan_3453 on 28 Jan 2015
hallo,
- CPU time enough isn't enough because it depends also on the CPU used.
- the ODE sometime use an error estimate to control the time step to achieve the given accuracy tolerance. steps that do so are incorrect steps. To know this number will give a better understanding of the efficiency of the used solver.
simple: if the solvers knows what to do and can achieve the right answer in the lest amount of steps => efficient
- it would be also nice to know the step size of each correct step, would look nice in plots :)
Sara
Sara on 29 Jan 2015
I don't agree with the second point: a fixed-step runge kutta (i.e., no erroneous steps) can be much less efficient than a variable-step one, especially if the function is smooth and the time step chosen by the user is very small. Efficiency is measured in time spent to complete the calculations on the same system, so cpu time is more than good as a parameter in my opinion.
To answer your last point, if to the solver you specify the time interval you're interested in instead of a time array, you'll get as output the times where the function was successfully computed, i.e., nice looking plots.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!