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

2 次查看(过去 30 天)
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 个评论
KSSV
KSSV 2017-8-29
How we can know with out the idea of your code? your equations? you results?
John D'Errico
John D'Errico 2017-8-29
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.

请先登录,再进行评论。

采纳的回答

Jan
Jan 2017-8-29
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by