This programme simulates heat diffusion in a single dimensional rod with Dirilecht boundary conditions using the finite differences method. The heat equation in one dimension is given by:
where
where
To ensure stability, the following condition must be satisfied:
Initial conditions are set in the main.py
file as an array of values. To set constant/boundary conditions make sure to hardcode the values in the initial condition array and then set the necessary constant points:
diffuser = HeatDiffuser(
initialConditions=initialConditions,
constantPoints=[0,99],
length=50,
heatConstant=1,
timeResolution=0.01
)