the length of the time span in ode45
10 次查看(过去 30 天)
显示 更早的评论
Hi there,
I am using ode45 to solve a set of ODEs. Here I want to ask, if the length of the time span is relevant to the accuracy of the numerical results? I mean, is there a relationship like, a longer timespan corresponds to a rough accuracy, or a shorter timespan corresponds to a higher accuracy? Many thanks!
0 个评论
采纳的回答
Jan
2022-2-24
The small discretization and rounding errors accumulate over the time. Small deviations of the initial values can be amplified also. So the general rule is, that a longer integration time can cause larger deviations of the final value.
Of course a stable trajectory does not suffer from this: e.g. a falling pencil will be at the same position and some houres also, so increasing the time will not change anything.
This concerns the real world also: To determine the exact position of the earth in 1 million years, you need to know the current position with an extreme accuracy. But, by the way, even the "year" is not defined accurate enough for this job.
2 个评论
Jan
2022-2-24
Usually the length of the time span depends on the problem you want to solve. So if you need the trajectory from 0 to 1, using an earlier final time is not an option.
更多回答(1 个)
Torsten
2022-2-24
If by "length of the time span" you mean" the number of output times (for the end time of integration fixed)", the answer is no - it is not relevant for the numerical accuracy of the numerical results.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!