# Solve a system of equations numerically

• Mathematica
Gold Member
Hi PF!

I'm trying to solve three equations in Mathematica, but NSolve is taking FOREVER. Am I missing perhaps an easier way? The equations are below:

Code:
NSolve[{1/2 r (r \[Theta] + (2 h + r Cos[\[Theta]]) Sin[\[Theta]]) ==
v, Cos[\[Alpha]] == -Sin[\[Theta] - \[Beta]],
Tan[\[Theta]] == (-h Cot[\[Beta]] +
Sqrt[-h^2 + r^2 Csc[\[Beta]]^2])/(
h + Cot[\[Beta]] Sqrt[-h^2 + r^2 Csc[\[Beta]]^2])  }, {r, \[Theta],
h}]

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
Dale
Mentor
The system of equations needs to be numerical once you plug in ##r##, ##\theta##, and ##h##. In this case it is not, you still have ##v##, ##\alpha##, and ##\beta##

Gold Member
The system of equations needs to be numerical once you plug in r, θ, and h. In this case it is not, you still have v, α, and β
Sorry, I forgot to post but I did assign those three values:

Code:
v = 2;
\[Alpha] = 30 \[Pi]/180;
\[Beta] = \[Pi]/4;

Dale
Mentor
Try using FindRoot instead of NSolve

• joshmccraney
Gold Member
Worked like a charm: thanks!

• Dale