Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'ND / FindRoot error' topicStudent Support Forum > General > "ND / FindRoot error"

Next Comment >Help | Reply To Topic
Author Comment/Response
Kevin
03/23/09 11:37am

I am trying to use ND to find the numerical derivative of some function which involves using FindRoot. My starting point for FindRoot depends on the variable that I am taking the ND with respect to. But I get errors from FindRoot/ND when I try it.

For example, try

f[startPos_] := x /. FindRoot[Sin[x] == 0, {x, startPos}];
Needs["NumericalCalculus`"];
ND[f[startPos], startPos, 30]

FindRoot outputs errors that startPos is not a number. Why doesn't ND work in this case? I can plot f[startPos], so why can't I take it's numerical derivative?

URL: ,

Subject (listing for 'ND / FindRoot error')
Author Date Posted
ND / FindRoot error Kevin 03/23/09 11:37am
Re: ND / FindRoot error yehuda ben-s... 03/29/09 03:39am
Next Comment >Help | Reply To Topic