Solving for unknown matrix?

62 Ansichten (letzte 30 Tage)
Andrew Poissant
Andrew Poissant am 16 Okt. 2017
Kommentiert: John D'Errico am 17 Dez. 2022
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];

Antworten (3)

David Goodmanson
David Goodmanson am 26 Okt. 2017
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 am 16 Okt. 2017
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 am 17 Dez. 2022
  2 Kommentare
DGM
DGM am 17 Dez. 2022
% 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 am 17 Dez. 2022
@Zahid Ullah please don't post questions as an anser to a completely different question. Learn to ask a question, not post an answer.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by