comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Check numerical derivatives
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Check numerical derivatives [message #94527] Tue, 27 June 2017 03:30 Go to previous message
geo85c is currently offline  geo85c
Messages: 4
Registered: June 2017
Junior Member
Hi there,

I wanted to calculate numerical derivatives of a function. I would like to check if the following are correct.

Consider the function F in R^2.
F is a 2D image.
I did the following:
dims = size(F, /dimensions)
nx = dims[0]
ny = dims[1]
xc = findgen(nx)
yc = findgen(ny)

Derivative with respect to x:
F_x = F[xc[1:nx-1],*]-F[xc[0:nx-2],*] ;first order deriv
F_xx = F_x[xc[1:nx-1],*]-F[xc[0:nx-2],*] ;second order deriv
F_y = F[*,yc[1:ny-1]] - F[*,yc[0:ny-2]]
F_xy = F_x[*,yc[1:ny-1]] - F_x[*,yc[0:ny-2]]

Then I wanted to differentiate F_xy with respect to x. I did the following:
F_xxy = F_xy[xind[1:nx-1],*] - F_xy[xind[0:nx-2],*]

Are the above correct?

Thanks.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Removing specific elements in an array
Next Topic: 2D histogram color plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:57:55 PDT 2025

Total time taken to generate the page: 0.00475 seconds