Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Solve Matrix Equation AX=XB, Clarification
Replies: 6   Last Post: Jul 18, 2013 2:32 PM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 18,038 Registered: 12/7/04
Re: Solve Matrix Equation AX=XB, Clarification
Posted: Jul 17, 2013 5:50 PM

"Jeremy " <jlawrence6809@gmail.com> wrote in message
news:ks6m5p\$8di\$1@newscl01ah.mathworks.com...
> I'm doing a school project with a vector network analyzer and gathering
> data on four adapters which I'll call a,b,c,d. Each of these devices can
> be characterized with a 2x2 matrix, and when you multiply these matrices
> together you get a 2x2 matrix that characterizes these adapters hooked
> together. I am hooking the adapters up in the configurations a-c-b and
> a-d-b which gives the resultant 2x2 matrices that I'll call s and t. I
> know the characteristic matrices for c and d but not a and b, and it is my
> goal to solve for them. So the resulting equations look like the
> following:

*snip*

> To see if the equations given in this thread would work for me I created
> dummy values for [a],[b],[c], and [d], used them to solve for [s] and [t],
> and used them with the equations given to see if they would give me back
> [a]. The matlab code is the following:
>
> %initial values
> a =[2, 3;5, 7];
> b =[11 , 13;17 , 19];
> c =[23 , 29;31 , 37];
> d =[41 , 43;47 , 53];
> %setup
> s = av*c*b;

I assume this was supposed to be a*c*b?

> t = a*d*b;
> A = s/t;
> B = c/d;

For A*X = X*B, one solution is the appropriately sized zero matrix. This is
the solution the LYAP function in Control System Toolbox returns.

http://www.mathworks.com/help/control/ref/lyap.html

> %calculate
> n = length(A);
> G = kron(eye(n),A)-kron(B.',eye(n));
> x = null(G)

NULL gives _A_ basis for the nullspace of G. You can check that it gives you
a solution of your system of equations:

xv = reshape(x(:, 1), [2 2]);
A*xv-xv*B

The difference seems pretty small to me, smaller even than A*a-a*B.

> I do not however get the expected result for [a]! Is it a problem of not
> having an initial value or something like that? I have a few more
> measurements I could make to introduce an initial value but from there I'm
> not sure how to combine these equations.

You're assuming uniqueness. Since you wrote your equation in the form
A*X=X*B, your B is the negative of the B using the form in the Wikipedia
entry:

http://en.wikipedia.org/wiki/Sylvester_equation

So your equation has a unique solution if and only if your A and B have no
common eigenvalues. It looks to me like they have two (out of two)
eigenvalues that are pretty darn close to being the same.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Date Subject Author
7/17/13 Jeremy
7/17/13 Steven Lord
7/17/13 Jeremy
7/17/13 dpb
7/17/13 Jeremy
7/18/13 Jeremy
7/18/13 Jeremy