 All right, what we're going to do in this segment, we're going to derive the heat diffusion equation and if you recall from the last segment, what we did is we came up with an equation that enabled us to calculate the heat flux within an object, but we said that in order to be able to evaluate the heat flux, we needed to know the temperature distribution inside of the object and so that's where the heat diffusion equation comes in. It's an equation, it's a partial differential equation, we'll derive that, that enables us to determine the temperature within an object and sometimes people will shorten it and they'll call it the heat equation or the heat diffusion equation. So this is going to be kind of a long segment because we've got to go through derivation and come up with this equation, but it's the best way to keep it continuous and so that's why it's going to be a little bit longer. Let me begin with an overview of where we're going with this. Okay, so there we go. Now when we're looking at this, one of the main things that we're after, we want to know the temperature distribution within an object and notice that I've put the temperature distribution as a function of the three spatial dimensions and time. We will be looking later in the course at transient analysis and that's where you have temperature within the object changing with time as well as the spatial location and so we'll derive the heat diffusion equation in the most general sense. But in order to be able to calculate the temperature within an object, we need to know a number of different things and one of the things is going to be the surface conditions on that object and so we need to know either the temperatures and or heat transfer rates. So those are the boundary conditions on the surface and so that's another piece of information that we need to know along with the heat diffusion equation. So what we're going to do now, we're going to begin with the derivation of the heat diffusion equation and we'll start by looking at a little infinitesimal chunk of the object and then we're going to apply conservation of energy to that and then we'll derive the equation from there. So let's begin with our little chunk of object. Okay, so here we have an object and remember our goal, we want to be able to come up with an equation that enables us to determine the temperature within that object as a function of time and space. And speaking of space, this is our coordinate system that we will be using. Okay, so now what we're going to do, we're going to zoom in on a little cube within this object and we're going to expand it and within that cube I'm going to show the heat flux and energy generation and storage going on within that. So let me sketch that out now. Okay, so there we have our little cube and what I've shown is heat flux coming into and leaving all of the surfaces in our little cube. I've also shown on the inside we can have storage. So energy storage is shown there and we can also have energy generation and so this object could be storing and generating energy and we'll talk about how you can generate energy as we go on. But to write that out, the storage, so our storage is going to be, it's essentially MC delta T per unit time. And so you'll notice DX, DY, DZ, that is the differential volume of our little differential element here, multiply that by the density, that gives us mass and then we're taking mass times the specific heat capacity times the change in temperature with respect to time. And notice that I'm using the partial derivative of temperature. That's because temperature is a function of space as well as time. And then for energy generation, we're going to define Q dot, Q dot is going to be the rate of energy generation within our solid. And then that's going to be watts per meter cubed and then we need to multiply that by volume DX, DY, DZ. So what we're now going to do, we're going to take all of this and we're going to apply the conservation of energy equation, the first law of thermodynamics to this system. And that's going to give us an equation that we're then going to work with. Okay, so with the first law, what we can say is the energy flowing in plus the energy being generated minus energy leaving is equal to energy storage. And so what we're going to do, we're going to look at all of the mechanisms by which energy is coming in. Looking back here, where is energy coming in? Well, it's going to be coming from all of the surfaces where we have flow coming in, so or heat flux coming in, I should say. And then the last one is down there. So that's energy and energy out. That is going to be there. Energy is leaving there. Energy is leaving and their energy is leaving. And then we have the storage and the generation terms on the inside of the object. So let's expand this by subbing in the values. Okay, so we get this equation. I'm going to call this equation number one. And we will come back to this equation shortly. But that is going to be the basis for deriving the heat diffusion equation. Before we move on, though, what I want to do, we're going to use Taylor series expansion in order to work with this equation and to simplify some of the terms. So let's do a little bit of a math aside. I'm sure all of you have taken numerical methods courses or math courses. And you've probably seen Taylor series expansions. They're used quite often whenever we're dealing with equations like this. So let me just write out a little bit of a math aside. Okay, so in the Taylor series expansion, what we have, it's written in terms of some arbitrary function. And we're saying that we're evaluating this function at some point, a small distance away from where we know the functional values. So we know the function at location x. But what we want to do is we want to try to find it at x plus dx. So here we know the function. And here we don't know the functions. That's essentially what a Taylor series expansion is doing. And this is in terms of one dimension expansion, so in one direction. And then what we're saying is that we take the function plus the slope. So the slope of this function, multiplying it by dx, which is the distance between these two points. So if we know the slope of the function, and so let's say that is the change. So that is df by dx. And if we multiply it by this distance here, delta x, that enables us then to determine the value of the function at the next point. So that's just a linear extrapolation, essentially. And then higher up here, what we have here, we call these higher order terms. And we're going to neglect those in the analysis that we're doing here. But if you wanted to do a more precise analysis, you would carry those. So looking at the Taylor series expansion. So if we have f being a function of x, y, z, which in this case we do because we're dealing with a three-dimensional system. But in that case, what you would do is you would just expand about one direction at a time. But then your slope is going to be the partial derivative because you're just interested in the slope in that one direction. And then we would have the higher order terms up there. So what we're going to do, we're going to take this and we're going to return back to our heat flux. And we'll consider the heat flux in the x direction to begin with. So we're going to look at qx plus dx. We're going to hold y and z constant. We're going to neglect the higher order terms. And so with that, we get this equation. And then I can do the same for the y and the z direction. And I'm going to call these equation two. So we have equation one, which was the energy balance. We have equation two, which is basically using Taylor series expansion. And we can take these. We can take equation one and we can take equation two. And the other thing we're going to do, we're going to recall our Fourier's law in three-dimension. So in the earlier segment, we said that we could write the heat flux vector in terms of the gradient of the temperature. So we're going to sub that into equations one and two. So let's work through that. So first of all, looking at the qx minus qx plus dx, which appears in equation one. And I'm going to use our Taylor series expansion for that. So we have qx. And then writing out how we evaluated using the Taylor series expansion. And we have plus partial, partial by partial x. And in our Taylor series expansion, we have qx there. So the heat flux in the x direction. What I'm going to do, I'm going to make a substitution here from Fourier's law for that term. So let's plug that in and we get that term. Now what I can do, I'm going to rearrange this a little. First of all, what we notice is qx and qx is going to cancel out. What I'm also going to do, I'm going to pull the area out. And the area in terms of the x direction is going to be the dimensions, the two other dimensions. So the area as far as x direction is concerned is going to be dy dz. So there is the area, the minus sign disappears because it's a minus minus. And then we're left with dx. And looking at this, what I can do, I can do that for each of the three directions. So do it for the y and the z direction as well. And then sub that into equation one. So the energy equation. And when we do that, and I rearrange a couple of terms a little bit, we get the following. Okay, so that is our equation. We're getting places with this now. And first of all, we notice dx dy dz is on both sides. And so that is going to cancel out. Oops, I got a little error there. I'm sorry. That should not be dx. That should be dt. Because we're looking at the energy storage term. And so that's representing the energy that could be increasing or decreasing in our little differential element. So this equation now becomes the basis for our heat diffusion equation, I should say. And there are a couple of other simplifications that we sometimes make. And first of all, if the thermal conductivity is a constant in the object, we'll notice that it's there, there, and there. If thermal conductivity is a constant, we can pull it out of the partial derivative operator for each of those terms. So let's do that. So that is if thermal conductivity does not vary around the object. If it's a constant, we can pull that out. And then I'm going to divide by the other terms. But what we end up with is the following. And these terms I'm dividing by the thermal conductivity because we pulled it out of the first three terms. And then the energy storage is this term. OK, so this is becoming our heat diffusion equation. And let's look at each of these term by term. And so what we have here could be a representation. Essentially, it's conduction or diffusion. And this mathematically can sometimes be represented as being del dot grad of t. And mathematically, that is also written as del squared t. That is a Laplacian operator. And so that is the first three terms that we've clustered together. The next thing we have here is our q dot term. And if you recall back, that was the generation term. So that is generation of energy. And where are we going to generate energy in a solid? Well, there are different ways you can do this. You might have nuclear decay. And that is then generating energy. You could have chemical reactions. And if it is exothermic, it'll be generating energy. Endothermic, it'll be absorbing energy. But no matter what, you're going to have a change. Electrical resistance, we have the heating effect within electrical resistors. And that can also generate energy. And so there are other forms that you can generate energy. So those are examples of energy generation. And then finally, on the right-hand side, this is our storage term, so energy storage. So that is the heat diffusion equation in its most non-simplified form, so in its most general form. Now, what we often do is we simplify this a bit, so I'm going to look at a number of different ways of simplifying the heat diffusion equation. And first of all, let's assume that we have steady state. So if we have steady state, what that implies is any term that is a derivative with respect to time is going to be zero. So looking back at the heat diffusion equation, the only place where we have a derivative with respect to time is our storage term over on the right-hand side. So that term would disappear. So that would be if we have steady state, another simplification we could have is if we had a transient, so the time derivative remains, but no heat generation. And so that would be Q dot equals zero. And another simplification that we can have is we can have steady state and no heat generation. And that would imply the derivative with respect to time is zero and Q dot is equal to zero. And with that, then we are just left with the Laplace in, and that would be equal to zero. So that is the heat diffusion equation. Now, as with any kind of equation, differential equation, be it ordinary or partial differential equation, we need boundary conditions in order to solve this. So we need boundary conditions to solve for temperature X, Y, Z, or T. So boundary conditions are what are required. We take this equation, the mathematical physics equation, couple of the boundary conditions, and then we can determine what's going on in the inside. And how you do that, that's another matter. It could either be numerically or you do it analytically for very, very simple types of problems. But anyways, what we'll do in the next segment, we're gonna take a look at the boundary conditions that apply to the heat diffusion equation, but that is the heat diffusion equation. And you can use this to determine the temperature distribution within an object undergoing conduction.