Ode45的步长以及RelTol AbsTol

ode45是一个数值求解常微分方程的工具,其步长不是恒定的,而是根据指定的相对误差RelTol和绝对误差AbsTol来调整以满足精度要求。RelTol控制解的相对精度,而AbsTol关注解与真实值的绝对差异。在每个步骤中,解的误差必须小于或等于这两个容忍度的较大值。若解的某个分量很小,即使不关心它,也可能需要设置较小的AbsTol以确保其他重要分量的计算精度。
摘要由CSDN通过智能技术生成

look here

The stepsize of ode45 is not constant, but chosen such that the error tolerances you prescribe are met. Thus mean step size can only be controlled indirectly by strengthening (-> smaller stepsize) or weakening (-> larger stepsize) the error tolerances RelTol and AbsTol.


look here

RelTol 为相对精度容差,用于控制计算答案中的正确位数。AbsTol 为绝对误差容限,用于控制计算答案与实际解之间的差异。在每个步长中,解分量 i 中的误差 e 将满足

|e(i)| ≤ max(RelTol*abs(y(i)),AbsTol(i))

粗略地讲,这意味着您希望 RelTol 更正所有解分量中的位数(但小于阈值 AbsTol(i) 的解分量除外)。当分量 y(i) 非常小时,即使您对此分量不感兴趣,您仍必须指定足够小的 AbsTol(i) 值,以便获取 y(i) 中的某些正确位数,从而准确计算您更感兴趣的分量。

At each step, the solver estimates the local error e in the ith component of the solution. This error must be less than or equal to the acceptable error, which is a function of the specified relative tolerance, RelTol, and the specified absolute tolerance, AbsTol.
|e(i)| ≤ max(RelTol*abs(y(i)),AbsTol(i))

For relative accuracy, adjust RelTol. For the absolute error tolerance, the scaling of the solution components is important: if |y| is somewhat smaller than AbsTol, the solver is not constrained to obtain any correct digits in y. You might have to solve a problem more than once to discover the scale of solution components.

Roughly speaking, this means that you want RelTol correct digits in all solution components except those smaller than thresholds AbsTol(i). Even if you are not interested in a component y(i) when it is small, you may have to specify AbsTol(i) small enough to get some correct digits in y(i) so that you can accurately compute more interesting components.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值