求解可能有无限解的多项式方程组?
我必须求解多项式方程组,它会给出错误,因为它有无限的解,而我只需要很少的解(任何 2 或 3),那么我怎样才能得到它们呢? ,我可以指定解决方案的条件吗,例如值范围在 1 到 10 之间的解决方案,以便我可以获得很少的值。 方程实际上很复杂,但无限的解是由于“sin(0)”的根源。
I have to solve polynomial equation system which gives error as it has infinite solutions and i just require few solutions(any 2 or 3) so how can i get them? , Can i specify condition on solution like solutions whose values range between 1 to 10 so that i can get few value.
Equations are actually long complicated but infinite solutions are due to "sin(0)" at root.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您可以尝试向系统添加其他方程,例如
x1 = 0
、x2 = 0
等.,限制可能的解决方案的数量。You can try to add additional equations to the system, like
x1 = 0
,x2 = 0
etc., to restrict the number of possible solutions.您在这里指的是解的哪个定义:给定函数对于某些输入的值为零,或者给定的多个方程组在多个点上重叠?后者可以被描述为在一条直线上相交的两个平面,但这不一定是人们在想象求解多项式方程组时所想到的。
例如: x^2 =4 只有 2 个解,但 x^2=y^2 可能有无限多个解,因为 x=y 和 x=-y 都是定义等式成立的线,但两者都可以是我认为多项式方程。
我想您已经阅读过诸如 使用 MATLAB 求解方程、< a href="http://en.wikibooks.org/wiki/MATLAB_Programming/Symbolic_Toolbox" rel="nofollow noreferrer">MATLAB 编程/符号工具箱 和 求解非线性方程,对吧?这些人可能对如何使用 Matlab 来做到这一点有一些想法。
Which definition of a solution are you meaning here: That a given function has a value of zero for certain inputs or that a given system of multiple equations overlap in multiple points? The latter could be described as 2 planes intersecting on a line but this isn't necessarily what people may think of when they picture solving a polynomial equation system.
For example: x^2 =4 has only 2 solutions, but x^2=y^2 may have infinitely many solutions as x=y and x=-y are both lines that define where that equality would hold, yet both can be considered polynomial equations to my mind.
I presume you have read through things like SOLUTION OF EQUATIONS USING MATLAB, MATLAB Programming/Symbolic Toolbox, and Solving non linear equations, right? Those may have some ideas for how to use Matlab to do that.
在 Mathematica 中,您可以使用 FindInstance 查找方程的一个或多个解。以下是如何获得一组特定方程的 2 个解:
您还可以给出不等式,例如 1 < >变量< 10 到 FindInstance 或 Reduce 以进一步限制可能的解决方案,如您所建议的。
In Mathematica you could use FindInstance to find one or more solutions to your equations. Here's how to get 2 solutions of a particular set of equations:
You can also give inequalities like 1 < var < 10 to FindInstance or to Reduce to further restrict possible solutions, as you suggested.
Mathematica 的
FindRoot
函数将为您提供最接近给定值的解,因此您可以对不同的输入多次使用FindRoot
。任何其他数学程序都应该有类似的东西,恰好我目前最熟悉 Mathematica。
Mathematica's
FindRoot
function will give you the closest solution to a given value, so you can useFindRoot
a few times with various inputs.Any other mathematical program should have something similar, it just happens that I'm most familiar with Mathematica at the moment.
如果您以数值方式求解 f(x)=0 形式的系统,则可以使用 FMINCON 添加约束。例如,您可以指定解应介于 1 和 10 之间。
If you solve a system of the form f(x)=0 numerically, you can use FMINCON to add constraints. For example, you can specify that the solution should be between 1 and 10.
与 Jonas 类似,如果您在 Matlab 中以数值方式求解 f(x) = 0,则可以使用 fsolve。如果多项式有许多潜在的输出,您很可能能够从不同的初始点迭代这些输出。
不过,请注意解决方案空间中的局部最小值,它们对于迭代解决方案来说可能是一个严重的问题,因为它们会引导您的算法得出实际上不正确的答案。
In a similar manner to Jonas, if you solve for f(x) = 0 numerically in Matlab, you can use fsolve. Should the polynomial have many potential outputs, you may well be able to iterate towards these from different initial points.
Beware local minima in your solution space though, they can be a serious problem for iterative solutions as they guide your algorithm to an answer that is not actually correct.
如果系统很大或者有很多解决方案(隔离或高维组件),您可以使用 HOM4PS2 等软件包。如果系统(非常)小,您可以通过找到所谓的格罗布纳基来象征性地解决它,它为您提供了一组等效(但不同)的多项式,其解几乎是显而易见的。 Maple 和 Mathematica 7 都可以做到这一点。
If the system is big or there are many solutions (isolated or high dimension components) you can use packages like HOM4PS2. If the system is (extremely) small you can solve it symbolically by finding the so called Grobner's basis, which gives you a equivalent (but different) set of polynomials whose solutions are almost obvious. Both Maple and Mathematica 7 can do this.
Mathematica 提供了很多功能来帮助您。例如:
Mathematica provides quite a few features to help you. For example: