Wolfram mathematica 如何在Mathematica 9中求解方程组

Wolfram mathematica 如何在Mathematica 9中求解方程组,wolfram-mathematica,Wolfram Mathematica,得到了一个简单的方程,但Mathematica无法得到: Solve[{Sin[x] == y, x + y == 5}, {x, y}] Error: this system cannot be solved with the methods available to Solve 我是否使用了正确的功能?如果没有,我应该用什么?Mathematica知道很多,但它肯定不知道数学的一切。当产品出现故障时,您可以尝试几种不同的方法: 首先,让我们绘制它: ContourPlot[{Sin[x]

得到了一个简单的方程,但Mathematica无法得到:

Solve[{Sin[x] == y, x + y == 5}, {x, y}]

Error: this system cannot be solved with the methods available to Solve

我是否使用了正确的功能?如果没有,我应该用什么?

Mathematica知道很多,但它肯定不知道数学的一切。当产品出现故障时,您可以尝试几种不同的方法:

首先,让我们绘制它:

ContourPlot[{Sin[x] == y, x + y == 5}, {x, -10, 10}, {y, -10, 10}]

这是一条与正弦波相交的线,看起来只有一个解。该点接近于
(5,0)
,因此让我们使用牛顿法来找到根:

FindRoot[{Sin[x] == y, x + y == 5}, {x, 5}, {y, 0}]
这给出了答案
{x->5.61756,y->-0.617555}
。您可以通过将等式中的
x
y
替换为解决方案中提供的值来验证:

{Sin[x] == y, x + y == 5} /. {x -> 5.6175550052727`,y -> -0.6175550052726998`}
这就给出了
{True,True}
,因此解决方案是正确的。有趣的是,正如另一位评论者指出的,Wolfram Alpha在您键入以下内容时给出了相同的解决方案:

solve Sin[x]==y,x+y==5

您可以直接从Mathematica访问Wolfram Alpha,方法是在新行开头键入
=

您是否尝试过将变量域显式提供为参数?(它可能突破了虚数)另外:有趣的是,WolframAlpha为该查询提供了一个独特的解决方案,如前所述。我在这台电脑上没有Mathematica,否则我会为你做更多的挖掘。我对Mathematica很陌生,我怎么能做到呢?查看范围->多变量(9)中的实方程和不等式系统的示例。
Solve[{Sin[x]==y,x+y==5},{x,y},Reals]
将得到实值解。