用唯一解求解非常大的非线性方程组(数值)

发布于 2025-01-09 08:12:29 字数 566 浏览 1 评论 0原文

我遇到过一个非常大的非线性方程组,如下所示:

  • M'UM = A
  • M'VM = B

,其中 M、U、V 未知 d*d 矩阵,A 和 B 是已知的 d*d 矩阵,具有以下性质:

  • U 和 V 是对角矩阵
  • M 的主对角线项全部为 1
  • A 和 B 是对称矩阵,它们的项已知
  • M' 表示M 的转置。

请注意,(非线性)方程的总数和未知变量的总数相同,即。准确地说是d(d+1)。因此,它确保该系统拥有唯一的解决方案。

我尝试使用nleqslv等包在R中以数值方式求解该系统>BB。但他们的文档并未涵盖以矩阵形式输入未知数的情况。在最坏的情况下,我们可以手工编写所有方程,并利用上述包。不过,我正在寻找更好的方法。

任何帮助将不胜感激。即使有人建议其他可能在这方面有所帮助的编程语言或软件,那也没关系。谢谢。

I have encountered a very large system of non-linear equations which looks like:

  • M'UM = A
  • M'VM = B

where M, U, V are unknown d*d matrices, and A and B are known d*d matrices with the following properties:

  • U and V are diagonal matrices
  • The principal diagonal entries of M are all 1's
  • A and B are symmetric matrices, and their entries are known
  • M' denotes the transpose of M.

Note that both the total number of (non-linear) equations and the total number of unknown variables are same, viz. d(d+1) to be precise. So, it ensures that this system possesses a unique solution.

I was trying to solve this system numerically in R using packages like nleqslv and BB. But their documentations do not cover instances where the unknowns are inputted in terms of matrices. In the worst case, we can write all the equations by hand, and make use of the aforementioned packages. However, I am looking for a better method.

Any help will be appreciated. Even if someone suggests some other programming language or software that might help in this regard, that'll be fine too. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷月断魂刀 2025-01-16 08:12:29

我找到了这个问题的部分解决方案。具体来说,我找到了一种方法来找到 M'UM = A 的解,给定 A,假设 A 是对称矩阵。

具体来说,每个实数对称矩阵都可以写成以下形式

X = QDQ transpose

其中 Q 由 X 的特征向量的正交集构成,D 的对角线包含相应的特征值。

来源。

使用 numpy,很容易获得特征值和特征向量:

def solve(A):
    eigenvalues, eigenvectors = np.linalg.eig(A)
    M = eigenvectors
    U = np.diag(eigenvalues)
    M_prime = M.T
    return M, U, M_prime

然后,我在随机对称数组上尝试了这个:

A = np.array([[0.2777055 , 0.17491669, 0.22634241],
       [0.17491669, 0.94572725, 0.4859058 ],
       [0.22634241, 0.4859058 , 0.89480942]])

M, U, M_prime = solve(A)
M @ U @ M_prime

结果:

array([[0.2777055 , 0.17491669, 0.22634241],
       [0.17491669, 0.94572725, 0.4859058 ],
       [0.22634241, 0.4859058 , 0.89480942]])

果然,当你将这三个矩阵相乘时,你会得到原始的 A。

不幸的是,我不知道如何以满足两个方程的方式解决这个问题。

I found a partial solution to this problem. Specifically, I found a way to find a solution to M'UM = A, given A, assuming that A is a symmetric matrix.

Specifically, every real symmetric matrix can be written in the form

X = QDQ transpose

where Q is formed from an orthonormal set of eigenvectors of X and the diagonal of D contains the corresponding eigenvalues.

Source.

Using numpy, it's pretty easy to get the eigenvalues and eigenvectors:

def solve(A):
    eigenvalues, eigenvectors = np.linalg.eig(A)
    M = eigenvectors
    U = np.diag(eigenvalues)
    M_prime = M.T
    return M, U, M_prime

Then, I tried this on a random symmetric array:

A = np.array([[0.2777055 , 0.17491669, 0.22634241],
       [0.17491669, 0.94572725, 0.4859058 ],
       [0.22634241, 0.4859058 , 0.89480942]])

M, U, M_prime = solve(A)
M @ U @ M_prime

Result:

array([[0.2777055 , 0.17491669, 0.22634241],
       [0.17491669, 0.94572725, 0.4859058 ],
       [0.22634241, 0.4859058 , 0.89480942]])

Sure enough, when you multiply those three matricies together, you get back the original A.

Unfortunately, I don't know how to solve this in a way that satisfies both equations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文