Solving a system of equations in R2014a
Mostrar comentarios más antiguos
What am I doing wrong?:
being "beta_ex" a known function dependent on 't',
syms t r_ex_trial alpha_ex_trial
u1=-r_ex_trial*cos(alpha_ex_trial);
v1=-sin(beta_ex);
u2=r_ex_trial*sin(alpha_ex_trial);
v2=-cos(beta_ex);
eqns=[u1==v1+10, u2==v2+5];
vars=[r_ex_trial, alpha_ex_trial];
[sol1,sol2]=solve(eqns,vars,'ReturnConditions',true);
Why does this happen?:
Warning: 4 equations in 2 variables.
Somehow it does not sepparate the equations from the variables. (I've already tried in different ways)
Thanks in advance!
Respuestas (1)
Alan Weiss
el 13 de Mayo de 2015
After I played with your system for a couple of minutes I got the following error:
Error using solve (line 258)
The number of output arguments must equal the number of independent variables in a
system plus 2.
So I tried the following:
[sol1,sol2,sol3,sol4]=solve(eqns,'ReturnConditions',true);
It worked.
This also worked:
[sol1,sol2,sol3,sol4]=solve(eqns,vars,'ReturnConditions',true);
Alan Weiss
MATLAB mathematical toolbox documentation
1 comentario
José Sarilho
el 13 de Mayo de 2015
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!