Discrete derivatives with finite-differences

  • Context: Graduate 
  • Thread starter Thread starter mnb96
  • Start date Start date
  • Tags Tags
    Derivatives Discrete
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
mnb96
Messages
711
Reaction score
5
Hello,
I have a function in discrete domain [tex]f:\mathbb{Z}\rightarrow \mathbb{R}[/tex], and I assume that f is an approximation of another differentiable function [tex]g:\mathbb{R}\rightarrow \mathbb{R}[/tex].
In other words [tex]f(n)=g(n)[/tex], [tex]n\in \mathbb{Z}[/tex].

When one wants to approximate the first derivative of g, it is possible to use the forward difference or backward difference operators, which are respecively:

[tex]\Delta f(n)=f(n+1)-f(n)[/tex]
[tex]\nabla f(n)=f(n)-f(n-1)[/tex]

My question is: is it common or allowed to use a mixture of these two operators in the following way:

[tex]g'(x) \approx \Delta f(x)[/tex] for [tex]x\geq 0[/tex]
[tex]g'(x) \approx \nabla f(x)[/tex] for [tex]x<0[/tex]
 
Physics news on Phys.org
No, it is not "common" and I can see no reason to do that. Why would you use one for positive x and the other for negative x? It is the change that is positive or negative in the two differences and whether x is positive or negative has nothing to do with that.
 
I would like to use different operators for positive/negative x's in order to obtain a symmetry I need. In fact, in my case the continuous function g has the property:

[tex]g'(x)=-g'(-x)[/tex], for [tex]x\in \mathbb{R}[/tex]

If f(n)=g(n), [itex]n\in \mathbb{Z}[/itex], you get [tex]\Delta f(n) \neq -\Delta f(-n)[/tex].
Instead, given g I was able to obtain:

[tex]\Delta f(n) = -\nabla f(-n)[/tex], [itex]n\in \mathbb{Z}^+ - \{ 0 \}[/itex]

EDIT: in simpler words g is an even function and its first derivative is an odd function. The discretized f is even too, but [itex]\Delta f[/itex] is not odd.
 
Last edited:
You could presumably use [itex]\frac{1}{2}(\Delta f+\nabla f)=(f(n+1)-f(n-1))/2[/itex], but that may be too much arithmetic (the shift operation is usually quite quick if you're doing it by computer).
 
Last edited:
Thanks Martin,
yours is probably a better idea. In fact, the central-difference operator keeps the property "f is even [itex]\Rightarrow[/itex] f' is odd".