Solve a system of equations numerically

In summary, the conversation discusses using Mathematica to solve a system of three equations. The person is having trouble with NSolve taking a long time and asks if there is an easier way. The equations involve variables like r, θ, h, v, α, and β, and need to be numerical once those values are plugged in. The person also mentions using FindRoot as an alternative to NSolve, which worked successfully for them.
  • #1
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
  • #2
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
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;
 
  • #4
Try using FindRoot instead of NSolve
 
  • Like
Likes member 428835
  • #5
Worked like a charm: thanks!
 
  • Like
Likes Dale

FAQ: Solve a system of equations numerically

What is the process for solving a system of equations numerically?

The process for solving a system of equations numerically involves converting the equations into a matrix form, selecting an appropriate numerical method (such as Gaussian elimination or Jacobi iteration), and using a computer program or calculator to solve for the unknown variables.

What is the difference between solving a system of equations numerically and analytically?

Solving a system of equations numerically involves using numerical methods and algorithms to find approximate solutions, while solving analytically involves using algebraic techniques to find exact solutions.

Can any system of equations be solved numerically?

Yes, any system of equations can be solved numerically as long as it can be represented in matrix form and an appropriate numerical method is selected.

What are the advantages of solving a system of equations numerically?

Solving a system of equations numerically can be faster and more accurate than solving analytically. It also allows for the solution of complex systems that may be difficult to solve algebraically.

Are there any limitations to solving a system of equations numerically?

Yes, there are limitations to solving a system of equations numerically. The accuracy of the solution depends on the numerical method used and the precision of the computer or calculator. It also may not be able to find all solutions or identify multiple solutions.

Similar threads

Replies
3
Views
2K
Replies
1
Views
811
Replies
7
Views
2K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
19
Views
1K
Replies
2
Views
462
Replies
4
Views
1K
Replies
6
Views
6K
Back
Top