|
Further Examples: FindRoot
These two curves intersect at one point.
In[1]:= 

This finds a numerical approximation to the x coordinate of the intersection point. The is the initial guess.
In[2]:= 
Out[2]= 
Trigonometric equations typically have an infinite number of roots. If you start sufficiently close to a particular root of an equation, FindRoot will find that root.
In[3]:= 
Out[3]= 
Starting closer to another root will give a different solution.
In[4]:= 
Out[4]= 
You can restrict FindRoot to a region in which to look for solutions. Here the initial guess is and the solution is supposed to be between and . There is no such solution.
In[5]:= 

Out[5]= 
This is what happens when FindRoot can find no solutions at all.
In[6]:= 

Out[6]= 
If you want FindRoot to use complex values in its search, then you need to give a complex starting value.
In[7]:= 
Out[7]= 
This finds a solution to a set of simultaneous equations. It is a good idea to avoid taking the starting values for x and y to be equal or to take any other "special" combinations of values.
In[8]:= 
Out[8]= 
The criterion FindRoot uses for convergence to a root is how close the function is to zero. If the function is very flat it may be close to zero before the variable is close enough to the root. Here the root is only good to a few decimal places.
In[9]:= 

Out[9]= 
Increasing the value of MaxIterations improves the accuracy of the root.
In[10]:= 
Out[10]= 
To get closer to the actual value of the root, increase the setting of the AccuracyGoal option. It is often also necessary to increase the setting of the WorkingPrecision option.
In[11]:= 
Out[11]= 
|