Consider the following problem for the heat equation with a time-dependent source term, and mixed boundary conditions:
Briefly describe how you would use the method of finite differences to find an approximate solution to this problem. Use the notation to denote the values of on the finite difference mesh, and include how you propose to incorporate the boundary and initial conditions. In case it is useful, the Taylor expansion formula is
Make sure you understand the problem fully: What is the question asking you to do? Are there specific conditions or constraints that you should take note of? How will you know if your answer is correct from your work only? Can you rephrase the question in your own words in a way that makes sense to you?
If you are stuck, check the hint below. Consider it for a while. Does it give you a new idea on how to approach the problem? If so, try it!
Hint
For small, Taylor expansion of with respect to time variable about (x,t) gives
This reminds us of the forward difference approximation for the time derivative:
which has error of , i.e. first order accurate.
Similarly, for small, Taylor expansion of with respect to the space variable about (x,t) gives
and
This reminds us of the centered difference approximation for the second space derivative:
which has an error of , i.e. second order accurate.
Putting these back to the equation gives
With uniform time step and mesh spacing , let , where ; and , where ; and .
Plug these mesh points onto the above gives a linear system with variables . (Note that some of these values are not unknown, but can be calculated directly using the boundary conditions.)
Work out an equation for a fixed n and k, showing in terms of values from the previous time step, i.e. .
Then consider what should be when and when
Be reminded that the left Neumann condition
is tricky in that you need again to use the centered difference formula for first derivative to incorporate that. You might want to add a "fictional" point to do that.
Checking a solution serves two purposes: helping you if, after having used the hint, you still are stuck on the problem; or if you have solved the problem and would like to check your work.
If you are stuck on a problem: Read the solution slowly and as soon as you feel you could finish the problem on your own, hide it and work on the problem. Come back later to the solution if you are stuck or if you want to check your work.
If you want to check your work: Don't only focus on the answer, problems are mostly marked for the work you do, make sure you understand all the steps that were required to complete the problem and see if you made mistakes or forgot some aspects. Your goal is to check that your mental process was correct, not only the result.
Solution
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
{{#incat:MER CT flag||
Click here for similar questions
MER CT flag, MER QGH flag, MER QGQ flag, MER QGS flag, Pages using DynamicPageList3 parser function, Pages using DynamicPageList3 parser tag