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