Refine
更多信息和选项
- 假设可能由等式、不等式、域说明(比如 x∈Integers)以及这些的逻辑组合构成.
- Refine 可以用在等式、不等式和域说明中.
- 出现在代数不等式的量总是假定为真.
- Refine 是 Simplify 转换形式之一.
- 给出以下选项:
-
Assumptions $Assumptions 附加到 assum 的默认假设 TimeConstraint 30 尝试进行任意的特殊转换所需的时间
范例
打开所有单元 关闭所有单元基本范例 (2)
Sqrt[x ^ 2]Sqrt[Pi ^ 2]当符号表达式
假设为正数时,Refine 求解
为
:
Refine[Sqrt[x ^ 2], x > 0]Refine[Sqrt[x ^ 2], x∈Reals]Assuming 用来为几个 Refine 调用指定同样的假设:
Assuming[x ≥ 0 && y < 0, If[TrueQ[Refine[x - y > 0]], Refine[Sqrt[x ^ 2y ^ 2]], 0]]范围 (9)
Refine[(x ^ 3) ^ (1 / 3), x ≥ 0]Refine[(a ^ b) ^ c, -1 < b < 1]Refine[a ^ p b ^ p, a > 0 && b > 0]Refine[Log[x], x < 0]Refine[Log[x ^ p], -1 < p < 1]Refine[Sin[k Pi], Element[k, Integers]]Refine[Cos[x + k Pi], Element[k, Integers]]Refine[ArcTan[Tan[x]], -Pi / 2 < Re[x] < Pi / 2]Refine[a ^ 2 - b ^ 2 + 1 == 0, a + b == 0]Refine[a ^ 2 - a b + b ^ 2 ≥ 0, Element[a | b, Reals]]Refine[(x - 1) ^ 2 + (y - 2) ^ 2 < 3 / 2, x ^ 2 + y ^ 2 ≤ 1]Element 说明:
Refine[Element[(2x + x ^ p) / (x Gamma[x + 2]), Reals], x > 0 && p > 0]Refine[Element[2k ^ 3 Floor[x] ^ k, Integers], Element[k, Integers] && k > 0 && Element[x, Reals]]Floor,Ceiling,Round,IntegerPart 和 FractionalPart:
Refine[Floor[2a + 1], Element[a, Integers]]Refine[Ceiling[x], 2 < x ≤ 3]Refine[FractionalPart[a], a < 0 && Mod[a, 1] == 1 / 3]Mod:
Refine[Mod[a, 4], Element[(a + 3) / 4, Integers]]Re,Im,Abs, Arg,Conjugate 和 Sign:
Refine[Re[a + b I], Element[a | b, Reals]]Refine[Sign[x ^ 2 - x y + y ^ 2 + 1], Element[x | y, Reals]]选项 (4)
Assumptions (3)
Assumptions 给出一个参数和一个可选值:
Refine[Cos[k Pi] ^ m, Element[k, Integers], Assumptions -> Mod[m, 2] == 0]Assumptions 选项的默认值是 $Assumptions:
Assuming[x > 0, Refine[Sqrt[x ^ 2]]]Refine[Sqrt[x ^ 2]]当 Assumptions 作为一个变量给出时,$Assumptions 也可以使用:
Assuming[x > 0, Refine[Sqrt[x ^ 2 y ^ 2], y < 0]]把 Assumptions 指定为可选值,阻止 Refine 用 $Assumptions:
Assuming[x > 0, Refine[Sqrt[x ^ 2 y ^ 2], Assumptions -> y < 0]]TimeConstraint (1)
Refine[Sqrt[(x ^ 6 + y ^ 6 + z ^ 6 - x y z) ^ 2], (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 ≤ 1 / 4]//TimingRefine[Sqrt[(x ^ 6 + y ^ 6 + z ^ 6 - x y z) ^ 2], (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 ≤ 1 / 2]//TimingTimeConstraint 的值限制了单独条件检查所用时间:
ClearSystemCache[]Refine[Sqrt[(x ^ 6 + y ^ 6 + z ^ 6 - x y z) ^ 2], (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 ≤ 1 / 2, TimeConstraint -> 1]//Timing在1秒时间限制下,Refine 不能证明
:
Refine[Sqrt[(x ^ 6 + y ^ 6 + z ^ 6 - x y z) ^ 2], (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 ≤ 1 / 4, TimeConstraint -> 1]//Timing应用 (1)
numberOfRealRoots[{a_, b_, c_}, assum_] :=
Assuming[assum,
If[Refine[a == 0],
If[Refine[b == 0],
If[Refine[c == 0], Infinity, 0, Indeterminate],
1,
Indeterminate],
Switch[Refine[Sign[b ^ 2 - 4a c]],
1, 2,
0, 1,
-1, 0,
_, Indeterminate],
Indeterminate]]numberOfRealRoots[{a, b, a}, a > b > 0]numberOfRealRoots[{a, b, a}, b > 2a > 0]numberOfRealRoots[{0, b, c}, b != 0]属性和关系 (4)
对于数值表达式,Refine 的规则对应于自动化简规则:
Log[Pi ^ E]Refine[Log[x ^ y], x > 0 && Element[y, Reals]]Assuming 用来扩散假设:
Assuming[x > 0, Refine[Sqrt[x ^ 2]]]对更多化简规则,使用 Simplify:
Refine[Sqrt[x ^ 2 + 2x y + y ^ 2], x + y ≥ 0]Simplify[Sqrt[x ^ 2 + 2x y + y ^ 2], x + y ≥ 0]对特殊函数化简,使用 FullSimplify:
FullSimplify[ExpIntegralE[a + 1, 0], Re[a] > 0]技术笔记
-
▪
- 使用假定
历史
2003年引入 (5.0)
文本
Wolfram Research (2003),Refine,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Refine.html.
CMS
Wolfram 语言. 2003. "Refine." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/Refine.html.
APA
Wolfram 语言. (2003). Refine. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Refine.html 年
BibTeX
@misc{reference.wolfram_2026_refine, author="Wolfram Research", title="{Refine}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/Refine.html}", note=[Accessed: 28-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_refine, organization={Wolfram Research}, title={Refine}, year={2003}, url={https://reference.wolfram.com/language/ref/Refine.html}, note=[Accessed: 28-November-2026]}