1 00:00:00,000 --> 00:00:00,499 2 00:00:00,499 --> 00:00:04,415 The following content is provided under a Creative 3 00:00:04,415 --> 00:00:05,220 Commons license. 4 00:00:05,220 --> 00:00:05,770 Your support will help MIT OpenCourseWare 5 00:00:05,770 --> 00:00:09,370 continue to offer high-quality educational resources for free. 6 00:00:09,370 --> 00:00:11,530 To make a donation, or to view additional materials 7 00:00:11,530 --> 00:00:15,870 from hundreds of MIT courses, visit MIT OpenCourseWare 8 00:00:15,870 --> 00:00:20,970 at ocw.mit.edu. 9 00:00:20,970 --> 00:00:22,960 PROFESSOR STRANG: OK, let's start 10 00:00:22,960 --> 00:00:26,890 with a review and preview. 11 00:00:26,890 --> 00:00:29,350 I put a P up there because we're really 12 00:00:29,350 --> 00:00:36,080 looking into the Fourier part that just started this morning. 13 00:00:36,080 --> 00:00:40,260 And there'll be some homework from these early sections 14 00:00:40,260 --> 00:00:43,400 about the Fourier stuff, so we maybe we 15 00:00:43,400 --> 00:00:51,400 should just do a few of those problems or discuss here today. 16 00:00:51,400 --> 00:00:54,880 Just in advance. 17 00:00:54,880 --> 00:00:58,810 Can I say one thing about MATLAB and the MATLAB homework first? 18 00:00:58,810 --> 00:01:03,990 And maybe open a conversation about it? 19 00:01:03,990 --> 00:01:09,340 So there's really two different problems 20 00:01:09,340 --> 00:01:13,260 that I'm personally quite interested in. 21 00:01:13,260 --> 00:01:15,280 Two model, I'll say model problems 22 00:01:15,280 --> 00:01:20,640 because they're for regular polygons in a circle. 23 00:01:20,640 --> 00:01:25,910 And I'll draw an octagon again. 24 00:01:25,910 --> 00:01:31,170 So M sides. 25 00:01:31,170 --> 00:01:34,800 And I'm interested in as M goes to infinity. 26 00:01:34,800 --> 00:01:37,230 And I'm interested in two different problems. 27 00:01:37,230 --> 00:01:46,690 So one of them is our MATLAB problem, is Laplace's equation. 28 00:01:46,690 --> 00:01:50,920 What was it, four? 29 00:01:50,920 --> 00:01:58,500 With u=0 on the circle. 30 00:01:58,500 --> 00:02:02,700 OK, so that's our problem, totally open for discussion. 31 00:02:02,700 --> 00:02:05,230 How many have started on that? 32 00:02:05,230 --> 00:02:06,051 Oh, good. 33 00:02:06,051 --> 00:02:06,550 OK. 34 00:02:06,550 --> 00:02:08,900 Well, then you all know more about it than I. 35 00:02:08,900 --> 00:02:10,580 And that's great. 36 00:02:10,580 --> 00:02:14,050 I'd be happy to learn. 37 00:02:14,050 --> 00:02:15,700 So have I said everything there? 38 00:02:15,700 --> 00:02:18,500 Yeah, we've got Poisson's equation inside. 39 00:02:18,500 --> 00:02:22,940 We've got u=0 on the circle, so the problem's well defined 40 00:02:22,940 --> 00:02:29,490 and the solution should be one minus x squared minus y 41 00:02:29,490 --> 00:02:33,400 squared. 42 00:02:33,400 --> 00:02:35,490 So that's the correct solution. 43 00:02:35,490 --> 00:02:38,360 Maybe I can also tell you about the second problem 44 00:02:38,360 --> 00:02:40,270 that I'm interested in. 45 00:02:40,270 --> 00:02:43,450 Because it hasn't come up in class but it's 46 00:02:43,450 --> 00:02:45,330 very important too. 47 00:02:45,330 --> 00:02:47,370 It would be the eigenvalue problem. 48 00:02:47,370 --> 00:02:52,140 So this is problem number one, the steady state problem 49 00:02:52,140 --> 00:02:57,330 when you've got a source and you want to find out 50 00:02:57,330 --> 00:02:59,590 the temperature distribution. 51 00:02:59,590 --> 00:03:04,220 The problem number two would be the eigenvalue problem, 52 00:03:04,220 --> 00:03:06,050 -u_xx-u_yy. 53 00:03:06,050 --> 00:03:12,590 I take those minuses so that the eigenvalue will be positive. 54 00:03:12,590 --> 00:03:15,540 So that's what the eigenvalue problem might look like. 55 00:03:15,540 --> 00:03:20,240 And again let me say, with u=0 on the boundary. 56 00:03:20,240 --> 00:03:25,090 On the circle. 57 00:03:25,090 --> 00:03:33,500 OK, so a person would say this is Laplace's eigenvalue problem 58 00:03:33,500 --> 00:03:35,640 because we have Laplace's equation. 59 00:03:35,640 --> 00:03:38,540 We've got eigenvalue. 60 00:03:38,540 --> 00:03:42,760 As always, it's not linear because we have two unknowns, 61 00:03:42,760 --> 00:03:45,420 lambda's multiplying u. 62 00:03:45,420 --> 00:03:48,030 And we have boundary conditions, and this 63 00:03:48,030 --> 00:03:54,140 would describe the normal modes, for example, 64 00:03:54,140 --> 00:03:56,000 of a circular drum. 65 00:03:56,000 --> 00:04:00,520 If I had a drum-- Or a polygon drum. 66 00:04:00,520 --> 00:04:06,780 So maybe I connect, to actually build the drum, 67 00:04:06,780 --> 00:04:11,140 I might fold in the sides there and have a polygon. 68 00:04:11,140 --> 00:04:15,090 And again, I hope that the eigenvalues 69 00:04:15,090 --> 00:04:20,220 of the polygon, this equation in the polygon, 70 00:04:20,220 --> 00:04:22,660 which are not known, by the way. 71 00:04:22,660 --> 00:04:27,700 To the best to my knowledge, we know it only for M=3, 72 00:04:27,700 --> 00:04:32,290 which would be an equilateral triangle, and M=4, 73 00:04:32,290 --> 00:04:34,100 which would be a square. 74 00:04:34,100 --> 00:04:39,060 And those eigenvalues, because of Fourier or something 75 00:04:39,060 --> 00:04:42,130 are humanly doable. 76 00:04:42,130 --> 00:04:48,980 But I think five on up is, I may be wrong about six, 77 00:04:48,980 --> 00:04:52,540 I'm not sure about M=6, a hexagon sometimes gives you 78 00:04:52,540 --> 00:04:53,210 enough help. 79 00:04:53,210 --> 00:04:59,120 But beyond that you're on your own. 80 00:04:59,120 --> 00:05:03,720 With finite elements to help you. 81 00:05:03,720 --> 00:05:09,080 So there's a whole sequence of eigenfunctions u, 82 00:05:09,080 --> 00:05:15,450 eigenvalues lambda, just the way there were in one dimension. 83 00:05:15,450 --> 00:05:18,090 And on the circle they involve Bessel. 84 00:05:18,090 --> 00:05:21,970 That's where Bessel showed up. 85 00:05:21,970 --> 00:05:24,640 He figured out the functions and they're not 86 00:05:24,640 --> 00:05:29,270 especially nice functions. 87 00:05:29,270 --> 00:05:32,630 But they're studied for centuries. 88 00:05:32,630 --> 00:05:36,270 Bessel functions come into that. 89 00:05:36,270 --> 00:05:40,420 But, here I have the same question. 90 00:05:40,420 --> 00:05:44,950 I mean, let me just say, for me this could be a UROP project 91 00:05:44,950 --> 00:05:47,120 if anybody was an undergraduate, or it 92 00:05:47,120 --> 00:05:51,000 could be a project over January or something. 93 00:05:51,000 --> 00:05:55,900 I'd like to know something about what 94 00:05:55,900 --> 00:06:02,500 happens as M goes to infinity, as the polygon approaches 95 00:06:02,500 --> 00:06:03,520 the circle. 96 00:06:03,520 --> 00:06:11,280 So I'm hoping maybe on the homework that come in, 97 00:06:11,280 --> 00:06:14,720 if it's not too difficult, and maybe it's not, 98 00:06:14,720 --> 00:06:18,750 to let M go up a bit. 99 00:06:18,750 --> 00:06:20,910 There is one thing. 100 00:06:20,910 --> 00:06:25,680 That the code we're working with is linear elements, right? 101 00:06:25,680 --> 00:06:27,820 We're using linear finite elements. 102 00:06:27,820 --> 00:06:32,050 So we're not getting high accuracy. 103 00:06:32,050 --> 00:06:34,540 So I would really like to move up 104 00:06:34,540 --> 00:06:39,810 to quadratic elements, at least, you 105 00:06:39,810 --> 00:06:41,420 remember quadratic elements would 106 00:06:41,420 --> 00:06:48,260 be ones where-- Well, let me draw the one that we've 107 00:06:48,260 --> 00:06:52,160 drawn in class before. 108 00:06:52,160 --> 00:06:54,630 We only have to look at one triangle 109 00:06:54,630 --> 00:06:57,790 and then we cut it up into triangular elements 110 00:06:57,790 --> 00:07:03,470 by taking some pieces here, taking the points above, 111 00:07:03,470 --> 00:07:07,650 which I hope are now correct on the website. 112 00:07:07,650 --> 00:07:11,150 Connecting those edges, and then connecting these. 113 00:07:11,150 --> 00:07:12,170 Is that right? 114 00:07:12,170 --> 00:07:18,210 Is that our mesh? 115 00:07:18,210 --> 00:07:23,640 So that mesh is controlled by N. One, two, N points. 116 00:07:23,640 --> 00:07:32,810 Also, N is going to have to get large too, to give me accuracy. 117 00:07:32,810 --> 00:07:36,210 And another way toward more accuracy 118 00:07:36,210 --> 00:07:42,320 is, instead of linear elements, second degree. 119 00:07:42,320 --> 00:07:44,710 So do you remember I wrote those down? 120 00:07:44,710 --> 00:07:51,230 Let me take that little triangle out here as a bigger triangle. 121 00:07:51,230 --> 00:07:53,920 It would look something like that, I guess. 122 00:07:53,920 --> 00:07:58,170 The second degree elements have those six mesh points. 123 00:07:58,170 --> 00:08:01,590 You remember I drew those but we didn't really have time 124 00:08:01,590 --> 00:08:07,330 to get further with them. 125 00:08:07,330 --> 00:08:12,640 The trial functions phi, which are one at a typical mesh 126 00:08:12,640 --> 00:08:18,800 point and zero at all the others, they are computable. 127 00:08:18,800 --> 00:08:22,640 We're up to second degree, so it's a little-- Second degree 128 00:08:22,640 --> 00:08:25,400 things, then the first derivatives, 129 00:08:25,400 --> 00:08:28,420 which come into the integrations, are linear. 130 00:08:28,420 --> 00:08:29,370 And not constant. 131 00:08:29,370 --> 00:08:31,960 So a little bit harder. 132 00:08:31,960 --> 00:08:38,290 But finite elements, linear or quadratic, or higher, 133 00:08:38,290 --> 00:08:40,510 could be used for this problem. 134 00:08:40,510 --> 00:08:45,280 As we know, and for this problem. 135 00:08:45,280 --> 00:08:48,670 What I wanted to add, that I've not mentioned in class, 136 00:08:48,670 --> 00:08:53,360 and I think we may just not get a chance to do it, 137 00:08:53,360 --> 00:08:56,710 is what does the finite element method look 138 00:08:56,710 --> 00:08:58,700 like for an eigenvalue problem? 139 00:08:58,700 --> 00:09:02,120 Because eigenvalues are highly important. 140 00:09:02,120 --> 00:09:06,120 That's the different way to understand. 141 00:09:06,120 --> 00:09:08,890 There's the matrix K and its entries. 142 00:09:08,890 --> 00:09:11,420 But then there are the eigenvalues. 143 00:09:11,420 --> 00:09:13,140 And you might think that, what do 144 00:09:13,140 --> 00:09:17,710 you think is the discrete eigenvalue problem copying 145 00:09:17,710 --> 00:09:19,390 this one? 146 00:09:19,390 --> 00:09:21,510 Here's my point. 147 00:09:21,510 --> 00:09:26,370 Your first guess would be, well this is like K, right? 148 00:09:26,370 --> 00:09:34,110 This is like KU, right? (K2D)U, I should call it, maybe. 149 00:09:34,110 --> 00:09:39,420 Well, I'll call it K, because K2D I have specifically 150 00:09:39,420 --> 00:09:46,170 reserved for the Laplace stiffness 151 00:09:46,170 --> 00:09:51,600 matrix on a square mesh, square mesh with triangles, the K2D. 152 00:09:51,600 --> 00:09:56,970 That was one specific matrix for one specific mesh, 153 00:09:56,970 --> 00:09:59,140 and here we have a different mesh. 154 00:09:59,140 --> 00:10:05,060 So I should just call it K. Ok, I think if anybody was going 155 00:10:05,060 --> 00:10:09,290 to make a guess, they would say OK, KU=Lambda*U. 156 00:10:09,290 --> 00:10:13,760 Maybe I'll use capital Lambda, because I'm using capital U. 157 00:10:13,760 --> 00:10:28,330 Is this the finite element method eigenvalue problem? 158 00:10:28,330 --> 00:10:33,270 And if you answered yes, I would have to say, well 159 00:10:33,270 --> 00:10:35,930 that's a reasonable answer. 160 00:10:35,930 --> 00:10:38,120 But it's wrong. 161 00:10:38,120 --> 00:10:43,990 The eigenvalue problem, when I take the differential equation 162 00:10:43,990 --> 00:10:46,760 for the Laplace, Laplace's equation, 163 00:10:46,760 --> 00:10:53,240 lambda u on the right side, and I go to do finite elements, 164 00:10:53,240 --> 00:10:57,110 it produces K. Out of this stuff, 165 00:10:57,110 --> 00:11:00,160 out of the weak form, all that stuff. 166 00:11:00,160 --> 00:11:04,110 But it produces another matrix on the right-hand side 167 00:11:04,110 --> 00:11:07,840 from the constant term, and we have not really mentioned it, 168 00:11:07,840 --> 00:11:09,910 it's the mass matrix. 169 00:11:09,910 --> 00:11:13,580 So this, instead of just the identity here, 170 00:11:13,580 --> 00:11:16,170 there's a mass matrix. 171 00:11:16,170 --> 00:11:21,570 So that is the problem that you could do. 172 00:11:21,570 --> 00:11:28,080 I could've made a MATLAB project. 173 00:11:28,080 --> 00:11:31,730 I bet I'd do it next fall. 174 00:11:31,730 --> 00:11:32,680 Right? 175 00:11:32,680 --> 00:11:39,250 You guys did the first one, this one. 176 00:11:39,250 --> 00:11:40,850 Or you are doing it now. 177 00:11:40,850 --> 00:11:44,460 And I'm going to pause in a minute for questions about it, 178 00:11:44,460 --> 00:11:46,000 or discussion of it. 179 00:11:46,000 --> 00:11:50,850 But this one brings in something called the mass matrix. 180 00:11:50,850 --> 00:11:58,620 So let me just say what those are. 181 00:11:58,620 --> 00:12:02,000 If I write down the entries in the mass matrix, 182 00:12:02,000 --> 00:12:04,930 you'll sort of get an idea of why they are. 183 00:12:04,930 --> 00:12:07,680 So what are the entries in the stiffness matrix? 184 00:12:07,680 --> 00:12:18,500 K_ij, you remember, is the integral of the d phi_i/dx, 185 00:12:18,500 --> 00:12:20,940 d phi_j/dx. 186 00:12:20,940 --> 00:12:31,810 Plus d phi_i/dy, d phi_j/dy, dxdy, 187 00:12:31,810 --> 00:12:34,190 and that's what's you're computing. 188 00:12:34,190 --> 00:12:36,700 And that's what that code is computing. 189 00:12:36,700 --> 00:12:41,270 And when phi is linear, phi linear, 190 00:12:41,270 --> 00:12:47,500 then slopes are constant. 191 00:12:47,500 --> 00:12:52,300 So all you have to do, and what that code in the book is doing, 192 00:12:52,300 --> 00:12:55,180 is figuring out what are the slopes. 193 00:12:55,180 --> 00:12:58,190 These things are constant, so we just 194 00:12:58,190 --> 00:13:04,420 need to know the area of the integration 195 00:13:04,420 --> 00:13:06,180 where we're integrating. 196 00:13:06,180 --> 00:13:09,300 The area, triangle by triangle. 197 00:13:09,300 --> 00:13:11,310 Fine. 198 00:13:11,310 --> 00:13:12,970 That's what we're doing. 199 00:13:12,970 --> 00:13:16,860 That's what that code is just set up to do. 200 00:13:16,860 --> 00:13:20,550 Now, I have to tell you what is M_ij, the mass matrix. 201 00:13:20,550 --> 00:13:24,630 I just think you don't want to have-- 202 00:13:24,630 --> 00:13:27,820 we haven't done too badly with finite elements in here. 203 00:13:27,820 --> 00:13:31,180 We did it in 1-D, where we got it kind of straight. 204 00:13:31,180 --> 00:13:34,520 And now we're seeing what it looks like in 2-D. 205 00:13:34,520 --> 00:13:38,170 But I had not really mentioned a mass matrix. 206 00:13:38,170 --> 00:13:42,400 So here it comes. 207 00:13:42,400 --> 00:13:45,370 The mass matrix will be the integral 208 00:13:45,370 --> 00:13:50,870 of phi_i times phi_j dxdy. 209 00:13:50,870 --> 00:13:57,680 It's the zero order, no derivatives, just plain zero 210 00:13:57,680 --> 00:14:03,340 order, as you'd expect from the fact 211 00:14:03,340 --> 00:14:09,280 that the term in the continuous part is zero order. 212 00:14:09,280 --> 00:14:12,100 So it's this mass matrix that comes in. 213 00:14:12,100 --> 00:14:20,690 And maybe we could just look to see which entries will be zero 214 00:14:20,690 --> 00:14:23,730 and which will not. 215 00:14:23,730 --> 00:14:25,330 How sparse is it? 216 00:14:25,330 --> 00:14:28,710 What does the mass matrix look like? 217 00:14:28,710 --> 00:14:33,040 And can we just, let me do 1-D first. 218 00:14:33,040 --> 00:14:36,760 So there's a phi, right? 219 00:14:36,760 --> 00:14:38,470 There's another one. 220 00:14:38,470 --> 00:14:40,070 There's another one. 221 00:14:40,070 --> 00:14:45,960 So, what do you think about the mass matrix, one phi multiplied 222 00:14:45,960 --> 00:14:48,770 by another phi and integrated? 223 00:14:48,770 --> 00:14:51,570 Is it diagonal? 224 00:14:51,570 --> 00:15:00,170 No, because each phi overlaps its two neighbors. 225 00:15:00,170 --> 00:15:02,850 So tell me what kind of a matrix M is going to be? 226 00:15:02,850 --> 00:15:07,080 In 1-D. Tridiagonal. 227 00:15:07,080 --> 00:15:08,560 It'll be tridiagonal. 228 00:15:08,560 --> 00:15:12,550 Now, so was K. So K and M actually 229 00:15:12,550 --> 00:15:15,990 have non-zeroes in the same places. 230 00:15:15,990 --> 00:15:17,860 the same sparsity pattern. 231 00:15:17,860 --> 00:15:20,830 But, of course, not the same numbers in there. 232 00:15:20,830 --> 00:15:31,690 K had minus ones and twos and fours and minus ones. 233 00:15:31,690 --> 00:15:36,190 What can you tell me about this tridiagonal matrix? 234 00:15:36,190 --> 00:15:41,150 When I integrate that against this, well, 235 00:15:41,150 --> 00:15:43,130 again I would do it element by element 236 00:15:43,130 --> 00:15:48,330 because this against this, they only overlap here. 237 00:15:48,330 --> 00:15:48,830 Right? 238 00:15:48,830 --> 00:15:51,920 I'll just draw the one place that they overlap. 239 00:15:51,920 --> 00:15:54,160 And what's the point? 240 00:15:54,160 --> 00:15:56,510 They're both positive. 241 00:15:56,510 --> 00:16:02,080 So the mass matrix is, its rows don't add to zero. 242 00:16:02,080 --> 00:16:04,840 Its rows tend to add to one. 243 00:16:04,840 --> 00:16:08,370 But it's not diagonal, that's the difference. 244 00:16:08,370 --> 00:16:14,230 OK, so I just felt I couldn't feel-- 245 00:16:14,230 --> 00:16:20,100 I wouldn't have done a decent job in describing 246 00:16:20,100 --> 00:16:23,780 finite elements if I didn't describe this. 247 00:16:23,780 --> 00:16:26,480 Didn't mention this mass matrix. 248 00:16:26,480 --> 00:16:30,880 And maybe I'd better say where it comes from. 249 00:16:30,880 --> 00:16:35,190 Because eigenvalue problems, it may come number two, but that's 250 00:16:35,190 --> 00:16:37,440 pretty high up the list. 251 00:16:37,440 --> 00:16:50,380 So let me tell you where does this mass matrix come from. 252 00:16:50,380 --> 00:16:52,470 First, let me tell you about eigenvalues 253 00:16:52,470 --> 00:16:56,750 of a-- matrix eigenvalues. 254 00:16:56,750 --> 00:17:01,090 So the answer was, is this the finite element eigenvalue 255 00:17:01,090 --> 00:17:01,770 problem? 256 00:17:01,770 --> 00:17:03,690 Only if there's an M there. 257 00:17:03,690 --> 00:17:12,260 And now I want to, OK, first of all, what MATLAB command solves 258 00:17:12,260 --> 00:17:13,960 that problem? 259 00:17:13,960 --> 00:17:16,770 Let's just be a little practical for a moment. 260 00:17:16,770 --> 00:17:21,560 What MATLAB command gives me the matrix 261 00:17:21,560 --> 00:17:25,230 of eigenvectors, the matrix of eigenvalues 262 00:17:25,230 --> 00:17:32,450 would come from eig of what? 263 00:17:32,450 --> 00:17:35,320 I'd call this the generalized eigenvalue problem. 264 00:17:35,320 --> 00:17:38,690 Generalized because it's got somebody over here. 265 00:17:38,690 --> 00:17:45,270 And it's just K,M. Or of course you get the same answer, 266 00:17:45,270 --> 00:17:47,970 well you get the same eigenvalues, 267 00:17:47,970 --> 00:17:50,770 I guess the same eigenvectors, yeah, if you-- 268 00:17:50,770 --> 00:17:57,660 Or eig of M inverse K, of course. 269 00:17:57,660 --> 00:17:59,660 If you want to do it with just one matrix 270 00:17:59,660 --> 00:18:01,690 then bring M inverse over here. 271 00:18:01,690 --> 00:18:06,700 But, M inverse, the inverse of this tridiagonal matrix, 272 00:18:06,700 --> 00:18:08,350 is full. 273 00:18:08,350 --> 00:18:11,190 No zeroes in the inverse. 274 00:18:11,190 --> 00:18:15,630 So everybody would much prefer this tridiagonal-tridiagonal 275 00:18:15,630 --> 00:18:16,290 one. 276 00:18:16,290 --> 00:18:19,860 So that's how MATLAB would do it. 277 00:18:19,860 --> 00:18:25,590 And what I want to know is, back in this problem, 278 00:18:25,590 --> 00:18:29,910 how close do the finite element guys 279 00:18:29,910 --> 00:18:41,500 come, on polygons, come to the correct solution on circles. 280 00:18:41,500 --> 00:18:46,480 I'm hoping that for problem one you can maybe 281 00:18:46,480 --> 00:18:49,720 keep M and N equal, or maybe N may 282 00:18:49,720 --> 00:18:53,050 be four times M or something. 283 00:18:53,050 --> 00:18:58,270 And let them grow and see. 284 00:18:58,270 --> 00:19:01,230 Well, for example, at the center of the circle, 285 00:19:01,230 --> 00:19:05,360 or how quickly do you approach the correct answer, one, 286 00:19:05,360 --> 00:19:07,700 at the center of the circle? 287 00:19:07,700 --> 00:19:09,920 I think it's going to be a good problem. 288 00:19:09,920 --> 00:19:13,950 Let me open to, so I started out just talking there. 289 00:19:13,950 --> 00:19:17,390 What about the MATLAB problem. 290 00:19:17,390 --> 00:19:24,240 You made a start on it, is it going? 291 00:19:24,240 --> 00:19:30,320 Have you got a graph, maybe, or what's reasonable to graph, 292 00:19:30,320 --> 00:19:35,740 to give Peter to look at? 293 00:19:35,740 --> 00:19:39,420 Who's done something on that MATLAB problem? 294 00:19:39,420 --> 00:19:43,240 Yeah, go ahead tell us all what to do. 295 00:19:43,240 --> 00:19:45,840 AUDIENCE: I made the triangle bisection and-- 296 00:19:45,840 --> 00:19:48,270 PROFESSOR STRANG: OK, right. 297 00:19:48,270 --> 00:19:55,580 AUDIENCE: [INAUDIBLE] and I found that the [INAUDIBLE] 298 00:19:55,580 --> 00:19:57,070 changes to M. 299 00:19:57,070 --> 00:19:59,040 PROFESSOR STRANG: With M more, I see. 300 00:19:59,040 --> 00:20:07,330 So if you just fixed M like eight, and let N get, 301 00:20:07,330 --> 00:20:09,080 it didn't change significantly. 302 00:20:09,080 --> 00:20:12,070 It wouldn't, of course, converge to the right answer. 303 00:20:12,070 --> 00:20:16,840 It'll converge, if it does, to some kind of an answer, 304 00:20:16,840 --> 00:20:18,650 for the polygon. 305 00:20:18,650 --> 00:20:19,150 Right. 306 00:20:19,150 --> 00:20:19,730 That's right. 307 00:20:19,730 --> 00:20:23,490 So you know, as I wrote the problem 308 00:20:23,490 --> 00:20:27,980 I didn't know whether I dared say 309 00:20:27,980 --> 00:20:31,030 let M get increased too, but of course 310 00:20:31,030 --> 00:20:32,770 that's the real question. 311 00:20:32,770 --> 00:20:34,190 And what happened then? 312 00:20:34,190 --> 00:20:37,400 Did error shrink? 313 00:20:37,400 --> 00:20:41,324 OK, and now maybe it's possible to see how fast 314 00:20:41,324 --> 00:20:42,490 or something that's always-- 315 00:20:42,490 --> 00:20:46,206 AUDIENCE: [INAUDIBLE] 316 00:20:46,206 --> 00:20:47,080 PROFESSOR STRANG: Ah. 317 00:20:47,080 --> 00:20:49,800 OK, at the center. 318 00:20:49,800 --> 00:20:53,930 OK, then I hope for more comment. 319 00:20:53,930 --> 00:20:55,110 Let me say one more thing. 320 00:20:55,110 --> 00:21:00,190 My theory is that the error at the center 321 00:21:00,190 --> 00:21:06,740 is quite a bit smaller than the error closer to the boundary. 322 00:21:06,740 --> 00:21:13,340 I would be interested in an error-- Is it fairly even? 323 00:21:13,340 --> 00:21:16,200 Oh, my theory's wrong. 324 00:21:16,200 --> 00:21:18,860 It wouldn't be the first time. 325 00:21:18,860 --> 00:21:21,390 And maybe because it's linear. 326 00:21:21,390 --> 00:21:28,040 Yeah, my theory is more for better elements, like these. 327 00:21:28,040 --> 00:21:30,920 I'd be interested to know. 328 00:21:30,920 --> 00:21:37,070 Why do I think, why do I have this theory, 329 00:21:37,070 --> 00:21:41,036 which you guys are going to prove wrong anyway, but still. 330 00:21:41,036 --> 00:21:42,410 After you've proved it wrong, you 331 00:21:42,410 --> 00:21:44,190 won't listen to me if I tell it to you. 332 00:21:44,190 --> 00:21:45,970 So now I'll tell it. 333 00:21:45,970 --> 00:21:51,730 My theory is that the error around the boundary 334 00:21:51,730 --> 00:21:56,217 is, there's no error at these vertices, 335 00:21:56,217 --> 00:21:57,800 and then there's sort of a going to be 336 00:21:57,800 --> 00:22:01,540 an error because the real answer is not zero along here. 337 00:22:01,540 --> 00:22:04,670 It's sort of near zero, but not quite. 338 00:22:04,670 --> 00:22:07,060 You know, there's an error. 339 00:22:07,060 --> 00:22:10,900 So there's errors around here, from getting 340 00:22:10,900 --> 00:22:13,620 the boundary wrong. 341 00:22:13,620 --> 00:22:16,190 Squaring it off. 342 00:22:16,190 --> 00:22:19,910 But my theory is that errors, the boundary stuff, 343 00:22:19,910 --> 00:22:22,360 drops off quickly as you go inside. 344 00:22:22,360 --> 00:22:26,480 That's why I think, from those, you remember those-- Well, 345 00:22:26,480 --> 00:22:31,190 we'll see them again either today or Friday, 346 00:22:31,190 --> 00:22:36,320 those r^n*cos(nx) type things? 347 00:22:36,320 --> 00:22:39,050 That cos(n*theta)? 348 00:22:39,050 --> 00:22:42,580 Yeah, you remember those are the typical solutions 349 00:22:42,580 --> 00:22:44,780 to Laplace's equation. 350 00:22:44,780 --> 00:22:49,070 And then so that if-- And it has some coefficient, of course, 351 00:22:49,070 --> 00:22:50,390 a_n. 352 00:22:50,390 --> 00:22:56,080 And I look at that, that might be a piece of error. 353 00:22:56,080 --> 00:23:00,140 And it's way bigger when r is one and way smaller 354 00:23:00,140 --> 00:23:01,120 when r is zero. 355 00:23:01,120 --> 00:23:05,660 So anyway, that's sort of my theory. 356 00:23:05,660 --> 00:23:10,470 That if you have-- Like, physically. 357 00:23:10,470 --> 00:23:17,890 You have a circular plate and you're 358 00:23:17,890 --> 00:23:20,850 maintaining the boundary temperature 359 00:23:20,850 --> 00:23:22,720 at some sort of oscillation. 360 00:23:22,720 --> 00:23:27,050 Like, near one but up and down from one. 361 00:23:27,050 --> 00:23:33,080 Then I think further inside, it doesn't know. 362 00:23:33,080 --> 00:23:36,290 It hardly knows about that oscillation. 363 00:23:36,290 --> 00:23:38,020 This is my theory. 364 00:23:38,020 --> 00:23:42,280 That toward the center of the circle it 365 00:23:42,280 --> 00:23:46,260 only sees kind of an average boundary temperature 366 00:23:46,260 --> 00:23:49,390 and not your little ups and downs. 367 00:23:49,390 --> 00:23:53,970 So when M is big, I expect that part of error, 368 00:23:53,970 --> 00:23:59,250 the up and down part, to be not so significant in the center. 369 00:23:59,250 --> 00:24:01,660 Anyway, now that's my theory. 370 00:24:01,660 --> 00:24:04,790 AUDIENCE: [INAUDIBLE] 371 00:24:04,790 --> 00:24:11,320 PROFESSOR STRANG: Ah, good question. 372 00:24:11,320 --> 00:24:14,580 So if we only looked at the center, 373 00:24:14,580 --> 00:24:17,060 would it all be the same? 374 00:24:17,060 --> 00:24:19,900 I mean, if we're only looking at that one point 375 00:24:19,900 --> 00:24:28,900 where it should be one at the center, but along the thing, 376 00:24:28,900 --> 00:24:32,910 I don't know. 377 00:24:32,910 --> 00:24:36,770 If you look at both, and see a significant difference 378 00:24:36,770 --> 00:24:40,110 in the behavior I'd be interested. 379 00:24:40,110 --> 00:24:41,560 Yeah, yeah. 380 00:24:41,560 --> 00:24:43,960 You know, all these problems are things that there's 381 00:24:43,960 --> 00:24:47,600 no single solution to. 382 00:24:47,600 --> 00:24:53,416 AUDIENCE: [INAUDIBLE] 383 00:24:53,416 --> 00:24:55,790 PROFESSOR STRANG: The error between one minus r squared-- 384 00:24:55,790 --> 00:25:04,010 AUDIENCE: [INAUDIBLE] 385 00:25:04,010 --> 00:25:06,770 PROFESSOR STRANG: Oh, right, we've got slope error, too. 386 00:25:06,770 --> 00:25:10,100 That's a very significant point. 387 00:25:10,100 --> 00:25:13,130 I see, right. 388 00:25:13,130 --> 00:25:14,930 So the slope error's in there. 389 00:25:14,930 --> 00:25:18,440 Everybody knows, then, everybody-- 390 00:25:18,440 --> 00:25:22,810 In working the problem, I mentioned 391 00:25:22,810 --> 00:25:29,420 that the boundary conditions in this piece of pie 392 00:25:29,420 --> 00:25:32,460 were zero along here and normal derivative, 393 00:25:32,460 --> 00:25:36,300 somehow it got printed du/dh, but that was an accident. 394 00:25:36,300 --> 00:25:42,170 It should've been du/dn, dn is zero. 395 00:25:42,170 --> 00:25:45,610 So Neumann conditions on the thing 396 00:25:45,610 --> 00:25:48,020 and then I was a little scared about that point, 397 00:25:48,020 --> 00:25:50,560 but I think phooey on it. 398 00:25:50,560 --> 00:25:56,640 It's just, don't worry about it. 399 00:25:56,640 --> 00:25:59,040 But what I was going to say. 400 00:25:59,040 --> 00:26:07,430 How do you, what do you do to take into account this du/dn=0, 401 00:26:07,430 --> 00:26:13,520 this slope condition on these long boundaries? 402 00:26:13,520 --> 00:26:15,790 What should you do in finite elements 403 00:26:15,790 --> 00:26:17,790 to take account for that? 404 00:26:17,790 --> 00:26:21,490 And the answer is, in one nice word? 405 00:26:21,490 --> 00:26:22,510 Nothing. 406 00:26:22,510 --> 00:26:24,180 Right, nothing. 407 00:26:24,180 --> 00:26:26,840 Your finite element method should not, 408 00:26:26,840 --> 00:26:30,010 you don't impose any condition along these boundaries. 409 00:26:30,010 --> 00:26:35,260 Just use the code as it is with zeroes on this boundary. 410 00:26:35,260 --> 00:26:39,060 And it should work, yeah. 411 00:26:39,060 --> 00:26:39,910 It should work. 412 00:26:39,910 --> 00:26:43,910 Any comments on-- Other people, did you 413 00:26:43,910 --> 00:26:48,390 get reasonable results, or? 414 00:26:48,390 --> 00:26:49,150 Tell me something. 415 00:26:49,150 --> 00:26:55,310 Because you guys looked at those graphs and I have not. 416 00:26:55,310 --> 00:26:57,930 Any feedback yet? 417 00:26:57,930 --> 00:26:58,870 On those? 418 00:26:58,870 --> 00:27:01,930 I'm happy to get email, too, about. 419 00:27:01,930 --> 00:27:03,780 So all the email, first of all they've 420 00:27:03,780 --> 00:27:09,310 corrected the typos in the original coordinate positions. 421 00:27:09,310 --> 00:27:12,650 And now they've pointed out I'd better 422 00:27:12,650 --> 00:27:19,000 look at M is very, very welcome. 423 00:27:19,000 --> 00:27:21,760 It doesn't mean that everybody has to do this, 424 00:27:21,760 --> 00:27:24,450 if you've completed that MATLAB assignment, 425 00:27:24,450 --> 00:27:30,970 you never want to see it again, and you've kept M=8, it's OK. 426 00:27:30,970 --> 00:27:34,290 But if you're interested to see what 427 00:27:34,290 --> 00:27:39,540 happens if M goes to 16 or 32, I'm interested also. 428 00:27:39,540 --> 00:27:41,500 Right, yeah. 429 00:27:41,500 --> 00:27:45,730 OK, so anyway that's the problem we're really thinking about. 430 00:27:45,730 --> 00:27:50,100 And that's the problem that is equally important, 431 00:27:50,100 --> 00:27:55,540 but it seemed reasonable just to do one of the two. 432 00:27:55,540 --> 00:27:58,690 And we were set up to do, we have 433 00:27:58,690 --> 00:28:00,490 the code for the stiffness matrix, 434 00:28:00,490 --> 00:28:07,140 we would need a new code to do these integrals. 435 00:28:07,140 --> 00:28:13,860 Because this will be linear times linear, right? 436 00:28:13,860 --> 00:28:17,430 I'll have to compute that one times this one 437 00:28:17,430 --> 00:28:23,480 and I would need new formulas that are not there. 438 00:28:23,480 --> 00:28:26,830 I'd need formulas for, this will be linear times linear 439 00:28:26,830 --> 00:28:31,710 so I'll be integrating x squared type stuff. 440 00:28:31,710 --> 00:28:36,060 And xy's, because I'm 2-D, and y squareds. 441 00:28:36,060 --> 00:28:43,240 So it would take a little more code, but not much. 442 00:28:43,240 --> 00:28:47,720 I think the math-- Oh, here's a question for you. 443 00:28:47,720 --> 00:28:49,190 Here's a question for you. 444 00:28:49,190 --> 00:28:53,100 Suppose I have my trial functions, phi_i(x). 445 00:28:53,100 --> 00:28:56,110 446 00:28:56,110 --> 00:29:00,920 What do they add up to? 447 00:29:00,920 --> 00:29:05,420 Let me again draw a mesh, so I've got a mesh. 448 00:29:05,420 --> 00:29:09,500 These are, you know-- I'm sorry, I 449 00:29:09,500 --> 00:29:14,890 want to put in some more triangles here. 450 00:29:14,890 --> 00:29:18,930 Lots of triangles, whatever. 451 00:29:18,930 --> 00:29:23,640 Let me get some more vertices, too. 452 00:29:23,640 --> 00:29:25,800 I'm getting in trouble. 453 00:29:25,800 --> 00:29:28,190 OK, whatever. 454 00:29:28,190 --> 00:29:35,030 So phi_i is the piecewise linear guy that is one at node i. 455 00:29:35,030 --> 00:29:38,270 So I've got all these different nodes. 456 00:29:38,270 --> 00:29:41,800 I need a node there, so I've got one, two, three, there's 457 00:29:41,800 --> 00:29:44,670 a node, there's more nodes. 458 00:29:44,670 --> 00:29:47,610 If I add them all up, this is just 459 00:29:47,610 --> 00:29:51,750 like in an insight question. 460 00:29:51,750 --> 00:29:55,260 I've got all these, you could add up these hats 461 00:29:55,260 --> 00:30:00,620 in 1-D. What's the sum of the hats in one dimension? 462 00:30:00,620 --> 00:30:01,670 One. 463 00:30:01,670 --> 00:30:03,470 Good. 464 00:30:03,470 --> 00:30:05,820 The sum is one. 465 00:30:05,820 --> 00:30:09,600 It's a nice fact that these guys add up to one. 466 00:30:09,600 --> 00:30:12,880 And now why is it still true here in 2-D, 467 00:30:12,880 --> 00:30:18,080 that these little pyramids will add to one? 468 00:30:18,080 --> 00:30:22,720 That's an insight question, but it's worth thinking about. 469 00:30:22,720 --> 00:30:25,570 Why do those pyramids add to one? 470 00:30:25,570 --> 00:30:29,960 Let me leave that question. 471 00:30:29,960 --> 00:30:33,620 I'm thinking about, we haven't imposed any boundary conditions 472 00:30:33,620 --> 00:30:34,160 yet. 473 00:30:34,160 --> 00:30:38,680 We've got them all. and I claim that if we add up all 474 00:30:38,680 --> 00:30:43,740 the pyramids including the boundary chopped off pyramids 475 00:30:43,740 --> 00:30:48,020 from the boundary, that we'll get one throughout the whole, 476 00:30:48,020 --> 00:30:52,130 now it'll be phi(x,y). 477 00:30:52,130 --> 00:30:56,440 Because now I'm moving to 2-D, with pyramids. 478 00:30:56,440 --> 00:31:00,110 I think we'll still have one. 479 00:31:00,110 --> 00:31:02,890 Let me give you a minute to think about that one. 480 00:31:02,890 --> 00:31:08,170 And then we could turn to Fourier questions 481 00:31:08,170 --> 00:31:15,340 if you would like, we could do some problems from the text. 482 00:31:15,340 --> 00:31:17,450 Any thoughts about this guy? 483 00:31:17,450 --> 00:31:30,160 Why should all those individual pyramids add up to a flat roof? 484 00:31:30,160 --> 00:31:31,540 Why did it work here? 485 00:31:31,540 --> 00:31:41,580 Well, it worked because you could see it, right, somehow? 486 00:31:41,580 --> 00:31:47,110 Does it still work if the nodes are not equally spaced? 487 00:31:47,110 --> 00:31:50,070 So we've got a hat function for that guy, 488 00:31:50,070 --> 00:31:52,410 and a hat function for this guy, and a hat 489 00:31:52,410 --> 00:31:54,010 function for this guy. 490 00:31:54,010 --> 00:31:57,690 And these guys are in there, too. 491 00:31:57,690 --> 00:32:00,080 We haven't imposed anything. 492 00:32:00,080 --> 00:32:07,670 So those one, two, three, four, five functions, 493 00:32:07,670 --> 00:32:14,296 five phis, they add up to one, and why? 494 00:32:14,296 --> 00:32:15,920 Well, you're going to say it's obvious, 495 00:32:15,920 --> 00:32:20,110 but that's what professors are allowed to say. 496 00:32:20,110 --> 00:32:24,100 Things are obvious, you have to actually say why. 497 00:32:24,100 --> 00:32:26,500 Which is not as easy. 498 00:32:26,500 --> 00:32:36,880 So, why do they add to one? 499 00:32:36,880 --> 00:32:41,700 Let me look inside one element. 500 00:32:41,700 --> 00:32:45,760 Why does the sum of these two guys 501 00:32:45,760 --> 00:32:51,310 add to a flat top inside that interval? 502 00:32:51,310 --> 00:32:57,700 AUDIENCE: [INAUDIBLE] 503 00:32:57,700 --> 00:33:00,170 PROFESSOR STRANG: At the end points, you've got it. 504 00:33:00,170 --> 00:33:04,430 Because what's happening at the end points? 505 00:33:04,430 --> 00:33:10,480 This guy, one of the guys, the right guy is one. 506 00:33:10,480 --> 00:33:14,160 And all other guys are zero, right. 507 00:33:14,160 --> 00:33:17,010 And this guy is also at one. 508 00:33:17,010 --> 00:33:20,530 Because it's the right guy. 509 00:33:20,530 --> 00:33:23,280 It has height one and all others zero. 510 00:33:23,280 --> 00:33:26,960 So at the nodes we are at one, because 511 00:33:26,960 --> 00:33:29,570 of one person, really, one element. 512 00:33:29,570 --> 00:33:30,110 And then? 513 00:33:30,110 --> 00:33:32,870 AUDIENCE: [INAUDIBLE] 514 00:33:32,870 --> 00:33:38,370 PROFESSOR STRANG: Right. 515 00:33:38,370 --> 00:33:42,965 But the sum of them is, why is the sum of them always one, 516 00:33:42,965 --> 00:33:44,510 why is slope zero? 517 00:33:44,510 --> 00:33:48,010 Yeah. 518 00:33:48,010 --> 00:33:51,270 The slopes cancel, right. 519 00:33:51,270 --> 00:33:54,340 We know that in between it will be a linear function. 520 00:33:54,340 --> 00:33:56,390 That would be one way to look at it. 521 00:33:56,390 --> 00:33:59,770 If I add up a linear function and a linear function 522 00:33:59,770 --> 00:34:01,200 the sum is a linear function. 523 00:34:01,200 --> 00:34:03,090 So I'm getting a linear function, 524 00:34:03,090 --> 00:34:08,800 which is one at those points, so what is that function? 525 00:34:08,800 --> 00:34:09,570 One. 526 00:34:09,570 --> 00:34:11,790 Right, you know that's the straight line. 527 00:34:11,790 --> 00:34:16,010 So, that idea will work here too. 528 00:34:16,010 --> 00:34:20,900 Look inside some little triangle here. 529 00:34:20,900 --> 00:34:25,540 OK, that's got one, two, three corners, OK. 530 00:34:25,540 --> 00:34:31,900 And if I look at this sum, what is it at this point? 531 00:34:31,900 --> 00:34:35,010 If I look at that sum at this corner, 532 00:34:35,010 --> 00:34:37,990 one guy is one, the one for that pyramid. 533 00:34:37,990 --> 00:34:40,560 And all others are? 534 00:34:40,560 --> 00:34:41,430 Zero. 535 00:34:41,430 --> 00:34:44,410 So the sum is one there, the sum is one there, 536 00:34:44,410 --> 00:34:48,070 the sum is one there, so that blowing up 537 00:34:48,070 --> 00:34:51,140 this little triangle, this is at height one, 538 00:34:51,140 --> 00:34:53,860 this is at height one, this is at height one, 539 00:34:53,860 --> 00:34:56,440 so what's the roof? 540 00:34:56,440 --> 00:34:59,530 Flat. 541 00:34:59,530 --> 00:35:04,270 It's just a nice way to see the nice property of these phis. 542 00:35:04,270 --> 00:35:14,580 That there's a phi for every node, and they add to one. 543 00:35:14,580 --> 00:35:17,510 To that's it. 544 00:35:17,510 --> 00:35:22,870 OK, well I was going to say one more thing 545 00:35:22,870 --> 00:35:25,600 and I am, about this eigenvalue problem, just 546 00:35:25,600 --> 00:35:29,680 because I'll never have a chance again. 547 00:35:29,680 --> 00:35:33,540 So this is the moment to say something 548 00:35:33,540 --> 00:35:34,630 about the eigenvalues. 549 00:35:34,630 --> 00:35:35,940 Lambda. 550 00:35:35,940 --> 00:35:41,290 Eigenvalue. 551 00:35:41,290 --> 00:35:44,000 I'm answering the question where does K come from, 552 00:35:44,000 --> 00:35:45,680 where does M come from? 553 00:35:45,680 --> 00:35:56,610 Well, the eigenvalue is-- Voy we really got dramatic music here. 554 00:35:56,610 --> 00:36:00,410 Is that the Great Gate of Kiev, I think might be. 555 00:36:00,410 --> 00:36:01,940 Mussorgsky. 556 00:36:01,940 --> 00:36:06,230 If you like drums and big noise, it's not music actually, 557 00:36:06,230 --> 00:36:11,190 but you got a lot of noise out of it. 558 00:36:11,190 --> 00:36:16,710 Well, of course, he'd know more than we do, but still. 559 00:36:16,710 --> 00:36:26,650 OK, so the eigenvalues in the matrix case, for Kx=lambda*M*x, 560 00:36:26,650 --> 00:36:31,000 the eigenvalue problem, lambda, the lowest eigenvalue, 561 00:36:31,000 --> 00:36:34,980 lambda_lowest, has a nice property. 562 00:36:34,980 --> 00:36:46,020 It's the minimum of sort of our energy over our other energy. 563 00:36:46,020 --> 00:36:51,470 I just think, well this is something you should see. 564 00:36:51,470 --> 00:36:54,020 This is a quotient here. 565 00:36:54,020 --> 00:36:56,880 It's got a name called the Rayleigh quotient. 566 00:36:56,880 --> 00:36:59,230 And it would appear in the book. 567 00:36:59,230 --> 00:37:01,350 So really, I guess what I'm doing 568 00:37:01,350 --> 00:37:06,170 is calling your attention to something that's in the book. 569 00:37:06,170 --> 00:37:10,340 That this a ratio of x transpose K x to x transpose M 570 00:37:10,340 --> 00:37:19,560 x, if I look over all vectors x, the lowest one 571 00:37:19,560 --> 00:37:20,870 is the eigenvector. 572 00:37:20,870 --> 00:37:23,590 The best x is the eigenvector and the ratio 573 00:37:23,590 --> 00:37:26,410 is the eigenvalue. 574 00:37:26,410 --> 00:37:30,350 This is like my point that I wanted to mention the Rayleigh 575 00:37:30,350 --> 00:37:31,150 quotient. 576 00:37:31,150 --> 00:37:33,340 Here it is in the matrix case, and there 577 00:37:33,340 --> 00:37:35,080 would be similar Rayleigh quotient 578 00:37:35,080 --> 00:37:38,490 in the continuous case. 579 00:37:38,490 --> 00:37:41,200 I'll just leave it at that. 580 00:37:41,200 --> 00:37:46,070 That in describing eigenvalues, we can talk about 581 00:37:46,070 --> 00:37:49,070 Kx=lambda*M*x, like this. 582 00:37:49,070 --> 00:37:51,980 Or we can get energy into it. 583 00:37:51,980 --> 00:37:54,870 And you remember the whole point about finite elements 584 00:37:54,870 --> 00:37:57,500 is, look at the energy. 585 00:37:57,500 --> 00:37:59,470 Look at that the quadratics. 586 00:37:59,470 --> 00:38:04,980 Multiply things by things. 587 00:38:04,980 --> 00:38:07,150 It came from the weak form, it didn't 588 00:38:07,150 --> 00:38:10,220 come from the strong form. 589 00:38:10,220 --> 00:38:12,370 In the differential equation here, we just 590 00:38:12,370 --> 00:38:15,280 have single terms. 591 00:38:15,280 --> 00:38:18,870 We got to these things through that process 592 00:38:18,870 --> 00:38:23,460 of multiplying by u's and integrating. 593 00:38:23,460 --> 00:38:25,090 That's what gave us these products 594 00:38:25,090 --> 00:38:29,790 and it works also in the matrix case. 595 00:38:29,790 --> 00:38:32,420 OK, that was a lot of speech-making 596 00:38:32,420 --> 00:38:41,970 about topics that we simply didn't have time for in class. 597 00:38:41,970 --> 00:38:44,050 I'm ready for any question, or I'm 598 00:38:44,050 --> 00:38:48,210 ready to maybe do a Fourier example, would you like that? 599 00:38:48,210 --> 00:38:51,890 Because this is where we really are. 600 00:38:51,890 --> 00:38:55,660 I'll even take one that will be on the homework. 601 00:38:55,660 --> 00:39:01,510 Just so you'll have a start. 602 00:39:01,510 --> 00:39:10,780 OK, let me take a square pulse, yeah this is a good one, 603 00:39:10,780 --> 00:39:16,330 I think. 604 00:39:16,330 --> 00:39:20,320 In Section 4.1, there's a question for the Fourier series 605 00:39:20,320 --> 00:39:21,970 of a square pulse. 606 00:39:21,970 --> 00:39:24,900 OK, so what does the square pulse look like? 607 00:39:24,900 --> 00:39:29,090 Here's minus pi to pi. 608 00:39:29,090 --> 00:39:30,170 Here's zero. 609 00:39:30,170 --> 00:39:33,060 The square pulse goes along here, up, 610 00:39:33,060 --> 00:39:35,360 square pulse, and down. 611 00:39:35,360 --> 00:39:48,120 Actually, let me go to L/2, oh I'll just call it h. 612 00:39:48,120 --> 00:39:56,450 Let me find the Fourier series for this function. 613 00:39:56,450 --> 00:40:00,160 It goes along at 0, it jumps up to 1 614 00:40:00,160 --> 00:40:05,010 over a interval of length 2h, going from minus h to h, 615 00:40:05,010 --> 00:40:08,410 and then back down to 0 and then repeats. 616 00:40:08,410 --> 00:40:11,810 So bip bip bip, square pulse. 617 00:40:11,810 --> 00:40:14,200 So that's my function. 618 00:40:14,200 --> 00:40:18,860 Is that function odd, or even, or neither one? 619 00:40:18,860 --> 00:40:22,620 It's even, so I can call that C(x). 620 00:40:22,620 --> 00:40:27,480 And figure that I'm going to use cosines for that one, right? 621 00:40:27,480 --> 00:40:31,590 So tell me a formula for the coefficients, what's 622 00:40:31,590 --> 00:40:33,890 the integral that I have to do? 623 00:40:33,890 --> 00:40:39,210 So my C(x) is going to be some a_0, 624 00:40:39,210 --> 00:40:45,170 we have to think what's a_0, then a_1*cos(x), a_2*cos, 625 00:40:45,170 --> 00:40:46,540 and so on. 626 00:40:46,540 --> 00:40:48,700 So on. 627 00:40:48,700 --> 00:40:49,220 a_k*cos(kx). 628 00:40:49,220 --> 00:40:52,950 629 00:40:52,950 --> 00:41:01,090 OK, what's the formula for a_k? 630 00:41:01,090 --> 00:41:04,380 Before I plug in that function I would like to get the formula. 631 00:41:04,380 --> 00:41:07,350 So I'm looking for the formula. 632 00:41:07,350 --> 00:41:10,110 It's a formula to remember. 633 00:41:10,110 --> 00:41:11,912 So I'm not wasting your time. 634 00:41:11,912 --> 00:41:14,120 Because you're going to see it on the board and it'll 635 00:41:14,120 --> 00:41:16,580 just take a mental photograph of it. 636 00:41:16,580 --> 00:41:18,420 What do you think it's going to be? 637 00:41:18,420 --> 00:41:20,170 How am I going to get it? 638 00:41:20,170 --> 00:41:26,670 I'll multiply both sides of the equation by cos(kx), right? 639 00:41:26,670 --> 00:41:28,600 And I'll integrate. 640 00:41:28,600 --> 00:41:32,440 So and then when I integrate, the cosines are orthogonal. 641 00:41:32,440 --> 00:41:34,970 Just like the sines this morning. 642 00:41:34,970 --> 00:41:38,030 All those terms will go, except for this term. 643 00:41:38,030 --> 00:41:42,750 When I multiply this by cos(kx), I'll have cos(kx) squared. 644 00:41:42,750 --> 00:41:46,250 Here I'll have a cos(kx), and here I'll 645 00:41:46,250 --> 00:41:50,800 have a whole lot of cos(kx)'s but when I integrate, 646 00:41:50,800 --> 00:41:55,150 all this stuff is going to disappear. 647 00:41:55,150 --> 00:41:57,870 And this will all disappear. 648 00:41:57,870 --> 00:41:58,970 This is it. 649 00:41:58,970 --> 00:42:04,070 So a_k is going to be the integral of my function, 650 00:42:04,070 --> 00:42:07,740 times cos(kx) dx. 651 00:42:07,740 --> 00:42:09,010 Divided by what? 652 00:42:09,010 --> 00:42:14,170 Divided by the integral of cos(kx) squared. 653 00:42:14,170 --> 00:42:18,130 Because I haven't normalized things. 654 00:42:18,130 --> 00:42:21,620 So I don't know that that's one, and in fact it isn't one. 655 00:42:21,620 --> 00:42:25,040 So I have to remember to put that number in. 656 00:42:25,040 --> 00:42:28,030 OK, so that's the formula and that number 657 00:42:28,030 --> 00:42:32,310 turns out to be pi, again. 658 00:42:32,310 --> 00:42:36,830 If I'm integrating from minus pi to pi, 659 00:42:36,830 --> 00:42:40,150 then the average value of the cosine squared is a 1/2, 660 00:42:40,150 --> 00:42:44,450 it's sort of as much above 1/2 as it is below 1/2, 661 00:42:44,450 --> 00:42:51,500 and so the average is 1/2, the interval is 2pi, so pi. 662 00:42:51,500 --> 00:42:54,940 OK, that's the formula. 663 00:42:54,940 --> 00:42:59,600 Please just take a mental photograph. 664 00:42:59,600 --> 00:43:00,740 Catch that one. 665 00:43:00,740 --> 00:43:05,990 Alright, now I've got my particular C(x), 666 00:43:05,990 --> 00:43:10,340 my square wave, square pulse. 667 00:43:10,340 --> 00:43:11,760 Very, very important. 668 00:43:11,760 --> 00:43:16,160 Very important Fourier series here. 669 00:43:16,160 --> 00:43:18,210 Famous one. 670 00:43:18,210 --> 00:43:20,250 OK, so what do I have? 671 00:43:20,250 --> 00:43:24,560 From minus pi to pi, so what's my integral? 672 00:43:24,560 --> 00:43:28,370 Well, my integral really doesn't go from minus pi to pi 673 00:43:28,370 --> 00:43:31,430 because my function is mostly zero. 674 00:43:31,430 --> 00:43:34,330 Where does my integral go? 675 00:43:34,330 --> 00:43:36,950 Negative h to h, right? 676 00:43:36,950 --> 00:43:40,840 And in that region, what is C(x)? 677 00:43:40,840 --> 00:43:44,320 One. 678 00:43:44,320 --> 00:43:47,960 So you see it's going to be nice. 679 00:43:47,960 --> 00:43:52,180 From negative h to h, where this is one, 680 00:43:52,180 --> 00:43:55,630 I just have to integrate cos(kx), so what do I get? 681 00:43:55,630 --> 00:44:01,930 sin(kx), over k, and a pi. 682 00:44:01,930 --> 00:44:06,490 So you see again that that k is showing up in the denominator, 683 00:44:06,490 --> 00:44:13,650 and that's going to give me the typical decay rate of 1/k 684 00:44:13,650 --> 00:44:20,110 for functions with steps. 685 00:44:20,110 --> 00:44:21,480 For step functions. 686 00:44:21,480 --> 00:44:28,960 And now I have to evaluate this between minus pi and pi. 687 00:44:28,960 --> 00:44:30,200 And-- No, h. 688 00:44:30,200 --> 00:44:32,090 Better be h. 689 00:44:32,090 --> 00:44:35,090 I mean, minus h and h. 690 00:44:35,090 --> 00:44:37,830 So what do I get for that? 691 00:44:37,830 --> 00:44:42,140 I get sin(kh), right? 692 00:44:42,140 --> 00:44:48,520 At the top, and what do I get at minus? 693 00:44:48,520 --> 00:44:54,930 So I now I want to subtract, what is the sine of minus kh? 694 00:44:54,930 --> 00:44:57,360 It's negative, right? 695 00:44:57,360 --> 00:45:04,070 So as I expect with an even function like cosine, 696 00:45:04,070 --> 00:45:08,700 am I just getting twice? 697 00:45:08,700 --> 00:45:12,930 I could take it from 0 to h, and it would give me 698 00:45:12,930 --> 00:45:14,490 one of them and the other one. 699 00:45:14,490 --> 00:45:16,500 Yep, I think so, and divide by k*pi. 700 00:45:16,500 --> 00:45:21,390 701 00:45:21,390 --> 00:45:24,480 So those are the Fourier coefficients. 702 00:45:24,480 --> 00:45:27,060 Except for a_0. 703 00:45:27,060 --> 00:45:31,090 a_0 has a slightly different formula, 704 00:45:31,090 --> 00:45:34,850 because for a_0, why is a_0 different? 705 00:45:34,850 --> 00:45:39,170 How do you come up with a_0, and what's its meaning? 706 00:45:39,170 --> 00:45:44,940 a_0 has a nice meaning, so this is worth 707 00:45:44,940 --> 00:45:46,900 having come this afternoon for. 708 00:45:46,900 --> 00:45:50,900 a_0 will be what? 709 00:45:50,900 --> 00:45:52,610 Well, I could get it the same way. 710 00:45:52,610 --> 00:45:57,110 What will I multiply both sides by? 711 00:45:57,110 --> 00:46:00,200 If I want to pick off a_0? 712 00:46:00,200 --> 00:46:01,810 Just one. 713 00:46:01,810 --> 00:46:06,530 It's not a cosine, it's the cos(0x), it's the one. 714 00:46:06,530 --> 00:46:08,460 And then I integrate. 715 00:46:08,460 --> 00:46:11,350 I'm just going to get the integral 716 00:46:11,350 --> 00:46:15,970 from minus pi to pi of C(x) times 717 00:46:15,970 --> 00:46:19,796 one, divided by the integral from minus pi 718 00:46:19,796 --> 00:46:31,190 to pi of one times one. dx. 719 00:46:31,190 --> 00:46:33,190 Same method. 720 00:46:33,190 --> 00:46:39,170 Multiply both sides by one, which was the very first 721 00:46:39,170 --> 00:46:41,660 of my orthogonal functions. 722 00:46:41,660 --> 00:46:45,250 Integrate it, all the other integrals went away, right? 723 00:46:45,250 --> 00:46:48,900 The integral of cosine over a whole interval. 724 00:46:48,900 --> 00:46:51,000 It's periodic. 725 00:46:51,000 --> 00:46:52,630 You get the same at the two ends, 726 00:46:52,630 --> 00:46:56,620 so the difference is zero. 727 00:46:56,620 --> 00:47:00,230 So we just, the only term left was the constant. 728 00:47:00,230 --> 00:47:03,060 And now what is the integral, what's the denominator now? 729 00:47:03,060 --> 00:47:06,490 That was the little, slight twist. 730 00:47:06,490 --> 00:47:07,780 2pi. 731 00:47:07,780 --> 00:47:09,910 The denominator's 2pi. 732 00:47:09,910 --> 00:47:10,630 Yeah. 733 00:47:10,630 --> 00:47:15,490 That's that's why it's not, yeah, it's slightly irregular, 734 00:47:15,490 --> 00:47:18,010 I have to divide by 2pi. 735 00:47:18,010 --> 00:47:21,540 And now, what word would you use to describe, 736 00:47:21,540 --> 00:47:24,180 if I have a function, and integrate it, 737 00:47:24,180 --> 00:47:30,050 and I divide by the length, what am I getting? 738 00:47:30,050 --> 00:47:35,710 There's an English word that would describe what this is. 739 00:47:35,710 --> 00:47:37,780 Average. 740 00:47:37,780 --> 00:47:44,880 This is the average. 741 00:47:44,880 --> 00:47:46,530 And it has to be. 742 00:47:46,530 --> 00:47:49,490 This constant term is always the average. 743 00:47:49,490 --> 00:47:52,060 And what will it be for this? 744 00:47:52,060 --> 00:47:59,130 So this was a_k, and what is a_0, then? 745 00:47:59,130 --> 00:48:02,430 So you can now tell me, so everybody's 746 00:48:02,430 --> 00:48:05,090 remembering this formula, you integrate the function 747 00:48:05,090 --> 00:48:07,980 and divide by the 2pi. 748 00:48:07,980 --> 00:48:10,070 Now we've got a particular function, 749 00:48:10,070 --> 00:48:12,220 so what is the integral of that function? 750 00:48:12,220 --> 00:48:16,210 So what does this equal? 751 00:48:16,210 --> 00:48:18,180 For this particular C(x)? 752 00:48:18,180 --> 00:48:22,210 What's the area under that function C(x)? 753 00:48:22,210 --> 00:48:24,780 2h. 754 00:48:24,780 --> 00:48:26,040 Right? 755 00:48:26,040 --> 00:48:29,070 So 2h/(2pi), cancel the twos. 756 00:48:29,070 --> 00:48:34,060 So there's a constant term, a_0 is h/pi 757 00:48:34,060 --> 00:48:42,130 and the cosine terms are-- yeah, actually 758 00:48:42,130 --> 00:48:43,680 we're going to get something nice. 759 00:48:43,680 --> 00:48:47,610 A really nice way to complete this 760 00:48:47,610 --> 00:48:55,220 will be if I put this together, put this series together. 761 00:48:55,220 --> 00:49:05,960 So now I'm saying that this square pulse is that constant 762 00:49:05,960 --> 00:49:12,820 term h/pi plus the next term a_1, 763 00:49:12,820 --> 00:49:17,990 you can see all these terms have 2/pi's. 764 00:49:17,990 --> 00:49:20,660 I'm a little surprised that h over-- Yeah, no, I 765 00:49:20,660 --> 00:49:21,710 guess it's right. 766 00:49:21,710 --> 00:49:29,170 2/pi, yeah, right? 767 00:49:29,170 --> 00:49:33,700 So I've got sin(h), I think. 768 00:49:33,700 --> 00:49:35,380 And now I'm just copying this. 769 00:49:35,380 --> 00:49:47,030 2/pi*sin(h), sin(h), is that what I want? 770 00:49:47,030 --> 00:49:51,500 Over one. 771 00:49:51,500 --> 00:49:54,810 That's the coefficient of sine, of cos(x). 772 00:49:54,810 --> 00:49:58,060 773 00:49:58,060 --> 00:50:01,550 a_1 was the coefficient of cos(1x). 774 00:50:01,550 --> 00:50:06,160 And then a_2 is the coefficient of cos(2x). 775 00:50:06,160 --> 00:50:10,870 So that will be sin(2h). k is two, 776 00:50:10,870 --> 00:50:14,770 so I have a two down here, cos(2x). 777 00:50:14,770 --> 00:50:20,470 And so on. 778 00:50:20,470 --> 00:50:23,840 Yeah, I think that's the Fourier series. 779 00:50:23,840 --> 00:50:33,240 That would be the Fourier series for the square pulse. 780 00:50:33,240 --> 00:50:34,350 Yeah. 781 00:50:34,350 --> 00:50:38,200 That would be the Fourier series for the square pulse. 782 00:50:38,200 --> 00:50:40,470 Could I test any interesting cases? 783 00:50:40,470 --> 00:50:45,350 Suppose h is all the way out to pi. 784 00:50:45,350 --> 00:50:46,990 Suppose I take that case. 785 00:50:46,990 --> 00:50:55,190 Let h go all the way out to pi, then what's my function? 786 00:50:55,190 --> 00:51:01,080 If h=pi, then what have I got a graph of? 787 00:51:01,080 --> 00:51:02,160 Just one. 788 00:51:02,160 --> 00:51:03,530 It's just a one. 789 00:51:03,530 --> 00:51:07,110 If h is pi, what happens? 790 00:51:07,110 --> 00:51:11,760 That becomes a one, and what about these other things? 791 00:51:11,760 --> 00:51:15,030 What is this thing when h is pi? 792 00:51:15,030 --> 00:51:15,620 Zero. 793 00:51:15,620 --> 00:51:18,470 All the other terms go away. 794 00:51:18,470 --> 00:51:22,230 It's just a sin(2pi) that would go away. 795 00:51:22,230 --> 00:51:27,470 Yeah, so if h is pi, if I go out to the place where I don't have 796 00:51:27,470 --> 00:51:33,200 any jumps at all because it's now all the way out there, 797 00:51:33,200 --> 00:51:37,410 then these terms all disappear and I just have this. 798 00:51:37,410 --> 00:51:39,960 And I would like to ask you and it's 799 00:51:39,960 --> 00:51:47,850 going to come up on Friday too, what happens if h goes to zero? 800 00:51:47,850 --> 00:51:50,570 Well, let me just take h going to zero. 801 00:51:50,570 --> 00:51:52,140 What happens to this whole thing? 802 00:51:52,140 --> 00:51:55,920 What happens to my function as h goes to zero? 803 00:51:55,920 --> 00:51:58,890 Goes to zero, right, we've squeezed it to nothing. 804 00:51:58,890 --> 00:52:04,780 And if h is zero then sin(h) is zero, I get 0=0, 805 00:52:04,780 --> 00:52:09,780 that's not interesting enough to mention on Friday. 806 00:52:09,780 --> 00:52:13,960 But there is one case that is important. 807 00:52:13,960 --> 00:52:16,600 Suppose I make the height, yeah. 808 00:52:16,600 --> 00:52:17,600 Make a guess. 809 00:52:17,600 --> 00:52:27,680 Suppose I make the height higher as I make the base smaller. 810 00:52:27,680 --> 00:52:29,410 I'm going to keep the area as one, 811 00:52:29,410 --> 00:52:33,640 so if this has a base of 2h, I'm going to have a height 812 00:52:33,640 --> 00:52:39,070 of 1/(2h), So if I keep the area at one, 813 00:52:39,070 --> 00:52:43,910 so the height now is 1/(2h), so now my square pulse, 814 00:52:43,910 --> 00:52:46,430 I've divided it by 2h. 815 00:52:46,430 --> 00:52:50,980 I have a 1/(2h) multiplying everything. 816 00:52:50,980 --> 00:52:56,820 And now if I let h go to zero, something more interesting 817 00:52:56,820 --> 00:52:58,320 will happen. 818 00:52:58,320 --> 00:52:59,570 And what? 819 00:52:59,570 --> 00:53:05,370 Just tell me first, what would you expect to happen? 820 00:53:05,370 --> 00:53:05,980 Delta. 821 00:53:05,980 --> 00:53:08,310 Right, delta. 822 00:53:08,310 --> 00:53:12,500 So what I'll see show up will be the Fourier series 823 00:53:12,500 --> 00:53:15,180 for the delta function. 824 00:53:15,180 --> 00:53:22,300 When I divide by 2h, so I have sin(h)'s over 825 00:53:22,300 --> 00:53:27,840 h's, and of course what's the great fact about sin(h)/h? 826 00:53:27,840 --> 00:53:33,440 As h goes to zero, it goes to, everybody 827 00:53:33,440 --> 00:53:36,170 know what, that's the big deal. 828 00:53:36,170 --> 00:53:36,880 Yeah. 829 00:53:36,880 --> 00:53:43,030 One. sin(h) is the same size as h for a very small h, 830 00:53:43,030 --> 00:53:44,780 and approaches one. 831 00:53:44,780 --> 00:53:49,380 Yeah so we'll see the delta function Friday. 832 00:53:49,380 --> 00:53:52,470 OK, so you've got a sort of mini-lecture 833 00:53:52,470 --> 00:53:56,410 instead of a real chance to ask about homework. 834 00:53:56,410 --> 00:53:58,090 Next Wednesday should be different 835 00:53:58,090 --> 00:54:01,010 because there will be Fourier series homework, 836 00:54:01,010 --> 00:54:05,570 and I'll be ready to answer questions about it. 837 00:54:05,570 --> 00:54:07,340 OK, thanks.