Science:Math Exam Resources/Courses/MATH257/December 2011/Question 04 (a)
• Q1 • Q2 (a) • Q2 (b) • Q3 (a) • Q3 (b) • Q4 (a) • Q4 (b) • Q5 (a) • Q5 (b) •
Question 04 (a) 

Consider the following problem for the heat equation with a timedependent source term, and mixed boundary conditions:

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.

Solution 

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
and If we add the two equations above together, we get that If we isolate in the above, we get that
and by
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 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 