AQB+CQD=E - how to solve for Q?
4 views (last 30 days)
Show older comments
I am trying to find Q in the following :
AQB+CQD=E
All parameters are matrices (up to 12x12). Q is a 6x6 matrix with all non-diagonal values set to zero. Having a pre-multipler and a post-multiplier is causing me some problems.
I could expand it out into a series of linear equations and then do a linear regression on the results to find the diagonals of Q. However, this is tedious to complete (and therefore prone to error). I suspect there is a suitable MATLAB function that can help me. Any pointers would be very welcome.
Thanks
Matt
3 Comments
Star Strider
on 3 Aug 2012
Much depends on the structure and condition numbers of your matrices. Never having seen your equation before, the best I can do is refer you to ‘Systems of Linear Equations’ http://www.mathworks.com/help/techdoc/math/f4-983672.html
John Petersen
on 3 Aug 2012
Your statement that all parameters are up to 12x12 (I'm assuming you mean A,B,C,D,E), but that Q is 6x6 conflicts with your form of the equation. It helps to know that Q is diagonal, but I reiterate what Miro asks, what are ABCDE? vectors, matrices, what?
Accepted Answer
Teja Muppirala
on 4 Aug 2012
Just making some test data...
A = randn(12,6);
B = randn(6,12);
C = randn(12,6);
D = randn(6,12);
Q_true = diag(randn(6,1));
E = A*Q_true*B + C*Q_true*D;
You can solve it using linear algebra:
M = arrayfun(@(k) reshape((A(:,k) * B(k,:) + C(:,k) * D(k,:)),[],1),1:size(A,2),'uniform',0);
M = cat(2,M{:});
Q_solution = diag(M\E(:))
Or solve it by using FSOLVE:
f = @(q) norm(A*diag(q)*B + C*diag(q)*D - E,'fro')
Q_solution = diag(fsolve(f,zeros(6,1)));
More Answers (0)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!