1 00:00:02,090 --> 00:00:05,170 GILBERT STRANG: This is heat equation video. 2 00:00:05,170 --> 00:00:09,410 So this is the second of the three basic 3 00:00:09,410 --> 00:00:11,640 partial differential equations. 4 00:00:11,640 --> 00:00:16,750 We had Laplace's equation, that was-- time was not there. 5 00:00:16,750 --> 00:00:19,620 Now time comes into the heat equation. 6 00:00:19,620 --> 00:00:24,910 We have a time derivative, and two-- matching 7 00:00:24,910 --> 00:00:27,540 with two space derivatives. 8 00:00:27,540 --> 00:00:29,030 So I have my function. 9 00:00:29,030 --> 00:00:33,900 My solution depends on t and on x, 10 00:00:33,900 --> 00:00:39,290 and I hope I can separate those two parts. 11 00:00:39,290 --> 00:00:45,870 This is exactly like the way we solved the ordinary systems 12 00:00:45,870 --> 00:00:47,460 of differential equations. 13 00:00:47,460 --> 00:00:50,900 We pulled out an e to the lambda t, 14 00:00:50,900 --> 00:00:53,930 where lambda was the eigenvalue, and then we 15 00:00:53,930 --> 00:00:55,680 had the eigenvector. 16 00:00:55,680 --> 00:01:00,930 Here, it's an eigenfunction because it depends on x. 17 00:01:00,930 --> 00:01:05,540 We didn't have x before, but now we have partial differential 18 00:01:05,540 --> 00:01:06,300 equations. 19 00:01:06,300 --> 00:01:10,700 X is also a coordinate here. 20 00:01:10,700 --> 00:01:13,670 So I look for solutions like that. 21 00:01:13,670 --> 00:01:17,650 And just as always, I substitute that into the differential 22 00:01:17,650 --> 00:01:24,930 equation to discover what-- what determines S, S of x. 23 00:01:24,930 --> 00:01:28,870 The time derivative brings down a lambda. 24 00:01:28,870 --> 00:01:31,780 The space derivative brings down-- 25 00:01:31,780 --> 00:01:34,280 has two space derivatives. 26 00:01:34,280 --> 00:01:39,820 So that's what I get when I substitute e to the lambda t S 27 00:01:39,820 --> 00:01:44,450 eigenvalue, times eigenfunction, into the equation. 28 00:01:44,450 --> 00:01:47,940 And always, I cancel e to the lambda t, that's 29 00:01:47,940 --> 00:01:52,490 the beauty of it, and I have an eigenvalue equation, 30 00:01:52,490 --> 00:01:56,820 or I'm looking again for a function. 31 00:01:56,820 --> 00:01:59,850 So the second derivative of my function 32 00:01:59,850 --> 00:02:03,940 is lambda, some number, times my function. 33 00:02:03,940 --> 00:02:05,380 OK. 34 00:02:05,380 --> 00:02:09,350 What I'm looking for for functions S, 35 00:02:09,350 --> 00:02:11,330 they'll be sine functions. 36 00:02:11,330 --> 00:02:21,272 S will be, S of x, will be the sine of K pi 37 00:02:21,272 --> 00:02:26,044 x, the sine of x, the sign of something times x. 38 00:02:26,044 --> 00:02:26,960 What's the eigenvalue? 39 00:02:29,960 --> 00:02:32,980 Take two derivatives of this, I get back 40 00:02:32,980 --> 00:02:38,050 sine k pi x, which is, that's great, it's an eigenfunction. 41 00:02:38,050 --> 00:02:41,220 And out comes the eigenvalue, lambda 42 00:02:41,220 --> 00:02:44,170 is, well when I take two derivatives, 43 00:02:44,170 --> 00:02:48,010 k pi comes out twice with a minus sign. 44 00:02:48,010 --> 00:02:52,220 So it's minus k squared, pi squared. 45 00:02:52,220 --> 00:02:58,250 So I have found a bunch of eigenvectors, eigenfunctions, 46 00:02:58,250 --> 00:03:01,560 and the eigenvalues. 47 00:03:01,560 --> 00:03:09,140 So this was a simple pair, but now the general solution, 48 00:03:09,140 --> 00:03:14,890 the general solution, u of t x, will be? 49 00:03:14,890 --> 00:03:19,240 If I know several solutions, and I have a linear equation, 50 00:03:19,240 --> 00:03:20,910 I just take combinations. 51 00:03:20,910 --> 00:03:22,740 That's always our way. 52 00:03:22,740 --> 00:03:25,980 Take combinations of those basic solutions, 53 00:03:25,980 --> 00:03:31,920 so I'll have a sum, k going from 1 to infinity. 54 00:03:31,920 --> 00:03:34,680 In differential equation, partial differential equations, 55 00:03:34,680 --> 00:03:38,150 I need a big sum here, of some coefficients, 56 00:03:38,150 --> 00:03:44,190 let me call them B k, times this solution, 57 00:03:44,190 --> 00:03:49,360 e to the lambda-- what was lambda-- minus k squared, pi 58 00:03:49,360 --> 00:03:54,050 squared t, times S, S number k. 59 00:03:54,050 --> 00:04:00,650 I should have given this eigenfunction it's number, k. 60 00:04:00,650 --> 00:04:05,290 So there is the, this is my family of eigenfunctions 61 00:04:05,290 --> 00:04:07,170 and eigenvalues. 62 00:04:07,170 --> 00:04:11,180 And then, this is the combination of these solutions. 63 00:04:11,180 --> 00:04:14,110 There is the general solution. 64 00:04:14,110 --> 00:04:19,870 And for S k, I should have written in sine k pi x. 65 00:04:19,870 --> 00:04:21,750 So that's the dependence on t. 66 00:04:21,750 --> 00:04:23,480 Let's have a look at this. 67 00:04:23,480 --> 00:04:28,360 So the dependence on t is fast decay. 68 00:04:28,360 --> 00:04:34,750 And if K, as K gets larger, later terms in this sum, 69 00:04:34,750 --> 00:04:37,040 the decay is really fast. 70 00:04:37,040 --> 00:04:42,020 So the term that decays most slowly, k equal 1, 71 00:04:42,020 --> 00:04:48,070 there'll be a B1, an e to the minus, pi squared t. 72 00:04:48,070 --> 00:04:50,970 That's decaying already pretty fast. 73 00:04:50,970 --> 00:04:54,330 When I'm talking about decay, what's happening here? 74 00:04:54,330 --> 00:05:01,970 I have a bar, a material bar. 75 00:05:01,970 --> 00:05:09,260 The ends of the bar are kept at temperature zero, 76 00:05:09,260 --> 00:05:13,370 they're frozen, and heat is in the bar. 77 00:05:13,370 --> 00:05:15,520 Heat is flowing around in the bar. 78 00:05:15,520 --> 00:05:16,810 And where is it going? 79 00:05:16,810 --> 00:05:19,880 It's flowing out the ends. 80 00:05:19,880 --> 00:05:23,420 The bar is approaching freezing. 81 00:05:23,420 --> 00:05:28,950 The ends are kept at freezing, and the inside of the bar, 82 00:05:28,950 --> 00:05:31,390 whatever heat is there at the beginning, 83 00:05:31,390 --> 00:05:33,350 is going to flow out the ends. 84 00:05:33,350 --> 00:05:38,020 So, you see, that I have these sine functions. 85 00:05:38,020 --> 00:05:43,610 When x is 0 the sine is 0 so that's frozen at one end. 86 00:05:43,610 --> 00:05:49,140 When x is 1, I have the sine of k pi, which is, again, 0, 87 00:05:49,140 --> 00:05:51,310 so it's frozen at the other end. 88 00:05:51,310 --> 00:05:53,510 So I'm freezing it at both ends. 89 00:05:53,510 --> 00:06:01,800 The temperature is escaping out of the center, 90 00:06:01,800 --> 00:06:05,120 so let me graph the solution. 91 00:06:05,120 --> 00:06:09,720 So maybe I start with-- here is my bar from 0 to 1, 92 00:06:09,720 --> 00:06:11,640 and I'm keeping it frozen. 93 00:06:11,640 --> 00:06:15,780 F for frozen, f for frozen at that end. 94 00:06:15,780 --> 00:06:20,400 Maybe I, maybe I start off with a warm bar. 95 00:06:20,400 --> 00:06:26,990 So u at 0 and x, I'll say it'd be 1. 96 00:06:26,990 --> 00:06:27,960 This way is x. 97 00:06:30,630 --> 00:06:33,790 So I have an ordinary heated bar, 98 00:06:33,790 --> 00:06:36,090 and I put it in the freezer. 99 00:06:36,090 --> 00:06:42,070 So I insulate the sides so the heat is escaping out 100 00:06:42,070 --> 00:06:46,990 the two ends, out the end x equals 0 and out the end 101 00:06:46,990 --> 00:06:48,550 x equal 1. 102 00:06:48,550 --> 00:06:56,040 And the solution will be, let me remember 103 00:06:56,040 --> 00:06:58,740 what the general solution looked like, 104 00:06:58,740 --> 00:07:01,450 and I have to find these numbers. 105 00:07:01,450 --> 00:07:03,530 OK. 106 00:07:03,530 --> 00:07:05,850 And those numbers, of course, the numbers 107 00:07:05,850 --> 00:07:10,260 are always found by matching the initial conditions. 108 00:07:10,260 --> 00:07:13,010 This is the initial, this is an initial picture. 109 00:07:15,970 --> 00:07:16,670 OK. 110 00:07:16,670 --> 00:07:22,340 So I have to match that by-- so this is t equals 0, 111 00:07:22,340 --> 00:07:25,200 I have to match the sum of B k. 112 00:07:25,200 --> 00:07:28,400 This is k going from 1 to infinity. 113 00:07:28,400 --> 00:07:35,800 When t is, when t is zero, this is 1, and I just have the Sk. 114 00:07:35,800 --> 00:07:44,350 The sine of k pi x, that has to match the 1. 115 00:07:48,410 --> 00:07:57,640 And from that, I find the Bk's, and then the final solution. 116 00:07:57,640 --> 00:08:04,010 T greater than 0 uses those Bks. 117 00:08:04,010 --> 00:08:08,970 And we're again faced with a Fourier series problem. 118 00:08:08,970 --> 00:08:12,540 Anytime I have to find these coefficients, 119 00:08:12,540 --> 00:08:16,930 this is a Fourier sine series, I have only sines, 120 00:08:16,930 --> 00:08:19,270 not cosines here. 121 00:08:19,270 --> 00:08:21,560 And I'm finding the coefficients, 122 00:08:21,560 --> 00:08:26,070 so that this will match 1, the initial condition. 123 00:08:26,070 --> 00:08:35,120 And then, for t greater than 0, solution u will be, as we said, 124 00:08:35,120 --> 00:08:38,770 the sum of these Bk's, which come 125 00:08:38,770 --> 00:08:41,710 from the initial conditions, come from this-- Fourier 126 00:08:41,710 --> 00:08:46,510 coefficients, we still have to do that video on Fourier series 127 00:08:46,510 --> 00:08:51,680 to know what these numbers will come out to be-- times the e, 128 00:08:51,680 --> 00:08:55,120 to the minus k squared, pi squared 129 00:08:55,120 --> 00:09:01,020 t times the sine of k pi x. 130 00:09:01,020 --> 00:09:03,410 You may think, well it's a pretty messy solution, 131 00:09:03,410 --> 00:09:05,720 because it's an infinite sum. 132 00:09:05,720 --> 00:09:08,680 But it's not bad for a partial differential equation. 133 00:09:08,680 --> 00:09:11,910 We have numbers, we have something depending on time 134 00:09:11,910 --> 00:09:16,720 and decaying rapidly, and something depending on x. 135 00:09:16,720 --> 00:09:23,500 So at time 1, if I drew a picture, 136 00:09:23,500 --> 00:09:29,140 suppose the heat is, the temperature starts out 137 00:09:29,140 --> 00:09:30,560 through the whole bar at 1. 138 00:09:30,560 --> 00:09:36,540 But with this kind of time decay, a little later in time, 139 00:09:36,540 --> 00:09:39,390 the temperature's going to be something like that. 140 00:09:39,390 --> 00:09:44,780 It'll be way down at the ends, pretty low in the middle. 141 00:09:44,780 --> 00:09:47,850 And so at some time t, the temperature 142 00:09:47,850 --> 00:09:50,810 will look like that, and then soon after that, 143 00:09:50,810 --> 00:09:52,820 the temperature will go down here, 144 00:09:52,820 --> 00:09:56,570 and the steady state, of course, is the whole thing 145 00:09:56,570 --> 00:09:58,300 is at temperature 0. 146 00:09:58,300 --> 00:10:05,020 So that's what solutions to the heat equation look like. 147 00:10:05,020 --> 00:10:09,820 And this is the step of finding the-- which I didn't take, 148 00:10:09,820 --> 00:10:12,750 it's the Fourier series step-- of finding 149 00:10:12,750 --> 00:10:17,760 the coefficients in our infinite series of solutions. 150 00:10:17,760 --> 00:10:20,670 Once again, we have infinitely many solutions. 151 00:10:20,670 --> 00:10:23,270 We're talking about a partial differential equation. 152 00:10:23,270 --> 00:10:27,330 We have a whole function to match, so we need all of those. 153 00:10:27,330 --> 00:10:34,220 And Fourier series tells us how to do that matching, 154 00:10:34,220 --> 00:10:36,630 how to find these Bk's. 155 00:10:36,630 --> 00:10:40,790 So that's a separate and important question, 156 00:10:40,790 --> 00:10:42,250 Fourier series. 157 00:10:42,250 --> 00:10:43,910 Thank you.