How to write $ u(x,t) $ in Forward Time Central Space scheme?

153 Views Asked by At

If I want to apply the FTCS scheme to the following equation:

$$ \frac{\partial u(x, t)}{\partial t} = f(x)u(x, t) +A\frac{\partial u(x, t)}{\partial x}+B\frac{\partial^{2}u(x, t)}{\partial x^{2}} $$

The first term in the right hand side is approximated (written as) by:

$$ a) \qquad f(x) u(x, t) = f(i, j)u(i, j)\ $$

Or,

$$ b) \qquad f(x)u(x, t) = \left(\frac{f(j-1)+f(j+1)}{2}\right)\kern-9mu \left(\frac{u(i, j-1)+u(i, j+1)}{2}\right) $$

What is the reason for choosing either or?

Thank you so much!