AccuracyGoal
是用于不同数值运算的一个选项,用来指定最后结果要达到的准确度的有效位数.
更多信息
- AccuracyGoal 是诸如 NIntegrate、NDSolve 和 FindRoot 函数的一个选项.
- AccuracyGoal->Automatic 通常生成一个准确目标值,等于 WorkingPrecision 设定值的一半.
- AccuracyGoal->Infinity 指出准确度不应该作为终止计算方案的准则,PrecisionGoal 属于这种情况.
- 尽管可以指定 AccuracyGoal->n,但得到的结果有时可能会远远小于 n 数位的准确度.
- 大多数情形下,必须将 WorkingPrecision 设定为至少与 AccuracyGoal 一样大.
- AccuracyGoal 能有效地指定一个计算方案所允许的绝对误差.
- 通过使用 AccuracyGoal->a 和 PrecisionGoal->p,Wolfram 语言将尽量使大小为
的结果中数值误差小于
.
范例
打开所有单元 关闭所有单元基本范例 (2)
NIntegrate[Sin[x], {x, 0, 2 π}, AccuracyGoal -> 8]在求解一个常微分方程时,利用精度(相对误差)作为误差控制的基础:
s = NDSolve[{x'[t] == x[t], x[0] == 10 ^ -20}, x, {t, 0, 1}, AccuracyGoal -> ∞]relerr[t_] = 1 - x[t] / (Exp[t] 10 ^ -20);relerr[1] /. s如果不指定 AccuracyGoal,相对误差要大得多:
relerr[1] /. NDSolve[{x'[t] == x[t], x[0] == 10 ^ -20}, x, {t, 0, 1}]范围 (2)
f[x_] = Sin[x ^ 2];FindMinimum[f[x], {x, 2}, AccuracyGoal -> 10, PrecisionGoal -> 8]FindMinimum[f[x], {x, 2}, AccuracyGoal -> 10, PrecisionGoal -> ∞]FindMinimum[f[x], {x, 2}, AccuracyGoal -> 20, PrecisionGoal -> ∞]FindMinimum[f[x], {x, 2}, AccuracyGoal -> 20, PrecisionGoal -> ∞, WorkingPrecision -> 40]s32 = NDSolve[{x''[t] + x'[t] ^ 2 + x[t] ^ 5 == 0, x[0] == 1, x'[0] == 0}, x, {t, 0, 5}, WorkingPrecision -> 32]Plot[x[t] /. s32, {t, 0, 5}]AccuracyGoal 和 PrecisionGoal 采用32位工作精度的一半:
sag = NDSolve[{x''[t] + x'[t] ^ 2 + x[t] ^ 5 == 0, x[0] == 1, x'[0] == 0}, x, {t, 0, 5}, WorkingPrecision -> 32, AccuracyGoal -> 16, PrecisionGoal -> 16]它相当于 NDSolve 采用的自动设置:
s32 === sag历史
1988年引入 (1.0) | 在以下年份被更新:2003 (5.0)
文本
Wolfram Research (1988),AccuracyGoal,Wolfram 语言函数,https://reference.wolfram.com/language/ref/AccuracyGoal.html (更新于 2003 年).
CMS
Wolfram 语言. 1988. "AccuracyGoal." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2003. https://reference.wolfram.com/language/ref/AccuracyGoal.html.
APA
Wolfram 语言. (1988). AccuracyGoal. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/AccuracyGoal.html 年
BibTeX
@misc{reference.wolfram_2026_accuracygoal, author="Wolfram Research", title="{AccuracyGoal}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/AccuracyGoal.html}", note=[Accessed: 19-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_accuracygoal, organization={Wolfram Research}, title={AccuracyGoal}, year={2003}, url={https://reference.wolfram.com/language/ref/AccuracyGoal.html}, note=[Accessed: 19-August-2026]}