How can I solve two nonlinear equations?

I have two equations:
1: x1+x2=a-b*cos(th)
2: x1^2+x2^2=c-d*cos(th)
where th is the inputvariable; a,b,c,d are constants; and x1 and x2 are the output variables. How can I solve these equations using matlab such that I get two separate symbolic expressions for x1 and x2, as a function of th? Thank you in advance,

 Accepted Answer

syms x1 x2 a b c d th
solve(x1+x2-(a-b*cos(th)), x1^2+x2^2-(c-d*cos(th)),x1,x2)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!