Discrete derivatives with finite-differences

Click For Summary
The discussion revolves around the use of finite-difference operators to approximate derivatives of a discrete function that approximates a differentiable function. The original poster questions the validity of using different operators for positive and negative values of x, specifically the forward difference for x ≥ 0 and the backward difference for x < 0. Responses indicate that this practice is uncommon and unnecessary, as the sign of x does not affect the nature of the differences. The conversation highlights the importance of symmetry in the derivatives, noting that while the discrete function can be even, the forward difference does not yield an odd function as desired. A central-difference operator is suggested as a better alternative to maintain the odd property of the derivative.
mnb96
Messages
711
Reaction score
5
Hello,
I have a function in discrete domain f:\mathbb{Z}\rightarrow \mathbb{R}, and I assume that f is an approximation of another differentiable function g:\mathbb{R}\rightarrow \mathbb{R}.
In other words f(n)=g(n), n\in \mathbb{Z}.

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:

\Delta f(n)=f(n+1)-f(n)
\nabla f(n)=f(n)-f(n-1)

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

g&#039;(x) \approx \Delta f(x) for x\geq 0
g&#039;(x) \approx \nabla f(x) for x&lt;0
 
Mathematics 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:

g&#039;(x)=-g&#039;(-x), for x\in \mathbb{R}

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

\Delta f(n) = -\nabla f(-n), n\in \mathbb{Z}^+ - \{ 0 \}

EDIT: in simpler words g is an even function and its first derivative is an odd function. The discretized f is even too, but \Delta f is not odd.
 
Last edited:
You could presumably use \frac{1}{2}(\Delta f+\nabla f)=(f(n+1)-f(n-1))/2, 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 \Rightarrow f' is odd".
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K