Solve a system of equations numerically

  • Mathematica
  • Thread starter joshmccraney
  • Start date
  • #1
joshmccraney
Gold Member
1,955
102
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}]
 

Answers and Replies

  • #2
30,005
6,391
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##
 
  • #3
joshmccraney
Gold Member
1,955
102
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;
 
  • #4
30,005
6,391
Try using FindRoot instead of NSolve
 
  • Like
Likes joshmccraney
  • #5
joshmccraney
Gold Member
1,955
102
Worked like a charm: thanks!
 
  • Like
Likes Dale

Related Threads on Solve a system of equations numerically

Replies
6
Views
10K
Replies
1
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
5
Views
809
Replies
0
Views
6K
Replies
2
Views
4K
Top