"Jeremy " <email@example.com> wrote in message news:firstname.lastname@example.org... > 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:
> 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.
> %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: