# Numerical approximation: Forward diffrerence method

1. Dec 21, 2009

### oddiseas

1. The problem statement, all variables and given/known data

[t]=-U+k[xx] u(x,0)=U(L,0)=0 u(x,0)sin(pix/L)

Write down difference equations for the approximate solution of this problem using the following methods:

1)forward difference
2)backward difference
3)crank nicholson

2. Relevant equations

I can do part 3, but i am stuck on the first two methods. I can find an exppression for the partial derivative of t, but the second derivative using the forward difference from a taylor approximation is 0 isnt it?

F(x+dx,t)=f(x,t)+[f][x](x,t)dx+[f][xx](x,t)(dx)^2

which if u solve for f''=0

3. The attempt at a solution

2. Dec 21, 2009

### Päällikkö

I'm not sure about the Taylor expansion (well, I do think that the relevant equations could be derived that way too, but that's not the usual method, I think).

I'd define the forward difference operator,
$$\partial U_i = \frac{U_{i+1}-U_i}{h}$$
and use it successively. Similarly for the backward difference. Does this help?

3. Dec 21, 2009

### oddiseas

This is the definition for the first partial derivative with respect to x , using the forward difference method.I am trying to figure out if it is possible to find an expression for the second derivative with respect to x using the forward difference method. Because when i try i get zero. Usually for a heat equation i use forward difference in time and central difference for spatial, but this question specifically asks for a forward difference representation for the entire problem, so if anyone can help, because i am stuck.

4. Dec 21, 2009

### Päällikkö

Yeah, I know, that's why I mentioned using the operator I defined in my post several times in a row (i.e. what is $\partial\partial U_i$). The result you get that way deviates from central differences only by a small amount.