Matlab求解器中的相对和绝对容差定义

jul*_*rez 9 parameters integration matlab document definitions

我试图理解RelTol和AbsTol参数的以下Matlab定义:

RelTol — This tolerance is a measure of the error relative to the size of each
solution component. Roughly, it controls the number of correct digits in all 
solution components, except those smaller than thresholds AbsTol(i).The default,
1e-3, corresponds to 0.1% accuracy.

AbsTol — AbsTol(i) is a threshold below which the value of the ith solution 
component is unimportant. The absolute error tolerances determine the accuracy 
when the solution approaches zero.

我不明白为什么AbsTol在解决方案接近零时确定准确性(事实上,如果我的问题的解决方案是半径为7000 km的圆形轨道,这不符合它)以及为什么RelTol控制所有解决方案组件中的正确数字的数量,除了小于阈值AbsTol(i)的那些.确定每个容差的实际表达式是什么?我想得到更简单易懂的定义.

Jon*_*nas 8

执行优化时,您需要决定何时停止.检查解决方案是否足够好的一种方法是检查解决方案是否仍在显着变化.有两种方法可以衡量解决方案的变化:相对变化(即变化百分比)或绝对变化.

检查相对变化是很有意义的,因为当解决方案在1左右时,5的变化意味着非常不同,大约在100000左右.因此,优化例程在每次迭代时检查i是否abs(1-x(i)/x(i-1))<relTol,即通过什么分数自上次迭代以来,新解决方案已发生变化.请注意,x如果您同时优化多个参数(解决方案因此具有"多个组件"),则可以是一组解决方案.当然,您希望在停止进一步优化之前满足所有"解决方案组件"的条件.

然而,当解决方案在零附近时,相对容差变得有问题,因为x/0未定义.因此,有意义的是还要看价值的绝对变化,并在何时退出优化abs(x(i)-x(i-1))<absTol.如果你选择的absTol足够小,它只会对relTol大型解决方案起作用,而absTol只有在解决方案出现在0左右时才会变得相关.

由于当满足两个标准中的任何一个时,求解器停止,因此您获得(局部)最优解的接近程度由absTol或确定relTol.例如,如果relTol是10%,那么除非您的解决方案大约为零,否则您将永远不会比最优解更接近10%,在这种情况下,在absTol标准之前满足标准(例如,0.0001)relTol.