Clear Filters
Clear Filters

hi, can anyone tell me what is the error of ode45(error per step) ,

2 views (last 30 days)
I solve differential equations using ode45, the solutions is weird and I want to know wether the problem is numerical one or in the equations
  2 Comments
KSSV
KSSV on 29 Aug 2017
How we can know with out the idea of your code? your equations? you results?
John D'Errico
John D'Errico on 29 Aug 2017
We are told only that you got a solution that surprised you. This leads us to the conclusion that one or more of the following is true:
1. You made a mistake in implementing the equations.
2. The equation system itself has a problem, incorrectly modeling the the system under study. You might then get a reasonable prediction for the wrong problem.
3. You are using ODE45 incorrectly.
4. Some other solver would be more appropriate, perhaps due to stiffness of the system.
5. (unlikely) there is a bug, hidden away for all these years, in ODE45.
6. You have no idea what the solution should have been, so a perfectly valid solution will surprise you.
7. The error tolerances in ODE45 were set too high, allowing error to creep in at an unacceptable level.
Other possibilities surely exist too. I suppose that a stiff system has the common failure mode with ODE45 that it just never finishes.
The crystal ball is too cloudy today to know what you did, and where the problem lies. Darn this MATLAB crystal ball! This should teach me not to buy a cheap knock-off crystal ball.

Sign in to comment.

Accepted Answer

Jan
Jan on 29 Aug 2017
You can trust ode45 to reply the correct numerical results, as long as you provide correct inputs. The integrators require differentiable functions, otherwise the stepsize control can produce nonsense, see http://www.mathworks.com/matlabcentral/answers/59582#answer_72047.
As long as you do not provide any details about your problem, a more specific answer is not possible.

More Answers (0)

Categories

Find more on Programming 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!