Solve a system of equations numerically

Click For Summary

Discussion Overview

The discussion revolves around solving a system of equations numerically using Mathematica. Participants explore methods to efficiently compute solutions given specific parameters.

Discussion Character

  • Technical explanation, Homework-related, Mathematical reasoning

Main Points Raised

  • One participant expresses difficulty with NSolve taking a long time to compute the solutions for a set of equations.
  • Another participant notes that the system of equations is not numerical until specific values for variables v, α, and β are provided.
  • A later reply confirms that values for v, α, and β were assigned, which may affect the numerical nature of the equations.
  • One participant suggests using FindRoot as an alternative to NSolve for solving the equations.
  • A final reply indicates that switching to FindRoot resolved the initial issue.

Areas of Agreement / Disagreement

Participants generally agree on the need for specific values to make the system numerical, and there is a consensus that FindRoot is a more effective method in this case. However, the initial challenge with NSolve remains a point of discussion.

Contextual Notes

The discussion does not resolve the underlying reasons for NSolve's performance issues, nor does it clarify the implications of the chosen numerical methods on the solutions.

Who May Find This Useful

Individuals working on numerical solutions of systems of equations in Mathematica, particularly those encountering performance issues with NSolve.

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   Reactions: member 428835
Worked like a charm: thanks!
 
  • Like
Likes   Reactions: Dale

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · 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