solving for unknown matrix element as function of an undetermined independent variable

4 views (last 30 days)
Assume a matrix equation of the form A*x=b, where matrix A has elements that are functions of an independent variable "E" which is to be determined later (For example, for simplicity,let the four matrix elements be a11=@(E) 2*E, a12=@(E) E^2 and so on for a21 and a22 to have any form of functions)
vector x=[1,r] where r is unknown to be found as a function of E
vector b=[t,0] where t is unknown to be found as a function of E
the question goes: Is there a possible way to code the problem (as it is without further manual mathematical manipulations) to find "t" and "r" as functions of E

Accepted Answer

John D'Errico
John D'Errico on 21 Sep 2018
Think about it. Write out what you are asking. You have a 2x2 matrix, where each element is a function of the unknown variable E. (Some of those elements may be a constant.) But assume that there is only one unknown in A, and that is the variable E. So write it out!!!!!!!!
A = [A11(E),A12(E);A21(E),A22(E)];
So what is A times some vector x? Lets use the example you gave. x = [1;r], b = [t;0]. Then A*x=b means this:
A11(E) + A12(E)*r = t
AND
A21(E) + A22(E)*r = 0
Here, we assume that r and t are fixed variables, although they are not given any known value. Is there a way to solve for E?
NO NO NO. I said it three times, so it must be true.
You are posing TWO equations in the ONE unknown variable E. In general, there will never be any solution to solve for E that satisfies BOTH equations, unless one of them is trivially true, or unless they are both essentially the same equation.
The point is a matrix equation of this form is equivalent to TWO equations. With only one variable to solve for, you have no way forward.
  5 Comments

Sign in to comment.

More Answers (2)

Matt J
Matt J on 21 Sep 2018
Edited: Matt J on 21 Sep 2018
Yes, the solution would be,
C=[a12(E) -1;a22(E) 0 ];
d=[-a11(E);-a12(E)];
xr= inv(C)*d %xr=[x(E);t(E)]
  2 Comments
mina asham
mina asham on 21 Sep 2018
thanks for your reply but here you deduced another matrix yourself "C" and continued coding. this example is a simple one for a more complicated problem so I dont want to manipulate anything myself, just enter the original matrices and look for the results
Matt J
Matt J on 21 Sep 2018
Edited: Matt J on 21 Sep 2018
Couldn't you just use solve() ? However, as long as the problem has the general linear structure A*x=b (the structure you told us to assume) and as long as x,b are linear in the unknowns. I don't see why the solution wouldn't generalize easily.

Sign in to comment.


Bruno Luong
Bruno Luong on 21 Sep 2018
Edited: Bruno Luong on 21 Sep 2018

If there is an solution it would be:

r = @(E) (-a21(E)./a22(E))
t = @(E) (a11(E) - a12(E).*a21(E)./a22(E))

Community Treasure Hunt

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

Start Hunting!