# Solving a system with three equations and two variables [closed]

I am trying to solve some equations with two variables. This is the last step in the process of determining a x tilt angle of a molecule, as well its depolarization ratio r . To do so, I've defined the three equations:

Xsps[x_,r_]:=0.659*0.696*0.716*Sin[61°]*0.5*(1-r)*(Cos[x]-Cos^3[x])

Xssp[x_,r_]:=(0.659*0.65*0.702*Sin[54°])*0.5*(Cos[x]*(1+r)-(1-r)*Cos^3[x])

Xppp[x_,r_]:=-(1.006*1.077*0.702*Cos[60°]*Cos[61°]*Sin[54°]*0.5*(Cos[x]*(1+r)-(1-r)*
(Cos^3[x])))-(1.006*0.696*1.022*Cos[60°]*Sin[61°]*Cos[54°]*0.5*(1-r)*
(Cos[x]-(Cos^3[x])))+(0.704*1.077*1.022*Sin[60°]*Cos[61°]*Cos[54°]*0.5*(1-r)*
(Cos[x]-(Cos^3[x])))+ (0.704*0.696*0.702*Sin[60°]*Sin[61°]*Sin[54°]*
(r*Cos[x]+(Cos^3[x])*(1-r)))


To find the solutions for r and x (two variables on the above equations), I’ve build a system with two equation, where:

(Xssp/Xpp)^2=(0.120/0.076)^2, (Xsps/Xpp)^2=(0.102/0.076)^2


To solve such system for x and r using Mathematica, I’ve faced some difficulties since I am a beginner with the software. I’ve tried to solve it using the following code, but unsuccessfully:

Nsolve[{(Xsps/Xppp)^2 = (0.076/0.120)^2, (Xssp/Xppp)^2 = (0.076/0.102)^2}, x, r]


Please, I would love to have some help with this issue. Looking forward for any piece of advice.

Following bellow the work code;

Xsps[x_, r_] =
0.659*0.696*0.716*
Sin[61 °]*0.5*(1 - r)*(Cos[x] - (Cos[x]*Cos[x]*Cos[x]))

Xppp[x_, r_] = -(1.006 *1.077*0.702*Cos[60 °]*
Cos[61 °]*
Sin[54 °]*{0.5*(Cos[
x]*(1 + r) - (1 - r)*(Cos[x]*Cos[x]*
Cos[x]))}) - (1.006*0.696*1.022*Cos[60 °]*
Sin[61 °]*
Cos[54 °]*{0.5*(1 -
r)*(Cos[x] - (Cos[x]*Cos[x]*Cos[x]))}) + (0.704*1.077*1.022*
Sin[60 °]*Cos[61 °]*
Cos[54 °]*{0.5*(1 -
r)*(Cos[x] - (Cos[x]*Cos[x]*Cos[x]))}) + (0.704*0.696*0.702*
Sin[60 °]*Sin[61 °]*
Sin[54 °]*{(r*Cos[x] + (Cos[x]*Cos[x]*Cos[x])*(1 - r))})

Xssp[x_, r_] = (0.659*0.650*0.702*
Sin[54 °])*{0.5*(({Cos[x]}*(1 + r)) - ((1 - r)*{Cos[x]*
Cos[x]*Cos[x]}))}

NSolveolve[{(Xsps/Xppp)^2 == (0.076/0.120)^2, (Xssp/Xppp)^2 == (0.076/
0.102)^2}, x,  r]

-

## closed as off-topic by Simon Woods, Yves Klett, Öskå, Szabolcs, aclJun 23 '14 at 16:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Simon Woods, Yves Klett, Öskå, Szabolcs, acl
If this question can be reworded to fit the rules in the help center, please edit the question.

What the h**l is Cos^3[x]? You probably mean Cos[x]^3. –  Öskå Jun 23 '14 at 15:15
Would that mean something to you? –  Öskå Jun 23 '14 at 15:17
Dear Oska, I meant cos^3[x]=cos[x]*cos[x]*cos[x]*. Or Cos[x]^3 (not that Cos[x]^3 is different of Cos[x^3]). Thanks for your help so far... –  a lost grad student Jun 23 '14 at 15:20
Well, tell me if the result in the image fits you. –  Öskå Jun 23 '14 at 15:23
The result I am waiting r must be lower than 2, and x must be a real value of angle between 0 and 90 degrees. –  a lost grad student Jun 23 '14 at 15:28

## 2 Answers

I didn't put much effort into it but at least it works.

Xsps[x_, r_] :=
0.659*0.696*0.716*Sin[61 °]*0.5*(1 - r)*(Cos[x] - Cos[x]^3)

Xssp[x_, r_] := (0.659*0.65*0.702*
Sin[54 °])*0.5*(Cos[x]*(1 + r) - (1 - r)*Cos[x]^3)

Xppp[x_, r_] := -(1.006*1.077*0.702*Cos[60 °]*
Cos[61 °]*
Sin[54 °]*0.5*(Cos[x]*(1 + r) - (1 - r)*(Cos[x]^3))) - (1.006*0.696*1.022*
Cos[60 °]*Sin[61 °]*
Cos[54 °]*0.5*(1 - r)*(Cos[x] - (Cos[x]^3))) + (0.704*1.077*1.022*
Sin[60 °]*Cos[61 °]*
Cos[54 °]*0.5*(1 - r)*(Cos[x] - (Cos[x]^3))) + (0.704*0.696*0.702*
Sin[60 °]*Sin[61 °]*
Sin[54 °]*(r*Cos[x] + (Cos[x]^3)*(1 - r)))

Select[Cases[{x, r} /.
Quiet@Solve[{(Xsps[x, r]/Xppp[x, r])^2 == (0.076/0.120)^2,
(Xssp[x, r]/Xppp[x, r])^2 == (0.076/0.102)^2},
{x,r}], {_Real, _Real}],
First@# < 2 && 0 ° < Last@# < 90 ° &]


{{-2.43194, 0.0762825}, {-0.709652, 0.0762825}, {0.709652, 0.0762825}}

-

This will give you all solutions:

NSolve[{(Xsps[x, r]/Xppp[x, r])^2 == (0.076/0.120)^2, (Xssp[x, r]/
Xppp[x, r])^2 == (0.076/0.102)^2}, {x, r}]

-