Solving a system of equations in R2014a

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!

Answers (1)

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 Comment

yes, that way it should return 4 constants.
I was looking to obtain r_ex_trial and alpha_ex_trial as functions of beta_ex (3 symbolic variables, where beta_ex is known)

Sign in to comment.

Asked:

on 13 May 2015

Edited:

on 13 May 2015

Community Treasure Hunt

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

Start Hunting!