# Centered Difference Matrix

1. Jun 16, 2015

### Septimra

A difference matrix takes the entries of a vector and computes the differences between the entries like
[x1 - 0 ] = difference from 0 and x1: 1 step
[x2 - x1] = difference from x2 and x1: 1 step
[x3 - x2] = difference from x3 and x2: 1 step

assuming we had a vector x in Ax = b

So why now when it becomes centered, does it become
[x2 - 0 ] = difference from x2 and 0: 1 step
[x3 - x1] = difference from x3 and x1: 1 step
[0 - x3] = difference from 0 and x3: -3 steps!!!!!!!!!!

Last edited by a moderator: Jun 17, 2015
2. Jun 17, 2015

### RUber

What is the application for this? It is tough to tell what the benefit would be without seeing how it is used.

3. Jun 17, 2015

### Septimra

its not for a particular application, just for better understanding of centered difference matrices

4. Jun 17, 2015

### RUber

I think you might have the wrong definition for the centered difference matrix.
See the exercises in this source: http://math.mit.edu/~gs/linearalgebra/ila0103.pdf
They should be even steps. For a 3D space, you might get something like:
$\pmatrix{x2\\x3-x1\\-x2}$
In a 4D space, you might get something like:
$\pmatrix{x2\\x3-x1\\x4-x2\\-x3}$
These originate from matrices that look like:
$\pmatrix{0 &1& 0\\-1 &0 &1 \\ 0&-1& 0 }$ or $\pmatrix{0 &1 &0 &0\\-1 &0 &1& 0 \\ 0 &-1& 0 & 1 \\ 0 &0 &-1& 0 }$

5. Jun 17, 2015

### Septimra

A centered difference matrix is the difference between the preceding and following entries in x. I hope that's correct.
So it follows that your 3D centered difference matrix,

x1 is the difference between x2 - 0
x2 is the difference between x3 - x1

However
x3 is NOT the difference between 0 - x3

Is it because there is no x4 value in which to center x3 around i.e. x4 - x2?

When its not centered via the link you prescribed, it's easy to understand.

6. Jun 17, 2015

### RUber

That's how I understand it. Zero does not refer to any value, it simply is a placeholder to show that there is no x value in that place.