在Mathematica中解决矩阵方程组:

huangapple go评论52阅读模式
英文:

Solving a system of matrix equations in Mathematica

问题

我正在尝试找到满足六个矩阵方程的矩阵。

以下是这些方程:

(Conjugate[ConjugateTranspose[B1]].X.ConjugateTranspose[B1]) == TotalPrB1,
(Conjugate[ConjugateTranspose[B2]].X.ConjugateTranspose[B2]) == TotalPrB2,
(Conjugate[ConjugateTranspose[B3]].X.ConjugateTranspose[B3]) == TotalPrB3,
(Conjugate[ConjugateTranspose[B4]].X.ConjugateTranspose[B4]) == TotalPrB4,
(Conjugate[ConjugateTranspose[B5]].X.ConjugateTranspose[B5]) == TotalPrB5,
(Conjugate[ConjugateTranspose[B6]].X.ConjugateTranspose[B6]) == TotalPrB6

在这里,每个矩阵都是 8*8。我想找到一个矩阵 X,满足上述所有方程。

我尝试使用 FindRoot 和 Nsolve 函数,但未能获得所需的结果。FindRoot 只能解决一个矩阵方程。

您可以建议一种解决上述系统以找到 X 的方法吗?

英文:

I am trying to find a matrix that satisfies six matrix equations.

The equations are as follows:

(Conjugate[ConjugateTranspose[B1]].X.ConjugateTranspose[B1]) == TotalPrB1,
(Conjugate[ConjugateTranspose[B2]].X.ConjugateTranspose[B2]) == TotalPrB2, (Conjugate[ConjugateTranspose[B3]].X.ConjugateTranspose[B3]) == TotalPrB3, (Conjugate[ConjugateTranspose[B4]].X.ConjugateTranspose[B4]) == TotalPrB4, (Conjugate[ConjugateTranspose[B5]].X.ConjugateTranspose[B5]) == TotalPrB5, (Conjugate[ConjugateTranspose[B6]].X.ConjugateTranspose[B6]) == TotalPrB6

Where, every matix is 8*8. I want to find a X that satisfies all the above equations.

I tried to use FindRoot and Nsolve function but was unable to get the desired result. FindRoot can only solve for X satisfying one matrix equation.

Can you suggest a way to find X solving the above system?

答案1

得分: 0

在一小部分秒钟内,该代码返回False,表示针对这些特定的系数没有解决方案。如果我伪造我的矩阵以确保有解,那么它会在同样短的时间内找到解决方案。根据经验,对于这么多变量,能够找到任何解决方案都是非常幸运的,我怀疑这只是因为你的问题形式很简单。但是我不知道你的六个矩阵和六个系数是什么,你的可能不是实数,也不知道是否存在解决方案。

当你使用这段代码与你的系数时会发生什么呢?

英文:

In a fraction of a second this

B1=RandomReal[{-1,1},{8,8}];B2=RandomReal[{-1,1},{8,8}];B3=RandomReal[{-1,1},{8,8}];
B4=RandomReal[{-1,1},{8,8}];B5=RandomReal[{-1,1},{8,8}];B6=RandomReal[{-1,1},{8,8}];
X=Array[x,{8,8}];
{TotalPrB1,TotalPrB2,TotalPrB3,TotalPrB4,TotalPrB5,TotalPrB6}=RandomReal[{-10,10},6];
Reduce[{
  Conjugate[ConjugateTranspose[B1]].X.ConjugateTranspose[B1]==TotalPrB1,
  Conjugate[ConjugateTranspose[B2]].X.ConjugateTranspose[B2]==TotalPrB2,
  Conjugate[ConjugateTranspose[B3]].X.ConjugateTranspose[B3]==TotalPrB3,
  Conjugate[ConjugateTranspose[B4]].X.ConjugateTranspose[B4]==TotalPrB4,
  Conjugate[ConjugateTranspose[B5]].X.ConjugateTranspose[B5]==TotalPrB5,
  Conjugate[ConjugateTranspose[B6]].X.ConjugateTranspose[B6]==TotalPrB6},
  Flatten[X]]

returns False, indicating that there is no solution for those particular coefficients. If I fake my matricies to ensure there is a solution then it finds it in the same fraction of a second. Based on experience, with this many variables you are VERY lucky that it is able to find any solution at all, I suspect that is only because the form of your problem is simple. BUT I have no idea what your six matricies and six coefficients are, yours probably aren't Real, and whether a solution exists for those nor not.

So what happens when you use this code with your coefficients?

huangapple
  • 本文由 发表于 2023年6月15日 17:52:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76481298.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定