Solve non-linear system equation in matrix form

Hi, Someone could help me to solve my system equations:
where U is an Unit matrix of 3x3. This is my try used solve fuction
syms yX zX zY zZ yZ
A=[cos(40/180*pi) 0 sin(40/180*pi); yX 0.5 yZ; zX zY zZ];
U=eye(3);
eqn=A*transpose(A)==U;
[yX,zY,zZ,yZ]=solve(eqn,[yX,zY,zZ,yZ]);
Thanks

1 comentario

post your equation as a text, this allows to copy it and paste it.

Iniciar sesión para comentar.

 Respuesta aceptada

John D'Errico
John D'Errico el 4 de Mzo. de 2016
Editada: John D'Errico el 4 de Mzo. de 2016
You have a system of equations in the 5 unknowns:
lyx lzx lzy lyz lzz
These are not even linear equations. What does it mean to try to solve the system A*A.' = U, where each of these matrices are 3x3 matrices?
Effectively, you are trying to solve a set of partially QUADRATIC equations in 5 unknowns, but you have 9 such equations!
syms lyx lzx lzy lyz lzz
A = [.7660 0 .6428;lyx .5 lyz;lzx lzy lzz];
Now lets expand the product A*A.' in symbolic form.
V = vpa(A*A.',5)
V =
[ 0.99995, 0.766*lyx + 0.6428*lyz, 0.766*lzx + 0.6428*lzz]
[ 0.766*lyx + 0.6428*lyz, lyx^2 + lyz^2 + 0.25, 0.5*lzy + lyx*lzx + lyz*lzz]
[ 0.766*lzx + 0.6428*lzz, 0.5*lzy + lyx*lzx + lyz*lzz, lzx^2 + lzy^2 + lzz^2]
In order to solve this problem for some general numeric matrix U, we need to recognize that EVERY one of these terms must be equal to the corresponding term on the right hand side, as an element of U. So we MUST have U(1,1) be 0.99995.
Furthermore, the other elements of U must match up with their corresponding elements of the product.
But in the end, you need to recognize that you have ONLY 5 unknowns, but you have 9 equalities. Of course, one of those equalities is the trivial one. Hopefully the constant matches up for U(1,1). So really you have 8 equalities, some of which are linear in the parameters, some are second order multinomials.
Except for very rare cases, there may well be no exact solution, as this is an over-determined nonlinear system of equalities.
Lets try a test case. I'll force the first element of U to be a perfect match.
U = sym(rand(3));
U(1,1) = V(1,1);
solve(V == U)
ans =
lyx: [0x1 sym]
lyz: [0x1 sym]
lzx: [0x1 sym]
lzy: [0x1 sym]
lzz: [0x1 sym]
So solve found no solution. vpasolve will also fail, again, because there are more equations than unknowns.
I'm sorry, but it is easy to pose problems in mathematics with no simple solution.

2 comentarios

Le Anh DOAN
Le Anh DOAN el 4 de Mzo. de 2016
Hi, thanks for your advive, i think i have made this system become unsolvable when i replace the value of cos(40) and sin(40) by the approximated values . Actually, i take this system from a book, this will have a solution. If this is the case of system equation as in figure below. Can you give me some suggestion. Thanks so much.
You can call sind() and cosd() when you construct the matrix.
Once you do that and do the matrix multiplication, subtract eye(3) and solve() and there should be no problem.

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 4 de Mzo. de 2016
look at this example
syms a b c
eq=[a 2 3;a b 1; c 5 4]*[a 2 3;a b 1; c 5 4]==randi(3,3,3)
out=solve(eq)

3 comentarios

Hi, your example doesn't work. It's return an empty structure. The result looks like this:
out =
a: [0x1 sym]
b: [0x1 sym]
c: [0x1 sym]
If you have posted your equation as a text instead of a picture, we could have tested your equation with your own values
Le Anh DOAN
Le Anh DOAN el 4 de Mzo. de 2016
Hi, the equation is in my code, can you use it?

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Mzo. de 2016

Comentada:

el 4 de Mzo. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by