Solving for unknown matrix?

62 ビュー (過去 30 日間)
Andrew Poissant
Andrew Poissant 2017 年 10 月 16 日
コメント済み: John D'Errico 2022 年 12 月 17 日
I have three known matrices, and one unknown matrix that I need to solve for. The matrices are defined in the code below. The equation to find phi is G = C*phi*B. How do I solve for phi? I tried doing phi = inv(C)*G*inv(B) but C and B are not square matrices.
syms t
G = [10*exp(-t) 3*exp(-t); 0 exp(-2*t)*cos(3*t)+2/3*exp(-2*t)*sin(3*t)];
C = [13 4 1; 1 1 0];
B = [1 0; -1 1; 1 -1];

回答 (3 件)

David Goodmanson
David Goodmanson 2017 年 10 月 26 日
Hi Andrew,
I understand that you are looking for a symbolic solution, but if G were a matrix of numbers, then
phi = C\G/B
is the fastest way to find a phi that works. For your matrix dimensions, phi always has four nonzero elements, but they are not necessarily in the upper left corner of the 3x3.
As Walter has mentioned, the solution for psi is far from unique. For more solutions,
nullC = null(C)
nullBtt = null(B.').'
c1 = rand(1,3); % c1 is 1x3 vector of arbitrary constants; rand here for demo
c2 = rand(3,1); % c2 is 3x1 vector of arbitrary constants; rand here for demo
arb1 = nullC*c1;
arb2 = c2*nullBtt;
phi_new = phi + arb1 + arb2 % another solution

Walter Roberson
Walter Roberson 2017 年 10 月 16 日
phi = sym('phi', [3 3]);
one_solution = solve(G == C*phi*B, phi(1:2,1:2));
Now one_solution.phi1_1, .phi1_2, .phi2_1, and .phi2_2 give definitions for the top left corner of phi in terms of the other entries of phi . That is, the system is underdetermined and there are an infinite number of solutions.

Zahid Ullah
Zahid Ullah 2022 年 12 月 17 日
  2 件のコメント
DGM
DGM 2022 年 12 月 17 日
% Ax + B = R
A = [5 -2; 3 -2];
B = [3 5; 4 -1];
R = [7 0; 4 -8];
% solve for x
x = A\(R-B)
x = 2×2
2.0000 1.0000 3.0000 5.0000
% back-calculate R, check
R2 = A*x + B
R2 = 2×2
7.0000 0 4.0000 -8.0000
John D'Errico
John D'Errico 2022 年 12 月 17 日
@Zahid Ullah please don't post questions as an anser to a completely different question. Learn to ask a question, not post an answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by