Solving for unknown matrix?

47 次查看(过去 30 天)
Andrew Poissant
Andrew Poissant 2017-10-16
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 CenterFile Exchange 中查找有关 Mathematics and Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by