Welcome to the first part of WatCompPhys' Fundamental Equations series! Here, we will introduce you to, and give you hands on experience in dealing with some of the most fundamental equations. This chapter is all about modelling the flow of heat.
Most of you will already have a good sense of how heat works from your daily lives. For example, if you put a pot of boiling water out in the snow, then intuitively we know that the snow will melt and the pot will get cold over time. Moreover, we also know that snow close to the pot will get hotter but snow further away will barely experience any temperature change. But how do we model this?
Lets reduce our whole system to 5 particles - four cold particles representing the snow and one hot particle representing the pot. If we plot the temperature of each particle (lets say blue represents cold ice and red represents the hot pot), we get the following graph
Since the height of these dots represent temperature, we expect the dots do move as time progresses (since heat will flow and temperature will change over time). We let the outermost snow particles "contain" (heuristically) all the snow that is further than a distance of 2 away from the pot. Naturally, all the snow particles far away won't experience any noticible temperature change (a "thermal reservoir" for any of you interested). Therefore, the two blue dots at the boundaries will not move over time. This fixing of the "boundary value" is what we call "Dirichlet Boundary Conditions".
Now lets think about how the rest of the system behaves. Obviously, the red dot (representing pot temperature) will move down, since it is surrounded by cold stuff. The two blue dots next to the red dot will move up, but they will do so more slowly. Why? Simply because while the pot is surrounded by cold snow (cooled on both sides, heated by nothing), the snow particles are touching both the pot and the snow, which means that it is heated up by the pot and cooled by the neighbouring snow at the same time!
So what we learnt is that heat flow depends on the temperature of what an object is surrounded by. If the temperature of an object is different from its surroundings, then it will change to match its surroundings. We can now put this into the language of math. First, we assign the temperature of every particle a name, say
Where i can be any integer that tells us the position of the particle. For example, if I say u3, then I'm referring to the temperature of the pot, since it is the third particle counting from the left. The integer i is known as an "index". To compute the difference between the temperature of a particle at position i to its neighbours (particles at positions i+1 and i-1), we can simply subtract the temperatures
Recall how the evolution of temperature depends on the temperature of a particle's neighbours. If the particle has a large temperature difference with some other particle far away (ie. not really "neighbours"), then there won't be a lot of temperature change. Conversely, if there is a temperature difference between the particle and a nearby particle (ie. its neighbour), then there will be a noticeable temperature change. Therefore, we also need to account for the spacing between the particles. If each particle is spaced 𝚫x apart, then we divide the above expression by 𝚫x to account for this. That way, when 𝚫x is small, the expression becomes large, which means the "temperature changing effect" is also large, and vice versa.
These are known as "first forward finite differences". Now the final piece (well, final piece of the first part) of the puzzle is to figure out the "net effect" of the neighbours. To do so, we simply subtract the two expressions.
Here's the tricky question: Why subtract? It is simply because the way we defined our differences. Notice that it always subtracts the temperature of the particle to the left from the particle to the right. This means that for our situation, the difference in temperature between the pot and the ice to its left will be positive (since the ice is to its left, so we subtract it from that of the pot) and the temperature difference between the pot and the temperature of the ice to its right will be negative (since the pot is now to the right, so we subtract the pot temperature from the ice temperature). Take a moment to digest this information. It is perhaps the most difficult sentence of this entire article.
So if we instead added the two differences (in our case, the ice to the left and to the right of the pot has the same temperature), then we would obtain a "net effect" of zero! Which is not what we want. So lets subtract the two differences. Again, we will follow the convention of subtracting left from right. Also, a general rule of thumb is that when you take a difference, you must divide by the spacing between the particles. This is so that there is always a sense of scale inside your system. Subtracting and dividing by the spacing, we get
This is known as the "Second Finite Central Difference". Notice that for a continuous object like a a field of snow or a long metal rod, there are many particles (trillions of trillions of atoms!) and the spacing is very small. This means 𝚫x becomes tiny and reduces to zero. In these cases, we give the second difference another name, called the "second partial derivative", and give it a separate symbol ∂. Now we can rewrite the above in terms of this "new name".
Don't worry too much about why the second derivative is written like that. It's mostly just convention. Now let us relate it to how the temperature changes. If the temperature at a certain location is very different from its neighbours (ex. hot pot surrounded by cold snow), then the temperatures will change rapidly. Otherwise, if the temperatures are roughly the same, then there won't be any changes at all. We can represent how fast the temperature is changing in terms of a "speed".
Remember how speed (From middle school you probably remember v=𝚫s/𝚫t) is defined as the distance travelled over a fixed amount of time? We now define the "temperature speed" as the change in temperature over a fixed amount of time. Mathematically, this is 𝚫u/𝚫t. If we want to find out the change in temperature in a very small (almost zero) amount of time, we can repeat the above process (where we did a similar process of reducing ), turning 𝚫 into ∂ to obtain the following.
Now we can put it all together. From the physical reasoning above, I claim that the difference in temperature of a point compared to its neighbours directly influences how fast the temperature changes. This means that the change of temperature in time is proportional to the second difference of temperature in space. Mathematically, this reads
Or equivalently, if we introduce a real constant k (called the "thermal diffusivity") to act as our constant of proportionality, we can say that
Which is the heat equation stated in full. It simply states that the change in temperature throughout time is proportional to the difference between the temperature at any point and both its neighbours. From this perspective, it is easy to see that any "bumps" in temperature will be smoothed out over time. This is because where there is a bump, the local second derivative will be large, resulting in the time derivative term also being large, which causes the temperature to change fast to "equalise" the temperature to that of its neighbours.
Written by Lachlan on Dec 1st, 2025