0
$\begingroup$

I am solving 1-dim heat equation by discretizing it by replacing the time derivative by a forward difference and the space derivative by the center difference formula at the j-th time step. I get the following recursive formula.

              w_{i,j+1}=0.5(w_{i+1,j}+w_{i-1,j}), i=1,2,3,4,5,  j=1,2,3,4,5

The i.cd is u(x,0)=x^{4}, and b.cd are u(0,t)=0 and u(1,t)=1. The domain is: 0

The problem: The B.pts bounds the domain from 3 sides but it is open from one side. So the points (0.2,0.2), (0.4,0.2), (0.6,0.2), ... are interior points. right? When I take, for instance i=1, j=5, then I get w_{1,6} in the recursive formula. This point is out of the mesh. Are there any suggestion to handle this situation? I shall be grateful for your help!

Shah

$\endgroup$

1 Answer 1

0
$\begingroup$

I'm not sure what's confusing you. When you plug in $i=1,j=5$, because of how you wrote the formula, you are using the iteration to find the value of $w_{1,6}$, which is simply not a value of interest since it isn't in the mesh. The only thing I can think that might be confusing you is that your BC numerically says that $w_{0,j}=0$ for all $j$ and $w_{6,j}=1$ for all $j$. So for example $w_{5,j+1}=0.5(1+w_{4,j})$.

It might be clearer to write the formula in the form

$$w_{i,j} = \frac{w_{i+1,j-1} + w_{i-1,j-1}}{2}$$

instead. Does that clear the issue up?

(As an aside, you are likely to have stability problems with that time stepping scheme. Backward Euler, explicit 4th order Runge Kutta, and implicit 4th order Runge Kutta are all much better choices for these kinds of problems.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .