1 00:00:00,499 --> 00:00:01,460 GILBERT STRANG: OK. 2 00:00:01,460 --> 00:00:04,370 So this is using Fourier series. 3 00:00:04,370 --> 00:00:08,220 So I had to pick an equation where 4 00:00:08,220 --> 00:00:11,600 we were given a function, and not just 5 00:00:11,600 --> 00:00:13,660 a couple of initial values. 6 00:00:13,660 --> 00:00:17,210 So I made the equation a partial differential equation. 7 00:00:17,210 --> 00:00:20,910 The most famous one, Laplace's equation. 8 00:00:20,910 --> 00:00:23,590 So this is the setup. 9 00:00:23,590 --> 00:00:27,393 And you'll see how Fourier series comes in. 10 00:00:27,393 --> 00:00:28,900 We're in a circle. 11 00:00:28,900 --> 00:00:31,780 I'm going to make this a nice model problem. 12 00:00:31,780 --> 00:00:36,180 So inside this circle we're solving Laplace's equation. 13 00:00:36,180 --> 00:00:38,860 Laplace's equation was the second derivative 14 00:00:38,860 --> 00:00:43,120 of u in the x direction, plus the second derivative 15 00:00:43,120 --> 00:00:48,900 of u in the y direction, is 0. 16 00:00:48,900 --> 00:00:54,070 That's the way heat, temperature, distributes itself 17 00:00:54,070 --> 00:00:55,070 when you leave it alone. 18 00:00:57,870 --> 00:01:04,099 In this problem I'm going to put a source of heat at that point. 19 00:01:04,099 --> 00:01:06,390 So it'll be a point source. 20 00:01:06,390 --> 00:01:07,870 A delta function. 21 00:01:07,870 --> 00:01:13,290 And on the rest of the boundary, temperature 0. 22 00:01:13,290 --> 00:01:17,240 So the boundary function is a delta function 23 00:01:17,240 --> 00:01:21,170 with a spike at that one point, and 0 elsewhere. 24 00:01:21,170 --> 00:01:25,770 And our problem is to solve the Laplace's equation 25 00:01:25,770 --> 00:01:28,210 inside the circle. 26 00:01:28,210 --> 00:01:32,100 And we use polar coordinates because we've got a circle. 27 00:01:32,100 --> 00:01:34,550 So there is the equation with x and y, 28 00:01:34,550 --> 00:01:38,530 but we really are thinking r and theta. 29 00:01:38,530 --> 00:01:41,240 And the reason is, you get beautiful solutions 30 00:01:41,240 --> 00:01:45,570 to this equation using r and theta. 31 00:01:45,570 --> 00:01:48,980 And that was a family of solutions. 32 00:01:48,980 --> 00:01:52,840 r to the n-th cos n theta just works. 33 00:01:52,840 --> 00:01:56,830 And so does r to the n-th sine n theta. 34 00:01:56,830 --> 00:01:59,200 And that's for every n. 35 00:01:59,200 --> 00:02:01,180 So we have-- we can combine. 36 00:02:01,180 --> 00:02:02,890 We have a linear equation. 37 00:02:02,890 --> 00:02:07,490 We can take combinations of solutions with coefficients 38 00:02:07,490 --> 00:02:11,810 a n in the cosines, and bn in the sines. 39 00:02:11,810 --> 00:02:14,530 And now here's the key step. 40 00:02:14,530 --> 00:02:16,990 Put in r equal 1. 41 00:02:16,990 --> 00:02:18,360 Put r equal 1. 42 00:02:18,360 --> 00:02:26,880 And then this solution, u at 1 and theta-- r equal 1-- 43 00:02:26,880 --> 00:02:29,690 is the boundary. 44 00:02:29,690 --> 00:02:31,030 It's the circle. 45 00:02:31,030 --> 00:02:37,970 And that's where we're given u of 1 to be the delta function. 46 00:02:37,970 --> 00:02:39,970 The point source. 47 00:02:39,970 --> 00:02:41,170 The delta function. 48 00:02:41,170 --> 00:02:43,750 Delta of theta. 49 00:02:43,750 --> 00:02:46,670 The point source at theta equals 0. 50 00:02:46,670 --> 00:02:48,860 So you see our job. 51 00:02:48,860 --> 00:02:52,570 That function, that boundary condition, 52 00:02:52,570 --> 00:02:56,730 is supposed to tell us the a's and the b's. 53 00:02:56,730 --> 00:02:59,400 And then we have our solution. 54 00:02:59,400 --> 00:03:05,890 So by putting r equal to 1 in this formula, 55 00:03:05,890 --> 00:03:07,930 we're supposed to get the delta function. 56 00:03:07,930 --> 00:03:09,440 So let me put r equal 1. 57 00:03:09,440 --> 00:03:11,270 Easy to do. 58 00:03:11,270 --> 00:03:18,010 It's the sum of a n, 1 to the n-th, cos n theta, 59 00:03:18,010 --> 00:03:25,120 plus the sum of bn, 1 to the n-th, sine n theta, 60 00:03:25,120 --> 00:03:28,000 is supposed to match the delta function. 61 00:03:31,130 --> 00:03:33,500 So that's the Fourier series for the delta function. 62 00:03:33,500 --> 00:03:35,180 That's the whole point. 63 00:03:35,180 --> 00:03:41,160 That we use a Fourier series expression 64 00:03:41,160 --> 00:03:44,310 for the boundary function, whatever that boundary function 65 00:03:44,310 --> 00:03:44,810 is. 66 00:03:44,810 --> 00:03:48,230 Here it's a particularly nice neat one. 67 00:03:48,230 --> 00:03:52,300 And actually, the delta function is an even function. 68 00:03:52,300 --> 00:03:58,180 It's 0 at theta and it's 0 at minus theta. 69 00:03:58,180 --> 00:04:05,020 So changing theta to minus theta still leaves me the spike at 0. 70 00:04:05,020 --> 00:04:08,080 So because it's an even function, 71 00:04:08,080 --> 00:04:11,030 I won't see any signs. 72 00:04:11,030 --> 00:04:13,380 I won't see any odd functions. 73 00:04:13,380 --> 00:04:14,850 The sine theta. 74 00:04:14,850 --> 00:04:18,870 And I have an easy time to find the coefficients 75 00:04:18,870 --> 00:04:20,890 a n of the cosines. 76 00:04:20,890 --> 00:04:26,330 Actually, we did that directly from the formula for the a n's. 77 00:04:26,330 --> 00:04:28,990 Let me just remember that formula. 78 00:04:28,990 --> 00:04:35,850 The formula was a0 was 1 over 2 pi times the average. 79 00:04:38,835 --> 00:04:43,490 a0 is the average value of the temperature. 80 00:04:43,490 --> 00:04:48,800 And the temperature on the boundary is delta theta. 81 00:04:48,800 --> 00:04:54,900 And that integrates to 1, and we get the answer 1 over 2 pi. 82 00:04:54,900 --> 00:04:57,555 That's the average temperature. 83 00:04:57,555 --> 00:04:59,320 Isn't that a little weird? 84 00:04:59,320 --> 00:05:02,500 The temperature 0 except at one point. 85 00:05:02,500 --> 00:05:08,960 At that point it's a delta function with the coefficient 1 86 00:05:08,960 --> 00:05:10,000 outside it. 87 00:05:10,000 --> 00:05:12,820 And then we get 1 over 2 pi as the average. 88 00:05:12,820 --> 00:05:19,570 The other a n's, the coefficients of the cosines, 89 00:05:19,570 --> 00:05:25,360 are 1 over pi, times the integral of our delta function, 90 00:05:25,360 --> 00:05:30,110 times cos n theta d theta. 91 00:05:30,110 --> 00:05:34,510 And the delta function, that point source, 92 00:05:34,510 --> 00:05:38,660 picks out that number at theta equals 0. 93 00:05:38,660 --> 00:05:40,350 And that number is 1. 94 00:05:40,350 --> 00:05:43,890 So I'm getting 1 over pi. 95 00:05:43,890 --> 00:05:47,830 So finally I now know the a's and b's. 96 00:05:47,830 --> 00:05:51,230 When I put those in, that tells me the solution. 97 00:05:51,230 --> 00:05:58,230 The solution-- now I can put r back in the picture-- 98 00:05:58,230 --> 00:05:59,990 it's a sum. 99 00:05:59,990 --> 00:06:03,410 Well, let me take the a0 term. 100 00:06:03,410 --> 00:06:09,200 The a0 is 1 over 2 pi-- that's the constant, that's 101 00:06:09,200 --> 00:06:22,780 the average-- plus the sum of 1 over pi cos n theta, from n 102 00:06:22,780 --> 00:06:26,450 equals 1 to infinity. 103 00:06:26,450 --> 00:06:27,853 And r to the n-th. 104 00:06:27,853 --> 00:06:29,250 Sorry. r to the n-th. 105 00:06:33,640 --> 00:06:35,650 So you see what happens. 106 00:06:35,650 --> 00:06:40,750 When r is 1, we have the Fourier series for the delta function. 107 00:06:40,750 --> 00:06:45,350 That's the very exceptional function 108 00:06:45,350 --> 00:06:47,950 that's given on the boundary. 109 00:06:47,950 --> 00:06:54,280 As soon as r is less than 1, these r to the n-th's 110 00:06:54,280 --> 00:06:58,450 get small, and we have a series that 111 00:06:58,450 --> 00:07:00,740 adds up to a reasonable sum. 112 00:07:00,740 --> 00:07:06,890 And we can actually-- it's possible to add up that series. 113 00:07:06,890 --> 00:07:09,100 It's possible to add up that series. 114 00:07:09,100 --> 00:07:14,580 It's a geometric series if you switch from cosines 115 00:07:14,580 --> 00:07:16,130 to exponentials. 116 00:07:16,130 --> 00:07:18,850 That's usually the good way to get good formulas. 117 00:07:18,850 --> 00:07:20,910 And here, so you can add it up. 118 00:07:20,910 --> 00:07:24,540 And I think there's a 1 over 2 pi still there. 119 00:07:24,540 --> 00:07:31,050 And I think it's 1 minus r squared, over 1 plus r squared, 120 00:07:31,050 --> 00:07:37,260 minus 2r cos theta. 121 00:07:37,260 --> 00:07:39,700 Let me just be sure I got that right. 122 00:07:39,700 --> 00:07:41,350 Yep, looks good. 123 00:07:41,350 --> 00:07:42,220 Looks good. 124 00:07:42,220 --> 00:07:43,690 And we could check if it's good. 125 00:07:46,200 --> 00:07:49,240 Let's take theta equal 0. 126 00:07:49,240 --> 00:07:51,290 So if we take theta equal 0. 127 00:07:51,290 --> 00:07:53,710 Let me draw that circle again. 128 00:07:53,710 --> 00:07:54,890 Theta equal 0. 129 00:07:54,890 --> 00:07:57,640 We're coming out on that ray. 130 00:07:57,640 --> 00:08:01,940 And we're expecting to see infinity when we get there, 131 00:08:01,940 --> 00:08:03,120 at r equal 1. 132 00:08:03,120 --> 00:08:05,850 So theta equal 0. 133 00:08:05,850 --> 00:08:07,780 So let me just put that. 134 00:08:07,780 --> 00:08:12,210 On the ray, theta equal 0. 135 00:08:12,210 --> 00:08:15,020 This is what you should do. 136 00:08:15,020 --> 00:08:18,590 We have a formula for all r and theta, 137 00:08:18,590 --> 00:08:21,620 but let's look at some particular points 138 00:08:21,620 --> 00:08:23,200 to see what's happening. 139 00:08:23,200 --> 00:08:28,180 So along that ray, where theta is 0, 140 00:08:28,180 --> 00:08:34,919 I have 1 over 2 pi, 1 minus r squared, over 1 141 00:08:34,919 --> 00:08:37,460 plus r squared, minus 2r. 142 00:08:37,460 --> 00:08:40,130 Because cos theta is 1. 143 00:08:40,130 --> 00:08:47,050 And 1 plus r squared, minus 2r, is 1 minus r squared. 144 00:08:47,050 --> 00:08:48,480 Right? 145 00:08:48,480 --> 00:08:52,010 Because cos theta is 1 on this ray. 146 00:08:52,010 --> 00:08:53,010 Theta is 0. 147 00:08:53,010 --> 00:08:55,850 Cos theta is 1. 148 00:08:55,850 --> 00:08:59,580 And now 1 minus r will factor out of this. 149 00:08:59,580 --> 00:09:04,250 And I think we get 1 plus r. 150 00:09:04,250 --> 00:09:07,760 And we still have a 1 minus r down below. 151 00:09:07,760 --> 00:09:09,880 I like that. 152 00:09:09,880 --> 00:09:12,160 You don't often, for partial differential equations, 153 00:09:12,160 --> 00:09:15,770 get some nice expression for the solution. 154 00:09:15,770 --> 00:09:17,270 So that's the solution. 155 00:09:17,270 --> 00:09:23,490 And as r goes to 1, this solution blows up. 156 00:09:23,490 --> 00:09:24,040 Right. 157 00:09:24,040 --> 00:09:26,460 The temperature is infinite on the boundary, 158 00:09:26,460 --> 00:09:29,700 but the temperature is something reasonable inside. 159 00:09:29,700 --> 00:09:34,000 And at r equals 0, I have 1 over 2 pi. 160 00:09:34,000 --> 00:09:34,790 Well, of course. 161 00:09:34,790 --> 00:09:36,760 It's the average value. 162 00:09:36,760 --> 00:09:39,310 Right at the center that temperature 163 00:09:39,310 --> 00:09:41,710 is going to be the average on the boundary. 164 00:09:41,710 --> 00:09:46,840 That's a natural key property of Laplace's equation. 165 00:09:46,840 --> 00:09:48,830 It averages everything. 166 00:09:48,830 --> 00:09:53,780 Actually, if I take a little circle in anywhere, 167 00:09:53,780 --> 00:09:56,800 those temperature in the center of that circle 168 00:09:56,800 --> 00:10:00,470 would be the average of the temperatures 169 00:10:00,470 --> 00:10:02,860 around the little circle. 170 00:10:02,860 --> 00:10:04,110 For all the circles. 171 00:10:04,110 --> 00:10:08,620 It's just the Laplace's equation. 172 00:10:08,620 --> 00:10:11,790 Solving Laplace's equation averages everything. 173 00:10:11,790 --> 00:10:20,560 And the result is that the temperature function sort of 174 00:10:20,560 --> 00:10:23,190 smoothes out as I come in. 175 00:10:23,190 --> 00:10:26,600 Around the boundary it's far from smooth. 176 00:10:26,600 --> 00:10:30,770 There's a big jolt at theta equals 0. 177 00:10:30,770 --> 00:10:35,380 But if I look on that circle, or that circle, or this circle, 178 00:10:35,380 --> 00:10:41,040 the temperature is a nice smooth function. 179 00:10:41,040 --> 00:10:46,780 And it's never going to be above the maximum on the boundary. 180 00:10:46,780 --> 00:10:50,280 And it's never going to be below the minimum on the boundary. 181 00:10:50,280 --> 00:10:53,730 Everything's being averaged. 182 00:10:53,730 --> 00:10:57,390 So that's, you see, a use of the Fourier series. 183 00:10:57,390 --> 00:10:59,350 For one particular function. 184 00:10:59,350 --> 00:11:04,260 I could do another function, but I don't think I will. 185 00:11:04,260 --> 00:11:08,320 I could take the function that's 1 on the top of the circle 186 00:11:08,320 --> 00:11:11,630 and minus 1 on the bottom half of the circle. 187 00:11:11,630 --> 00:11:15,710 OK, that's a function with a jump, but not a delta function. 188 00:11:15,710 --> 00:11:19,500 So we would see a Fourier series that would give us 189 00:11:19,500 --> 00:11:20,655 the a's and the b's. 190 00:11:20,655 --> 00:11:24,070 There would probably only be b's in that case. 191 00:11:24,070 --> 00:11:24,690 Sine. 192 00:11:24,690 --> 00:11:25,950 Sine terms. 193 00:11:25,950 --> 00:11:29,900 And we'd get an answer. 194 00:11:29,900 --> 00:11:32,090 May I just, while I'm talking about averages, 195 00:11:32,090 --> 00:11:34,470 add one final comment. 196 00:11:34,470 --> 00:11:39,020 Usually, for a complicated region, 197 00:11:39,020 --> 00:11:42,880 we can't solve Laplace's equation with formulas. 198 00:11:42,880 --> 00:11:45,500 It's not possible. 199 00:11:45,500 --> 00:11:50,810 We can't find sines and cosines that match some crazy boundary. 200 00:11:50,810 --> 00:11:55,600 So we have to replace Laplace's equation. 201 00:11:55,600 --> 00:11:58,320 So I'll write Laplace's equation again. 202 00:12:05,160 --> 00:12:13,300 That goes into u-- we have a region. 203 00:12:13,300 --> 00:12:19,050 And we carve it out with a grid. 204 00:12:19,050 --> 00:12:22,680 And then at each point on the grid, 205 00:12:22,680 --> 00:12:27,400 we have an equation connecting the value of u at that point. 206 00:12:27,400 --> 00:12:30,690 Say u0 at the center. 207 00:12:30,690 --> 00:12:42,040 With u east, maybe, u west, u north, and u south. 208 00:12:45,200 --> 00:12:47,640 So we have an equation, and I want 209 00:12:47,640 --> 00:12:49,690 to write that equation down. 210 00:12:49,690 --> 00:12:56,010 u center is just going to be the average. 211 00:12:56,010 --> 00:13:05,270 It's just going to be 1/4 of u east, u west, u north, and u 212 00:13:05,270 --> 00:13:05,770 south. 213 00:13:09,070 --> 00:13:13,150 So that'll be true at-- that equation will hold. 214 00:13:13,150 --> 00:13:15,730 The unknowns are all these u's. 215 00:13:15,730 --> 00:13:17,690 The u's of all the mesh points. 216 00:13:17,690 --> 00:13:20,490 And I have an equation at every mesh point. 217 00:13:20,490 --> 00:13:26,640 So I have the same number of equations from the mesh points 218 00:13:26,640 --> 00:13:29,890 as unknowns at the mesh points. 219 00:13:29,890 --> 00:13:36,500 I solve that big system, and that gives me a solution u. 220 00:13:36,500 --> 00:13:40,170 An approximate solution u to Laplace's equation. 221 00:13:40,170 --> 00:13:44,180 So this would be called Laplace's difference equation, 222 00:13:44,180 --> 00:13:49,520 or Laplace's five-point scheme, because it uses 223 00:13:49,520 --> 00:13:53,040 five points in that average. 224 00:13:53,040 --> 00:13:53,810 OK. 225 00:13:53,810 --> 00:13:57,650 That's an important problem in numerical analysis. 226 00:13:57,650 --> 00:13:59,360 Thank you.