|
|
Mathematica: How can I plot a graph of values returned by FindRoot[]?
Posted:
Aug 9, 2011 6:30 AM
|
|
I have defined a function Xin, which takes 3 arguments.
Xin[lambda_,lenght_, radius_]: = ....whatever (it does not matter)
I want to find the root of that when the length 'l' is about 0.49.
FindRoot[Xin[1, l, 0.00001], {l, 0.49}] {l->0.488315}
That's working fine. But I want to plot the roots for various values of radius - not just 0.00001 m as above.
This does *not* work
Plot[FindRoot[Xin[1,l,r],{l,0.48}],{r,0.0001,0.01}]
since the output of FindRoot[] is not a simple numeric number like 0.488315, but rather of the form "{l->0.488315}".
How can I convert something like "{l->0.488315}" to give just the numeric part, so I can plot a graph using Plot[]?
Although I know there will be an infinite number of roots of my equation, there will only be one close to 0.48. The next will be around 1.02. FindRoot[] seems to be able to find the single root OK, its just I don't know how to plot the point.
dave
Dave
|
|