Problem finding 2 unknown matrices in 2 equations

1 view (last 30 days)
Hello,
I have 2 equations containing 2 unknown matrices of size nxn that I need to find. The equations looks like this.
I+R=E*T
B1-B1*R=E*B2*T
Where I is the Identity matrix og size nxn, and B1, B2 and E are known matrices of size nxn.
It seems like the built in solve functions doesnt work with matrices, and I cant seem to figure out how to solve it. Can anyone help with this?
Edit: I forgot to mention that the matrices B1 and B2 are diagonal matrices.
- Nicolai Hagelund

Accepted Answer

Matt J
Matt J on 31 Oct 2013
Edited: Matt J on 31 Oct 2013
If you multiply the first equation by B1 and add the equations, you will eliminate R
2*B1=(B1*E+E*B2)*T
You can then just solve for T linear algebraically (backslash) and then use equation (1) to obtain R.
  3 Comments
Matt J
Matt J on 5 Nov 2013
Edited: Matt J on 5 Nov 2013
Yes, you now have 2 equations
B1+B1*R=B1*E*T
B1-B1*R=E*B2*T
If you add them together, the +B1*R and -B1*R terms cancel with each other leading to the equation I showed you before
2*B1=(B1*E+E*B2)*T
Now, R has been eliminated and you just solve this for T.
Nicolai Hagelund
Nicolai Hagelund on 5 Nov 2013
Oh, I thought you meant something else. I sse what you mean now.
Thanks, great help, and exactly what I needed.

Sign in to comment.

More Answers (1)

Matt J
Matt J on 31 Oct 2013
Edited: Matt J on 31 Oct 2013
If n isn't too large,
I=speye(n);
A=[kron(I,I), kron(-I,E); kron(I, B1), kron(I,E*B2)]
b =[-I(:);B1(:)];
RT=full(reshape(A\b,n,2*n));
R=RT(1:n,1:n);
T=RT(1:n, n+1:end);
  1 Comment
Nicolai Hagelund
Nicolai Hagelund on 31 Oct 2013
n is quite large, atleast 998 and can vary. I forgot to mention in the question that the B1 and B2 are diagonal matrices.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!