 In this lecture we're going to work through the process of applying the finite difference technique to the heat diffusion equation. So we begin with the heat equation and we are going to come up with a finite difference technique for two-dimensional conduction. We will assume it to be a steady-state problem and we will also assume to be the case where we have generation, so internal generation within our two-dimensional solid. So beginning what we'll do is we'll write out the mathematical physics equation. In this case it is the heat diffusion equation and so the next step that we can do we can cancel out the terms that are not appropriate for what we're looking at. First of all we're looking at 2D conduction and consequently the term with respect to Z drops away. The other thing is we're looking at steady state problem and consequently the time derivative term drops away. So that is the equation that we want to apply the finite difference technique to. And if you recall from last lecture we said that it was multi-step process. The first step is that of grid generation. So what we're going to do we're going to go through the steps and come up with our grid. So what we'll begin by doing is dividing our region and our region is going to go from 0 to L in the x direction and 0 to capital lambda in the y direction. And we're going to divide those into m and n subregions. And from that we can determine our grid spacing delta x delta y as shown there. And with that we are going to have m plus 1 by n plus 1 nodes. So what I'll do next is I am going to generate the grid. So applying the grid to the x-axis we have nodes going from 0 comma 0 up to capital M comma 0. And I will do the same for the y-axis. So here we have a simplified version of what our grid might look like. And what I've drawn in are nodes and I've tried to label those nodes. And what we're going to do we're going to focus in on five nodes in the middle of our object. And specifically what we're interested in is the temperature at node tm comma n. And that is at some point within our object. And what we're going to be doing is we're going to be writing out the finite difference form of the heat diffusion equation with the purpose of isolating and determining what tm comma n is. And just like we said before along the perimeter we apply our boundary conditions which we will be getting to in the next segment. And so the boundary conditions would be what is in these nodal locations around the perimeter. But we set up a grid on the inside and that is what we then work towards solving when we do the finite difference method to the mathematical physics equation. So let's move on now to the second step of applying finite difference to the heat diffusion equation. And that is of rewriting the mathematical physics equation in finite difference form. And if we look back at the heat diffusion equation which is here we can see that we have the derivative, second derivatives with respect to the spatial dimension of the temperature. And we need a way to be able to handle those. And so what we're interested in is how to express the second derivatives of temperature in finite difference form. And so that's what we're going to look at now. And the way that we commonly do this in numerical methods when we apply finite difference technique is we use Taylor series expansions. And we do the Taylor series expansions with respect to our grid, or grid size, delta x or delta y. So what we're going to do we're going to consider the second derivative of the temperature with respect to x. And we are going to use Taylor series expansion in order to determine what this is. And we are going to do one expansion at x plus delta x and the other at x minus delta x. So let's take a look at what we get by doing that. So there I've written out the Taylor series expansion at x plus delta x and we can see that I've written it out to order delta x squared. And I've left order delta x cubed in higher terms in this last term here. And I'm going to do the same thing now but I'm going to do that at x minus delta x. So you can see the minus delta x term is there. Then when we get to the plus this is going to be squared. So it'll be a plus delta x squared over 2. And then again we have plus order delta x cubed and smaller. And for those terms we're going to neglect. Now what I'm going to do is I'm going to add these two. And when we do that what happens is this goes to order delta x fourth because I didn't show it here but maybe I should have that the delta x cubed term here would have been a negative. But then you would have delta x to the fourth would be a positive. But the delta x cubed terms will cancel out in doing this operation. And that's why we can then write that this is of order delta x to the fourth. The other thing to note here is this term right here is the second derivative of our function which is what we're interested in for getting the second derivative of temperature. So let's isolate that term. And so that's what we result with when we isolate. And then I say plus HOT. Those are higher order terms in this particular expansion. Those will be on the order of delta x to the fourth and and higher. So those would be the higher order terms. So what can we do with this? Well remember we're after the second derivative of temperature with respect to x. So what we can write. So what I've done here is I've replaced f. The first one we had was f at x minus delta x. But you can flip it around. This here would be f at x plus delta x minus 2f at x plus f at x minus delta x. That's essentially oops I have a little error. No that one should be minus. I apologize about that. Let me fix that and clean it up. So this here should be minus in order to be consistent with that minus there. But you'll notice what I've done is I've held n constant. The subscript n which denotes one of the grid locations. I've held it constant in all of these terms which is the equivalent of holding y constant. And consequently what we're doing is reevaluating the second derivative of temperature with respect to only changing in x. And that is what this equation here is giving us. And so that is essentially a finite difference representation of the second derivative. We can do that for d, the second derivative with respect to y as well. And when we sub that back into the heat equation and we do that with delta x equals delta y. So that's what they would call uniform grid spacing if delta x was equal to delta y. And you go through some rearranging. I'm not going to go through all of that. But when you do this you end up with the following equation. So that's the equation that we end up with. And q dot in this equation is the generation rate. And we can also say that this equation applies for subscript m going from 1 to m minus 1 and n from 1 to n minus 1. So those are basically the interior nodes. We're not looking at the boundaries because those will be treated with the boundary condition. But this here is the finite difference equation. It's the heat diffusion equation, I should say, that has been transformed into finite difference form. And if you recall, what we said is that this is the term that we're after in this equation. And so what we would do is we would go and we would apply this to all of the interior nodes and you're going to get a series of algebraic equations that you then need to solve. And the solution of that comes down to different techniques. Before we can solve it, however, we have to apply the boundary condition. So what we're going to do in the next segment is we're going to the next two segments, actually. We're going to take a look at some of the boundary conditions applied to finite difference form. And then when you put it all together, that is when you then go about solving this. And that gives you the temperature distribution inside of the object that you're looking at. So next segments, we're going to start looking at the boundary conditions in finite difference form.