求解二次方程组
任何人都可以找到解决以下系统的方法吗?我尝试了 Reduce
但评估需要一段时间,所以我不确定它是否有效
terms = {{g^2, g h, h^2, -o^2, -o p, -p^2}, {g^2, g k,
k^2, -o^2, -o q, -q^2}, {g^2, g m, m^2, -o^2, -o r, -r^2}, {g^2,
g n, n^2, -o^2, -o s, -s^2}, {h^2, h k,
k^2, -p^2, -p q, -q^2}, {h^2, h m, m^2, -p^2, -p r, -r^2}, {h^2,
h n, n^2, -p^2, -p s, -s^2}, {k^2, k m,
m^2, -q^2, -q r, -r^2}, {k^2, k n, n^2, -q^2, -q s, -s^2}, {m^2,
m n, n^2, -r^2, -r s, -s^2}};
vars = Variables@Flatten@terms;
coefs = Array[c, Dimensions[terms]];
eqs = MapThread[#1.#2 == 0 &, {terms, coefs}];
Reduce[eqs, vars, Reals]
Can anyone see a way to solve the system below? I tried Reduce
but evaluation takes a while so I'm not sure it would work
terms = {{g^2, g h, h^2, -o^2, -o p, -p^2}, {g^2, g k,
k^2, -o^2, -o q, -q^2}, {g^2, g m, m^2, -o^2, -o r, -r^2}, {g^2,
g n, n^2, -o^2, -o s, -s^2}, {h^2, h k,
k^2, -p^2, -p q, -q^2}, {h^2, h m, m^2, -p^2, -p r, -r^2}, {h^2,
h n, n^2, -p^2, -p s, -s^2}, {k^2, k m,
m^2, -q^2, -q r, -r^2}, {k^2, k n, n^2, -q^2, -q s, -s^2}, {m^2,
m n, n^2, -r^2, -r s, -s^2}};
vars = Variables@Flatten@terms;
coefs = Array[c, Dimensions[terms]];
eqs = MapThread[#1.#2 == 0 &, {terms, coefs}];
Reduce[eqs, vars, Reals]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从优化的角度来解决您的问题,构建方程的 rhs 平方和。
定义矩阵:
现在将求解代数方程的代码定义为约束优化:
现在定义一个函数,用给定的解构造一组 c[,]:
生成矩阵:
求解方程更高的工作精度,并强制机器数量:
验证是否找到了预期的解决方案:
希望这会有所帮助。
You can approach your problem from the optimization perspective, building the sum of squares of the r.h.s. of your equations.
Define your matrix:
Now define the code that solve the algebraic equation as a constrained optimization:
Now define a function that constructs a set of c[,] with a given solution:
Generate a matrix:
Solve equations with higher working precision, and coerce to machine numbers:
Verify that the expected solution is found:
Hope this helps.