Differentiation in IDL [message #50650] |
Mon, 16 October 2006 06:49 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
OK, I'm missing something crucial here.
Suppose I have a sine function:
x = Findgen(360)
data = Sin(x * !dtor)
Plot, data
I know that d/dx(sin(x)) = cos(x). So, I would expect
a cosine looking curve if I differentiate the data above.
dx = DERIV(data)
OPlot, dx, Linestyle=2
The differentiated curve is almost a straight line! One
could argue that it might have the correct cosine *shape*
(squint your eyes a little bit), but the scale is vastly
different. How come?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|