Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Mathematica: How can I plot a graph of values returned by FindRoot[]?
Replies: 2   Last Post: Aug 9, 2011 8:23 AM

 Messages: [ Previous | Next ]
 David Kirkby Posts: 67 Registered: 10/1/09
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

Date Subject Author
8/9/11 David Kirkby
8/9/11 Peter Pein
8/9/11 Nasser Abbasi