Mathematica Solve a system of equations numerically

Click For Summary
SUMMARY

The discussion focuses on solving a system of equations numerically using Mathematica. The user initially employed NSolve, which proved inefficient for their equations. After receiving advice, they switched to FindRoot, which successfully resolved the equations with the assigned values of v, α, and β. This highlights the importance of selecting appropriate numerical methods for solving complex equations.

PREREQUISITES
  • Familiarity with Mathematica 12.0 syntax and functions
  • Understanding of numerical methods for solving equations
  • Knowledge of trigonometric functions and their applications
  • Basic proficiency in defining and manipulating variables in Mathematica
NEXT STEPS
  • Explore the FindRoot function in Mathematica for solving nonlinear equations
  • Learn about the differences between NSolve and FindRoot in Mathematica
  • Investigate numerical stability and convergence criteria for iterative methods
  • Study the application of trigonometric identities in solving complex equations
USEFUL FOR

Mathematics students, researchers, and professionals working with numerical methods in Mathematica, particularly those dealing with complex systems of equations.

member 428835
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}]
 
Physics news on Phys.org
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##
 
Dale said:
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;
 
Try using FindRoot instead of NSolve
 
  • Like
Likes member 428835
Worked like a charm: thanks!
 
  • Like
Likes Dale

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
Replies
6
Views
2K