You are on page 1of 1

Assignment 4

• Use the explicit finite difference method (see lecture notes) to


simulate the heat equation on the right with your choice of
appropriate initial and boundary conditions. Make a physically 𝜕𝑢 𝜕2 𝑢
realistic choice of the length of the bar and the thermal =𝛾 ∙
𝜕𝑡 𝜕𝑥
2
diffusivity constant . Explain the physical meaning of each of
the above choices.
• Allow the user to input the step sizes and . Warn if the choice
of and is expected to violate the stability criterion . Investigate
how varying the step sizes affects the solution.
• Plot how the temperature distribution in the bar varies with
and with . Using either 2D or 3D plots, show the evolution in
time.
• Write a report on the above, explaining your code + sharing the
unit tests that validate your code, and discussing the results.
1

You might also like