Physics 212, 2017: Lab 12
Back to the main Teaching page.
Download the script for solving the diffusion equation from the main course web site. Focus on the sequential solution there only. Understand the script. Try to modify the script to have
- Absorbing (rather than reflecting) boundary conditions.
- A heat source somewhere in the lattice, which produces a certain amount of heat per unit time always.
- Generate a movie of thee 2d temperature profile.
- If you have time, repeat the steps above with thee following modifications. First, interpret the diffusion equation as a particle (not heat) diffusion. Modify it to account for the possibility that if to particles collide, they annihilate each other (in other words, introduce a sink term proportional to the square of the particle density).