减少具有实数(非整数)系数的多项式的误差结果
在 Mathematica 中,我尝试检查多项式的某些条件,该多项式的参数在一定范围内变化。我的计算是五阶的,但我做了一个简单的计算来显示我的需求。
当我创建一个以整数作为参数的多项式时,我使用Reduce
,它给了我正确的答案。
但是当我在多项式中使用实数时,Reduce
不起作用并给出以下错误:
Reduce 无法求解系数不精确的系统。通过求解相应的精确系统并对结果进行数值化得到答案。
有人可以帮忙吗?
In Mathematica, I tried to check some condition for a polynomial, whose parameters change in a range. My calculations are 5th order but I made a simple one to show my needs.
When I create a polynomial, which has integers as parameter, I use Reduce
and it gives me right answer.
But when I use real numbers in the polynomial, Reduce
doesn't work and gives this error:
Reduce was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Reduce::ratnz
消息不是错误,而是警告消息。如果您点击更多
链接或>>
,无论您的系统上显示什么,它都会带您进入文档,内容如下:现在,如果您对该消息感到恼火,您可以使用
以下命令关闭该消息: 所有进一步使用
Reduce
时发出警告,或者您可以简单地使用“如果您想避免”消息来静默此操作,则如文档所述,您必须使用精确的数字。一种方法是使用
Rationalize
。例如:它为您提供您想要的输出,而不发出警告。可能还有其他方法,具体取决于您正在做什么,但在不知道您的确切表达的情况下很难说。希望这有帮助。
The
Reduce::ratnz
message is not an error, but a warning message. If you click on theMore
link or>>
, whatever shows on your system, it'll take you to the documentation, which says:Now, if you're annoyed by the message, you can turn the message off using
which will turn off the warning for all further uses of
Reduce
or you can simply silence this operation usingIf you want to avoid the message, then as the documentation says, you'll have to use exact numbers. One way is to use
Rationalize
. For example:It gives you the output you desire, without a warning. There might be other ways depending on what exactly you're doing, but it's hard to say without knowing your exact expression. Hope this helped.