In[1]:= data = Table[x, {x, 1, 25, 1}];
data2 = Table[x^.5, {x, 1, 25, 1}];
a1 = Interpolation[Transpose[{data, data2}]];
r = z /. FindRoot[a1[z] - (5 - z^.5), {z, 1}];
{r, a1[r], 5 - r^.5}
Out[5]= {6.24994, 2.50001, 2.50001}
Using NSolve with Interpolation
-
01-07-2022 - |
Pregunta
I'm very new to Mathematica, so sorry if this has an obvious answer, but:
I'm trying to use NSolve to find the point of intersection between two functions, one of which was made using Interpolation, but it won't give me a solution.
Here is the input:
data = Table[x, {x, 1, 25, 1}];
data2 = Table[x^.5, {x, 1, 25, 1}];
a1 = Interpolation[Transpose[{data, data2}]];
NSolve[a1[z] == 5 - z^.5, z]
And the output:
NSolve[InterpolatingFunction[][z] == 5 - z^0.5, z, Reals]
Thanks for the help!
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow