Finding Roots of Interpolated Function in Mathematica

  • Mathematica
  • Thread starter LordV
  • Start date
In summary, to find the roots of an interpolated function in Mathematica, you can use the Root function or the FindRoot function. You can also plot the roots of an interpolated function using the Plot function. The accuracy of the roots found by Mathematica is generally high, but it is recommended to verify the results. Mathematica can also find complex roots using the NSolve function. For multiple roots, you can use the Reduce or Solve functions, or the FindRoot function with different starting values.
  • #1
LordV
7
0
Hello,

I have an interpolated function at mathematica

x->InterpolatingFunction blahblahblah

which looks like a sin

I want to find all the roots between {x0,x1} (in a list if possible)

Is there any way to achieve this?
I tried FindRoot and Reduce but I couldn't...
 
Physics news on Phys.org
  • #2
I used NSolve

and I got

t->InverseFunction[InterpolatingFunction...

is there any way to use this?
 
  • #3
I would use:

Union[Table[x /. FindRoot[f[x], {x, xInit}], {xInit, xMin, xMax, xStep}]]
 
  • #4
Thanks a lot
 

1. How do I find the roots of an interpolated function in Mathematica?

To find the roots of an interpolated function in Mathematica, you can use the Root function. This function takes in the interpolated function as an argument and returns a list of the roots. You can also use the FindRoot function to find a specific root within a given interval.

2. Can I plot the roots of an interpolated function in Mathematica?

Yes, you can plot the roots of an interpolated function in Mathematica by using the Plot function with the interpolated function and its roots as arguments. This will create a plot with the interpolated function and the roots marked as points on the graph.

3. How accurate are the roots found using Mathematica?

The accuracy of the roots found using Mathematica depends on the accuracy of the input data and the method used for interpolation. Generally, the roots found by Mathematica are highly accurate, but it is always recommended to verify the results with other methods or software.

4. Can I find complex roots of an interpolated function in Mathematica?

Yes, you can find complex roots of an interpolated function in Mathematica by using the NSolve function. This function can handle complex numbers and will return all the complex roots of the interpolated function.

5. How do I handle multiple roots of an interpolated function in Mathematica?

If an interpolated function has multiple roots, you can use the Reduce function to find all the roots or the Solve function to find a specific root. You can also use the FindRoot function with different starting values to find multiple roots.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
399
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
891
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
248
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Back
Top