Found a typo? Is this solution unclear? Let us know here. Please rate my easiness! It's quick and helps everyone guide their studies.
By the Taylor series expansion,
If we isolate in the above, we get that
Similarly, by Taylor series expansion, we have
and
If we add the two equations above together, we get that
If we isolate in the above, we get that
From these, we see that we can approximate by
and by
Hence, we can approximate the equation
by
If we isolate in the above, we get that
Next we will put mesh points in the interval . Let
where
Here, and . Similarly, we will let the mesh points in be
for some small time step .
At and , equation (1) becomes
To get the above, we used
- .
Using the notation , we can write the above as
If we look at the above equation, we see that for each fixed , it gives us a scheme to compute once is known for .
For the initial condition , we set
For the boundary condition , we set
Now, for the boundary condition , there is more than one way to handle that. One possible way is to set
which implies
If we allow an extra mesh point to the left of , the above gives
Hence, for , equation (2) can be rewritten as
Referring to the diagram above, to find an approximate solution to this problem, we first set the initial conditions
and the boundary condition
Then, we compute from by
and
Once we have , we can iterate the process to find
|