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:02 --> 00:00:03 Commons license. 4 00:00:03 --> 00:00:06 Your support will help MIT OpenCourseWare continue to 5 00:00:06 --> 00:00:10 offer high-quality educational resources for free. 6 00:00:10 --> 00:00:12 To make a donation, or to view additional materials from 7 00:00:12 --> 00:00:16 hundreds of MIT courses, visit MIT OpenCourseWare 8 00:00:16 --> 00:00:19 at ocw.mit.edu. 9 00:00:19 --> 00:00:21 PROFESSOR STRANG: So. 10 00:00:21 --> 00:00:27 Today's lecture is partly cleaning up some pieces 11 00:00:27 --> 00:00:31 left from 1-D problems. 12 00:00:31 --> 00:00:36 3.1 was second order equations, 3.2 was fourth order 13 00:00:36 --> 00:00:38 equation for beams. 14 00:00:38 --> 00:00:41 And just a few more comments to make. 15 00:00:41 --> 00:00:51 But then I do want to say something about splines. 16 00:00:51 --> 00:00:55 And I included a homework question that asked you to 17 00:00:55 --> 00:00:59 use the spline command and get a result. 18 00:00:59 --> 00:01:07 I'm not planning to make that a serious topic in the course. 19 00:01:07 --> 00:01:10 In other words, you're not like going to be responsible on an 20 00:01:10 --> 00:01:14 exam for a discussion of splines. 21 00:01:14 --> 00:01:21 But it's such a major event, and major requirement in 22 00:01:21 --> 00:01:25 scientific computing -- if you're given some values, put a 23 00:01:25 --> 00:01:28 curve through them -- that I have to say something 24 00:01:28 --> 00:01:28 about that. 25 00:01:28 --> 00:01:31 So that's interpolation. 26 00:01:31 --> 00:01:34 Because you'll have this all the time. 27 00:01:34 --> 00:01:41 If your experiment produces some values at specific times 28 00:01:41 --> 00:01:46 or a finite number of values, and you want to fit a curve 29 00:01:46 --> 00:01:46 through those points. 30 00:01:46 --> 00:01:48 How do you do it? 31 00:01:48 --> 00:01:51 So splines give a very, very good answer. 32 00:01:51 --> 00:02:02 And then, the next and big topic of the course we'll 33 00:02:02 --> 00:02:04 make a beginning on. 34 00:02:04 --> 00:02:09 Which is gradient, divergence, leading to Laplace's equation. 35 00:02:09 --> 00:02:10 Problems in 2-D. 36 00:02:12 --> 00:02:15 So partial differential equations are going to show up. 37 00:02:15 --> 00:02:19 OK. 38 00:02:19 --> 00:02:20 Some small points. 39 00:02:20 --> 00:02:27 First point, about the MATLAB homework for Monday. 40 00:02:27 --> 00:02:34 A question came by email. 41 00:02:34 --> 00:02:43 I put the spike and also the jump in c in the coefficient, 42 00:02:43 --> 00:02:45 not at mesh point. 43 00:02:45 --> 00:02:48 If you've started on that problem, you probably noticed 44 00:02:48 --> 00:02:55 that, and maybe a little swearing went on. 45 00:02:55 --> 00:02:57 [LAUGHTER] 46 00:02:57 --> 00:03:01 Because it makes it not so easy. 47 00:03:01 --> 00:03:07 And then the question came, did I really expect you to compute, 48 00:03:07 --> 00:03:13 use the exact position and figure out, when you have some 49 00:03:13 --> 00:03:18 integrals to do, they'll change at the place where 50 00:03:18 --> 00:03:20 c changes values. 51 00:03:20 --> 00:03:24 Where we have integrals of c, if c has one of those jumps, on 52 00:03:24 --> 00:03:29 the quiz the jump came right at a neat point, so it was clear. 53 00:03:29 --> 00:03:32 c was one on one side and two on the other. 54 00:03:32 --> 00:03:36 Now the jump is going to come at an in-between point. 55 00:03:36 --> 00:03:42 So the answer is yes. 56 00:03:42 --> 00:03:45 I had a nice email this morning from somebody who has done 57 00:03:45 --> 00:03:48 that MATLAB homework. 58 00:03:48 --> 00:03:55 And he said, quote, it's a good problem. 59 00:03:55 --> 00:03:58 I learned more from it than I did from the other 60 00:03:58 --> 00:03:59 problems in the pset. 61 00:04:00 --> 00:04:06 So I'll blame it on him. 62 00:04:06 --> 00:04:10 I'll stay with that problem, and ask you to do your best to 63 00:04:10 --> 00:04:14 deal with the calculation. 64 00:04:14 --> 00:04:17 It's second order and I used linear elements. 65 00:04:17 --> 00:04:20 I didn't want to push you up to these cubic elements, even 66 00:04:20 --> 00:04:24 though those would give much better accuracy. 67 00:04:24 --> 00:04:30 One reason I didn't put the spike and the jump right at the 68 00:04:30 --> 00:04:36 node is that, if I did, the finite element solution 69 00:04:36 --> 00:04:38 would be exactly right. 70 00:04:38 --> 00:04:43 Because the correct solution is going to be piecewise linear. 71 00:04:43 --> 00:04:49 And if I put the breaks between pieces right at node points, 72 00:04:49 --> 00:04:53 well, then I have a function that's in my finite element 73 00:04:53 --> 00:04:55 space, in my linear space. 74 00:04:55 --> 00:04:57 So it'll come out exactly. 75 00:04:57 --> 00:05:01 So I thought well, let's at least have some chance to 76 00:05:01 --> 00:05:06 see the error between the finite element solution 77 00:05:06 --> 00:05:07 and the exact one. 78 00:05:07 --> 00:05:08 You see what I'm saying? 79 00:05:08 --> 00:05:13 I'm just anticipating, that the exact solution 80 00:05:13 --> 00:05:14 will -- let's see. 81 00:05:14 --> 00:05:18 Something happened at 1/3 and something happened at 2/3. 82 00:05:18 --> 00:05:21 I'm afraid I don't remember the boundary conditions. 83 00:05:21 --> 00:05:24 Does anybody remember what I took for boundary conditions? 84 00:05:24 --> 00:05:27 Probably free fixed, or something. 85 00:05:27 --> 00:05:33 So maybe, if it was free fixed, probably the solution would 86 00:05:33 --> 00:05:35 be maybe something like that. 87 00:05:35 --> 00:05:36 I don't know. 88 00:05:36 --> 00:05:38 Whatever. 89 00:05:38 --> 00:05:42 Piecewise linear with breaks, where there's a jump in c, 90 00:05:42 --> 00:05:46 or where the point load is hitting. 91 00:05:46 --> 00:05:48 Yeah. 92 00:05:48 --> 00:05:50 I don't know if that picture is accurate. 93 00:05:50 --> 00:05:56 But my point was, if I chose those points to be also mesh 94 00:05:56 --> 00:06:00 points, then the finite element solution would be exact, and we 95 00:06:00 --> 00:06:03 wouldn't learn anything about accuracy. 96 00:06:03 --> 00:06:04 OK. 97 00:06:04 --> 00:06:12 So anyway, for that MATLAB problem, I'm hoping you can do 98 00:06:12 --> 00:06:19 the integrals, which will mean noticing which integral -- if 99 00:06:19 --> 00:06:26 that doesn't fall, so if the mesh points are like this, in 100 00:06:26 --> 00:06:30 the finite element integral over that mesh, over that 101 00:06:30 --> 00:06:34 interval, you're going to have to split it into two pieces. 102 00:06:34 --> 00:06:36 That's it. 103 00:06:36 --> 00:06:39 So see if you can do that split, do the split 104 00:06:39 --> 00:06:41 into two pieces. 105 00:06:41 --> 00:06:41 OK. 106 00:06:41 --> 00:06:46 So that's a comment on that homework. 107 00:06:46 --> 00:06:47 OK. 108 00:06:47 --> 00:06:50 What else do I need to comment on, when I'm sort 109 00:06:50 --> 00:06:51 of catching up here? 110 00:06:51 --> 00:06:55 Oh, about boundary conditions. 111 00:06:55 --> 00:07:02 I thought I would just repeat clearly on the board the rules 112 00:07:02 --> 00:07:08 about and the difference between fixed and free when 113 00:07:08 --> 00:07:17 we're doing this weak form approach to the problem. 114 00:07:17 --> 00:07:22 And then I gave the other names: a fixed condition, in 115 00:07:22 --> 00:07:25 this theory it's often called an essential boundary 116 00:07:25 --> 00:07:31 condition, but many people just name Dirichlet as the person's 117 00:07:31 --> 00:07:34 name that's associated with such conditions. 118 00:07:34 --> 00:07:35 Like u(0)=0. 119 00:07:37 --> 00:07:39 Right, fixed. 120 00:07:39 --> 00:07:43 And then free conditions are natural conditions in the 121 00:07:43 --> 00:07:46 finite element method, and that means that we don't 122 00:07:46 --> 00:07:48 have to impose them. 123 00:07:48 --> 00:07:49 Right. 124 00:07:49 --> 00:07:51 I discussed this in the earlier lecture. 125 00:07:51 --> 00:07:57 I just thought I'd bring it back here, because it's easy 126 00:07:57 --> 00:07:59 to describe in one lie. 127 00:07:59 --> 00:08:09 Now somebody asked, on Wednesday, a good question. 128 00:08:09 --> 00:08:17 Suppose u' is given, but not given as zero. 129 00:08:17 --> 00:08:28 So suppose we have a condition like u'=A, let's say. 130 00:08:28 --> 00:08:30 What to do? 131 00:08:30 --> 00:08:32 So I'll just put question mark. 132 00:08:32 --> 00:08:39 How do I deal with -- how do I? -- how does the weak form 133 00:08:39 --> 00:08:42 approach and the Galerkin approach deal with a 134 00:08:42 --> 00:08:47 non-zero, natural condition? 135 00:08:47 --> 00:08:52 A nonzero Neumann condition, that'd be the right word. 136 00:08:52 --> 00:08:56 So this would be, in a second order problem, this would 137 00:08:56 --> 00:08:59 be a Neumann condition. 138 00:08:59 --> 00:09:02 And I'm thinking, what do you do if A isn't zero. 139 00:09:02 --> 00:09:06 Somehow that has to show up in your finite element 140 00:09:06 --> 00:09:07 equations, right? 141 00:09:07 --> 00:09:11 So I guess the right way is to go back to the 142 00:09:11 --> 00:09:12 way they came from. 143 00:09:12 --> 00:09:15 So you remember how the weak form came? 144 00:09:15 --> 00:09:19 I took the differential equation, I multiplied by 145 00:09:19 --> 00:09:23 any test function, and I integrated by parts. 146 00:09:23 --> 00:09:25 That's where the weak form started. 147 00:09:25 --> 00:09:32 So the integration by parts gave me this nice 148 00:09:32 --> 00:09:38 symmetric integral. 149 00:09:38 --> 00:09:40 It's symmetric in u and v. 150 00:09:40 --> 00:09:45 It only requires one derivative of u, so that I'm allowed 151 00:09:45 --> 00:09:48 to use hat functions. 152 00:09:48 --> 00:09:52 And I'm allowed to use hat functions for v, because their 153 00:09:52 --> 00:09:56 derivatives have just a jump, and a jump function I can 154 00:09:56 --> 00:09:58 integrate, no problem. 155 00:09:58 --> 00:10:02 Now what about this u'=A? 156 00:10:04 --> 00:10:08 And I guess we're seeing it there. 157 00:10:08 --> 00:10:14 If u' was zero, if we had a totally free end, u' was zero, 158 00:10:14 --> 00:10:19 nothing happening there, then that term would drop out of 159 00:10:19 --> 00:10:21 the integration by parts. 160 00:10:21 --> 00:10:25 And you see why I don't have to impose anything on v, because 161 00:10:25 --> 00:10:31 that term is already accounted for by the u' going away. 162 00:10:31 --> 00:10:38 Now, what about if u' is given, but not given zero? 163 00:10:38 --> 00:10:40 Suppose it's giving the value A. 164 00:10:40 --> 00:10:51 All I want to say is, then this term has to stay. 165 00:10:51 --> 00:10:52 I have to pay attention to it. 166 00:10:52 --> 00:10:56 What what happens when Galerkin takes over? 167 00:10:56 --> 00:11:02 Galerkin will put in one of his test functions. 168 00:11:02 --> 00:11:06 Maybe I just indicate that by changing the v to a cap V. 169 00:11:06 --> 00:11:08 It'll be one of them. 170 00:11:08 --> 00:11:11 There'll be n of them. 171 00:11:11 --> 00:11:16 Each V_i, each test guy gives me an equation. 172 00:11:16 --> 00:11:21 And of course u is now going to -- the Galerkin idea is 173 00:11:21 --> 00:11:25 that instead of any u, I only have capital U's. 174 00:11:25 --> 00:11:32 Combinations of these phis. 175 00:11:32 --> 00:11:37 I'm not going to say anything very big here, or very clear. 176 00:11:37 --> 00:11:46 All I want to say is that if u prime is given at an end point, 177 00:11:46 --> 00:11:56 and given by A, then this whole stuff is equalling something 178 00:11:56 --> 00:11:57 with an f, right? f*V_i*dx. 179 00:12:00 --> 00:12:03 I should remember the other side of the equation. 180 00:12:03 --> 00:12:08 If u' is given, then c at that end point, times the given 181 00:12:08 --> 00:12:16 value of A, times the V will be -- whatever value of V that is 182 00:12:16 --> 00:12:22 -- will show up in equation i. 183 00:12:22 --> 00:12:25 That will be a term that goes on the right hand side. 184 00:12:25 --> 00:12:29 That's all I'm saying, and all you would expect. 185 00:12:29 --> 00:12:37 That any time I'm given some data, I'm given some non-zero 186 00:12:37 --> 00:12:41 boundary conditions, or I'm given some non-zero f in the 187 00:12:41 --> 00:12:49 inside, that stuff is going to show up on the right hand side. 188 00:12:49 --> 00:12:53 It'll show up as part of the f. 189 00:12:53 --> 00:12:58 The vector of these. 190 00:12:58 --> 00:13:02 So up to now, f has just come from little f(x), 191 00:13:02 --> 00:13:04 integrated against V. 192 00:13:04 --> 00:13:10 And all I'm saying is that if we had one of these guys, then 193 00:13:10 --> 00:13:16 that would contribute to big F, also. 194 00:13:16 --> 00:13:17 Yeah. 195 00:13:17 --> 00:13:22 You can see, it's not beautiful. 196 00:13:22 --> 00:13:25 But we have to realize what we would do. 197 00:13:25 --> 00:13:28 OK, that's not my favorite topic. 198 00:13:28 --> 00:13:32 But I'll just say quit on that one. 199 00:13:32 --> 00:13:39 I'm not expecting you to do problems or anything that 200 00:13:39 --> 00:13:40 involved that possibility. 201 00:13:40 --> 00:13:42 Just to see that it could happen. 202 00:13:42 --> 00:13:44 OK. 203 00:13:44 --> 00:13:45 Quit. 204 00:13:45 --> 00:13:47 Now, interpolation. 205 00:13:47 --> 00:13:49 All right. 206 00:13:49 --> 00:13:55 So I guess if I had to list problems that people face all 207 00:13:55 --> 00:13:59 the time and need numerical guidance on, this 208 00:13:59 --> 00:14:01 is one of them. 209 00:14:01 --> 00:14:07 And so let's say we're in 1-D -- 1-D is certainly a lot 210 00:14:07 --> 00:14:11 easier -- so suppose I have this. 211 00:14:11 --> 00:14:15 I'll call this x, just to have a name for the variable. 212 00:14:15 --> 00:14:21 Suppose I have some values. 213 00:14:21 --> 00:14:28 Say six values. 214 00:14:28 --> 00:14:30 And I've measured them, I've worked hard to 215 00:14:30 --> 00:14:32 find those six values. 216 00:14:32 --> 00:14:37 But now you may say, well I'm thinking I have some 217 00:14:37 --> 00:14:43 function F(x) here. 218 00:14:43 --> 00:14:45 But right now I don't have a function. 219 00:14:45 --> 00:14:48 Right now I just have six values of that function. 220 00:14:48 --> 00:14:52 You know, what is the stretching constant, 221 00:14:52 --> 00:14:55 what is the c(x). 222 00:14:55 --> 00:14:57 223 00:14:57 --> 00:15:05 If you had a physical experiment with an actual 224 00:15:05 --> 00:15:09 spring, you might measure, you might put on different forces 225 00:15:09 --> 00:15:15 and measure the stretching, and have six values of that. 226 00:15:15 --> 00:15:18 How do I fit those with a curve? 227 00:15:18 --> 00:15:23 In other words, how do I know -- interpolation means, inter- 228 00:15:23 --> 00:15:29 means asking, what about between the points? 229 00:15:29 --> 00:15:32 What value should it have there? 230 00:15:32 --> 00:15:38 OK, well there's one simple rule would be, just 231 00:15:38 --> 00:15:43 interpolate linearly between. 232 00:15:43 --> 00:15:46 OK. 233 00:15:46 --> 00:15:49 That's certainly pretty stable. 234 00:15:49 --> 00:15:51 It will not get out of control. 235 00:15:51 --> 00:16:00 But it's not very accurate. 236 00:16:00 --> 00:16:03 For the function that's probably lying behind this, 237 00:16:03 --> 00:16:07 this isn't that great of a representation. 238 00:16:07 --> 00:16:10 OK, you say, I want something smoother. 239 00:16:10 --> 00:16:19 Well another idea that naturally comes up is, the 240 00:16:19 --> 00:16:24 other extreme would be -- so that was completely local. 241 00:16:24 --> 00:16:28 Just, every two values determine the broken line. 242 00:16:28 --> 00:16:31 The second idea that's completely natural would 243 00:16:31 --> 00:16:34 be, fit a polynomial. 244 00:16:34 --> 00:16:36 Fit a polynomial through those points, and then you have a 245 00:16:36 --> 00:16:39 nice, totally simple function. 246 00:16:39 --> 00:16:41 Nice curve. 247 00:16:41 --> 00:16:46 And so what degree polynomial would we be looking for here? 248 00:16:46 --> 00:16:51 If I have six points, I could fit a polynomial of degree 249 00:16:51 --> 00:16:54 -- what do you think? 250 00:16:54 --> 00:16:59 I want to have six coefficients, so I can get 251 00:16:59 --> 00:17:02 six equations to make the polynomial go through 252 00:17:02 --> 00:17:03 those six points. 253 00:17:03 --> 00:17:09 So my polynomial P(x), which actually goes through those 254 00:17:09 --> 00:17:11 points, would be some polynomial of the form, it's 255 00:17:11 --> 00:17:15 got some constant term, and it's got some linear term. 256 00:17:15 --> 00:17:19 And how far am I going to go? 257 00:17:19 --> 00:17:19 Fifth, right. 258 00:17:19 --> 00:17:22 That'll give me six coefficients. 259 00:17:22 --> 00:17:22 OK. 260 00:17:22 --> 00:17:26 So I could put a fifth degree polynomial, that gives 261 00:17:26 --> 00:17:27 me a_0, a_1, up to a_5. 262 00:17:29 --> 00:17:33 Six coefficients through six points. 263 00:17:33 --> 00:17:36 Well, six isn't too bad. 264 00:17:36 --> 00:17:44 But if six became 60, don't do it. 265 00:17:44 --> 00:17:45 That's the message. 266 00:17:45 --> 00:17:47 Don't do it. 267 00:17:47 --> 00:17:55 If I'm going on up to, say I have an a 59x to the 59th, 268 00:17:55 --> 00:17:58 And that fits my 60 points. 269 00:17:58 --> 00:18:01 And you say, well look, I've got 60 values, that should 270 00:18:01 --> 00:18:04 be way better than having only six. 271 00:18:04 --> 00:18:09 But the polynomial that would come out of that, even if these 272 00:18:09 --> 00:18:16 values were pretty smooth, the polynomial that fits -- well 273 00:18:16 --> 00:18:19 I'd have to put in a whole lot more to get 60, and I won't try 274 00:18:19 --> 00:18:26 -- the polynomial would go crazy. 275 00:18:26 --> 00:18:28 Can I just draw something crazy? 276 00:18:28 --> 00:18:31 I mean, whatever. 277 00:18:31 --> 00:18:34 It's unstable. 278 00:18:34 --> 00:18:37 And there are classical examples of that. 279 00:18:37 --> 00:18:41 In fact, the famous example is the function one over 280 00:18:41 --> 00:18:44 one plus x squared. 281 00:18:44 --> 00:18:48 And later, there's a figure in the book, I think it's in 282 00:18:48 --> 00:18:56 section 5.4, which shows the result. 283 00:18:56 --> 00:19:00 That's a terrific function. 284 00:19:00 --> 00:19:04 It's infinitely differentialable, I would even 285 00:19:04 --> 00:19:06 call it an analytic function. 286 00:19:06 --> 00:19:07 It's great. 287 00:19:07 --> 00:19:13 But if I tried to fit it with a high degree polynomial at 288 00:19:13 --> 00:19:18 points, that polynomial gets out of hand. 289 00:19:18 --> 00:19:22 And a figure is-- a figure there. 290 00:19:22 --> 00:19:37 So, MATLAB or any computing system would have a subroutine 291 00:19:37 --> 00:19:39 that does interpolation. 292 00:19:39 --> 00:19:43 And this is named after Legrange. 293 00:19:43 --> 00:19:47 So this is called Legrange interpolation, fitting a 294 00:19:47 --> 00:19:53 polynomial. and if the degree is small, and maybe degree five 295 00:19:53 --> 00:19:58 would be okay, then that's an important thing to 296 00:19:58 --> 00:20:02 be able to do. 297 00:20:02 --> 00:20:05 In other words, you're finding these six coefficients 298 00:20:05 --> 00:20:06 from these six heights. 299 00:20:06 --> 00:20:10 You've got some six by six matrix that connects the six 300 00:20:10 --> 00:20:13 heights to the six a's. 301 00:20:13 --> 00:20:18 But when you get up to 60, that matrix stops behaving well. 302 00:20:18 --> 00:20:22 It becomes very ill conditioned, and your 303 00:20:22 --> 00:20:25 coefficients go all over the place. 304 00:20:25 --> 00:20:29 OK, so my question is, what do you do? 305 00:20:29 --> 00:20:36 And one answer, one good answer is fit those points, not with 306 00:20:36 --> 00:20:40 straight lines -- that's too crude -- not with a single 307 00:20:40 --> 00:20:44 polynomial -- that's too unstable -- but fit 308 00:20:44 --> 00:20:45 it with splines. 309 00:20:45 --> 00:20:50 So interpolation by splines. 310 00:20:50 --> 00:20:51 OK. 311 00:20:51 --> 00:21:04 So it's just sort of appearing in this section 3.2 -- I mean 312 00:21:04 --> 00:21:09 by that, and people often do mean, when they say spline, 313 00:21:09 --> 00:21:13 they mean cubic spline. 314 00:21:13 --> 00:21:18 So you could have splines of other degrees. 315 00:21:18 --> 00:21:22 But often, sort of the natural choice is the cubic. 316 00:21:22 --> 00:21:27 So can I just briefly describe what that does. 317 00:21:27 --> 00:21:32 What the cubic spline would be like. 318 00:21:32 --> 00:21:35 So let me draw in again these six points that 319 00:21:35 --> 00:21:38 I'm going to fit. 320 00:21:38 --> 00:21:46 And just say, for these few minutes, what's a cubic spline. 321 00:21:46 --> 00:21:49 I touched on that Wednesday, and now I just want to 322 00:21:49 --> 00:21:51 say a little bit more. 323 00:21:51 --> 00:22:00 And then the homework asked you to actually do it with values 324 00:22:00 --> 00:22:02 of a particular function. 325 00:22:02 --> 00:22:05 And see how close does the cubic spline come 326 00:22:05 --> 00:22:09 to the given function. 327 00:22:09 --> 00:22:12 OK, so what's a cubic spline? 328 00:22:12 --> 00:22:14 What does that word, spline, what should 329 00:22:14 --> 00:22:16 that mean in your mind? 330 00:22:16 --> 00:22:22 So a cubic spline is a cubic in each piece. 331 00:22:22 --> 00:22:24 A cubic in each piece. 332 00:22:24 --> 00:22:29 Now we've met cubics in each piece as finite elements. 333 00:22:29 --> 00:22:34 And part of this short discussion is to keep those 334 00:22:34 --> 00:22:39 two slightly different ideas separate. 335 00:22:39 --> 00:22:47 The finite element idea was also piecewise cubic. 336 00:22:47 --> 00:22:50 But it used values and slopes. 337 00:22:50 --> 00:22:52 So it was completely local. 338 00:22:52 --> 00:22:57 If I had a value, as I have here, six values, and if I also 339 00:22:57 --> 00:23:04 had six slopes, if I knew the slopes, then I would use 340 00:23:04 --> 00:23:06 those cubic elements. 341 00:23:06 --> 00:23:13 And I would fit A -- if I knew the height and slope there, and 342 00:23:13 --> 00:23:15 I knew the height and slope there, there would be 343 00:23:15 --> 00:23:16 exactly one cubic. 344 00:23:16 --> 00:23:20 Because I would have four conditions, two conditions 345 00:23:20 --> 00:23:22 there, two conditions there, would be four. 346 00:23:22 --> 00:23:25 I could fit a cubic between, another cubic there, 347 00:23:25 --> 00:23:27 another cubic there. 348 00:23:27 --> 00:23:32 And because I'm using the same slope from the left and from 349 00:23:32 --> 00:23:35 the right, the slope would be good. 350 00:23:35 --> 00:23:37 It would be continuous. 351 00:23:37 --> 00:23:42 The second derivative, the curvature, would not be 352 00:23:42 --> 00:23:46 continuous with those cubic elements. 353 00:23:46 --> 00:23:47 And that's the difference. 354 00:23:47 --> 00:23:54 So the difference is, splines have continuous, no jump -- 355 00:23:54 --> 00:23:56 let me just put it this way. 356 00:23:56 --> 00:24:03 No jump in the function. 357 00:24:03 --> 00:24:05 I'll use S, maybe, for spline. 358 00:24:05 --> 00:24:09 No jump in its slope. 359 00:24:09 --> 00:24:12 And no jump in the second derivative. 360 00:24:12 --> 00:24:14 So that's the difference. 361 00:24:14 --> 00:24:21 That the spline functions, the only jumps you see 362 00:24:21 --> 00:24:26 for those are jumps in the third derivative. 363 00:24:26 --> 00:24:29 So that makes this extremely smooth. 364 00:24:29 --> 00:24:33 So if I just try to draw now what a spline would do, it'll 365 00:24:33 --> 00:24:36 go through those points, coming out of the spline 366 00:24:36 --> 00:24:39 fit MATLAB command. 367 00:24:39 --> 00:24:45 And it'll be as smooth as I drew it. 368 00:24:45 --> 00:24:53 There is a change in the third derivative at these points. 369 00:24:53 --> 00:24:58 Actually, have you ever seen this word, "spline," before? 370 00:24:58 --> 00:25:05 It came out of naval engineering. 371 00:25:05 --> 00:25:15 When people were designing the shape of the ship. 372 00:25:15 --> 00:25:22 A naval architect is fitting the proposed shape of a ship 373 00:25:22 --> 00:25:30 -- this was before MATLAB, before life started. 374 00:25:30 --> 00:25:32 [LAUGHTER] 375 00:25:32 --> 00:25:42 They had little physical, slightly bendable -- 376 00:25:42 --> 00:25:43 I'll call them splines. 377 00:25:43 --> 00:25:44 I guess that's what they were. 378 00:25:44 --> 00:25:46 That's where the word came from. 379 00:25:46 --> 00:25:50 Some physical thing which was like a curve that you use -- I 380 00:25:50 --> 00:25:54 don't know if you guys ever did mechanical drawing. 381 00:25:54 --> 00:25:58 That was a freshman subject when I came to MIT. 382 00:25:58 --> 00:25:59 Mechanical drawing. 383 00:25:59 --> 00:26:04 I was terrible, terrible, at mechanical drawing. 384 00:26:04 --> 00:26:06 I don't know. 385 00:26:06 --> 00:26:13 I had a friend who helped. l probably helped him 386 00:26:13 --> 00:26:14 in some other course. 387 00:26:14 --> 00:26:16 Anyway, whatever. 388 00:26:16 --> 00:26:20 So there were physical things, curves you used to use. 389 00:26:20 --> 00:26:23 And these spline curves were used, and maybe still are 390 00:26:23 --> 00:26:29 used, by naval architects in creating a drawing. 391 00:26:29 --> 00:26:33 But I'm assuming that those things are now all 392 00:26:33 --> 00:26:37 computerized, and the spline command is used. 393 00:26:37 --> 00:26:39 Anyway, the result is that. 394 00:26:39 --> 00:26:42 Now, I have to draw one picture of a spline. 395 00:26:42 --> 00:26:44 Of the most important spline. 396 00:26:44 --> 00:26:48 And then I'm done with splines. 397 00:26:48 --> 00:26:56 So, what I'm going to draw is now a B-spline. 398 00:26:56 --> 00:27:02 And that's a basic spline. 399 00:27:02 --> 00:27:05 It could be one of our functions, it could be one 400 00:27:05 --> 00:27:07 of our functions phi(x). 401 00:27:09 --> 00:27:12 One of our trial functions. 402 00:27:12 --> 00:27:15 It could be, and let me comment on that. 403 00:27:15 --> 00:27:22 So let me remind myself, good or bad, with a question. 404 00:27:22 --> 00:27:24 And let me try to answer that. 405 00:27:24 --> 00:27:27 But let me first draw the B-spline. 406 00:27:27 --> 00:27:32 OK, so it's like a hat function. 407 00:27:32 --> 00:27:38 Actually a hat function is a linear spline. 408 00:27:38 --> 00:27:43 A hat function is that low level spline that's 409 00:27:43 --> 00:27:44 linear between pieces. 410 00:27:44 --> 00:27:53 Now the B-spline is going to have the value one there. 411 00:27:53 --> 00:27:57 It's going to have no jump in the function. 412 00:27:57 --> 00:27:59 So the function will go through there. 413 00:27:59 --> 00:28:01 No jump in the slope. 414 00:28:01 --> 00:28:04 No jump in the second derivative. 415 00:28:04 --> 00:28:07 And I want to get down to zero. 416 00:28:07 --> 00:28:13 I want to get down to zero. 417 00:28:13 --> 00:28:16 I want it to be as local as I can make it. 418 00:28:16 --> 00:28:22 So I want it to get to zero. 419 00:28:22 --> 00:28:27 Here's the point. 420 00:28:27 --> 00:28:31 With those cubic finite elements, I got 421 00:28:31 --> 00:28:33 them down to zero. 422 00:28:33 --> 00:28:37 They came in here with zero slope, and then they continued 423 00:28:37 --> 00:28:42 as zero, no problem. 424 00:28:42 --> 00:28:51 If I'm wanting the second derivative also to be zero, to 425 00:28:51 --> 00:28:55 be continuous, I won't be able to do it in one interval. 426 00:28:55 --> 00:28:59 It's going to take me a total of four intervals. 427 00:28:59 --> 00:29:04 This one can come down to some point, here, where 428 00:29:04 --> 00:29:07 another cubic starts. 429 00:29:07 --> 00:29:10 Maybe I should do the one here. 430 00:29:10 --> 00:29:15 Going up, you remember the allowed cubic spline would be 431 00:29:15 --> 00:29:21 an x cubed over six, some multiple of x cubed. 432 00:29:21 --> 00:29:23 I don't know what multiple it'll take, maybe x 433 00:29:23 --> 00:29:25 cubed over six is right. 434 00:29:25 --> 00:29:28 It'll come up to some point here. 435 00:29:28 --> 00:29:36 Now I've got to get it beginning to curve downwards. 436 00:29:36 --> 00:29:40 So I'm going to have to change the third derivative. 437 00:29:40 --> 00:29:46 Change to another cubic there, change to another cubic there, 438 00:29:46 --> 00:29:49 and a final cubic here. 439 00:29:49 --> 00:29:52 So there's a picture of a B-spline. 440 00:29:52 --> 00:29:59 And we could figure out, by requiring all these continuity 441 00:29:59 --> 00:30:03 conditions, we could figure out the formula for the cubic 442 00:30:03 --> 00:30:05 in these four pieces. 443 00:30:05 --> 00:30:07 And it would be symmetric, of course, across 444 00:30:07 --> 00:30:09 that center point. 445 00:30:09 --> 00:30:13 But I think I won't try to do it. 446 00:30:13 --> 00:30:18 I'll just leave that idea, then. 447 00:30:18 --> 00:30:20 There's a figure in the book showing a picture 448 00:30:20 --> 00:30:24 of the B-spline. 449 00:30:24 --> 00:30:29 So those are functions, extremely valuable in this 450 00:30:29 --> 00:30:32 interpolation problem. 451 00:30:32 --> 00:30:35 Because all splines are combinations of B-splines. 452 00:30:35 --> 00:30:38 Yeah, now let me pull this topic together. 453 00:30:38 --> 00:30:48 Every spline, every spline function, is combination 454 00:30:48 --> 00:30:52 of these B-splines. 455 00:30:52 --> 00:30:58 Let B_i(x) be the one centered on node i. 456 00:30:58 --> 00:31:01 And then there's a neighbor centered on node i+1. 457 00:31:03 --> 00:31:06 And a neighbor to the left centered on node i-1. 458 00:31:07 --> 00:31:09 What's the point? 459 00:31:09 --> 00:31:20 The point is that, at a typical node, i+1, three of these 460 00:31:20 --> 00:31:23 functions will be non-zero. 461 00:31:23 --> 00:31:28 With these very local hat functions at that node, the 462 00:31:28 --> 00:31:31 only one of the phi functions that wasn't zero is 463 00:31:31 --> 00:31:32 the one I've drawn. 464 00:31:32 --> 00:31:35 All the others were zero there, right? 465 00:31:35 --> 00:31:38 All the other hats were zero. 466 00:31:38 --> 00:31:40 There was just the one. 467 00:31:40 --> 00:31:44 But now there'll be a B-spline starting from here, going up to 468 00:31:44 --> 00:31:47 here, coming down from here. 469 00:31:47 --> 00:31:51 There'll be the B-spline starting from here, going up 470 00:31:51 --> 00:31:54 to here, up, down, so on. 471 00:31:54 --> 00:31:59 So at a typical node, I'm getting the one centered at 472 00:31:59 --> 00:32:04 that node, and also the one to the left, which is on its way 473 00:32:04 --> 00:32:08 down, and also the one to the right, which is on its way up. 474 00:32:08 --> 00:32:13 In other words, it's not as local as the 475 00:32:13 --> 00:32:17 other construction. 476 00:32:17 --> 00:32:26 So I would say good, because it's smooth, but bad because 477 00:32:26 --> 00:32:30 it's not fully local. 478 00:32:30 --> 00:32:32 Not completely local. 479 00:32:32 --> 00:32:37 It's reasonably local, in that there are only three functions 480 00:32:37 --> 00:32:39 that are affecting these points. 481 00:32:39 --> 00:32:44 If I use those polynomials, they weren't local at all. 482 00:32:44 --> 00:32:51 All the points -- it was a typical x to the fifth is not 483 00:32:51 --> 00:32:52 zero at any of the points. 484 00:32:52 --> 00:32:57 These B-splines are zero at a lot of points, but three of 485 00:32:57 --> 00:33:01 them, one, two, and three, will be non-zero at a 486 00:33:01 --> 00:33:03 typical mesh point. 487 00:33:03 --> 00:33:13 OK, so they're not popular, as a result, for finite elements. 488 00:33:13 --> 00:33:16 I'm just wanting to be sure you make the distinction. 489 00:33:16 --> 00:33:20 They're very popular for the interpolation job. 490 00:33:20 --> 00:33:24 They're very popular for the interpolation job. 491 00:33:24 --> 00:33:30 I've got some combination of these at particular 492 00:33:30 --> 00:33:31 mesh points. 493 00:33:31 --> 00:33:36 It's supposed to agree with F at those mesh points. 494 00:33:36 --> 00:33:38 This is my system to solve. 495 00:33:38 --> 00:33:41 I create these functions, these B-splines. 496 00:33:41 --> 00:33:45 I'm given F at typical points. 497 00:33:45 --> 00:33:49 And I choose a combination which matches F 498 00:33:49 --> 00:33:51 at those points. 499 00:33:51 --> 00:33:54 Yeah, OK. 500 00:33:54 --> 00:34:00 Is there a question or discussion on this? 501 00:34:00 --> 00:34:04 I don't like to not say anything about such an 502 00:34:04 --> 00:34:09 important problem as putting curves through points. 503 00:34:09 --> 00:34:16 But I don't want to make it a course on splines. 504 00:34:16 --> 00:34:16 Yes? 505 00:34:16 --> 00:34:18 AUDIENCE: [UNINTELLIGIBLE] 506 00:34:18 --> 00:34:24 PROFESSOR STRANG: I don't know that I'll -- oh, OK, yes. 507 00:34:24 --> 00:34:25 All right. 508 00:34:25 --> 00:34:30 Two or three comments, and that suggests a good question, 509 00:34:30 --> 00:34:32 a very good question. 510 00:34:32 --> 00:34:36 Can I make a separate comment that if I go into 511 00:34:36 --> 00:34:40 two dimensions, this gets much tougher. 512 00:34:40 --> 00:34:44 What happens if I had a function of x and y? 513 00:34:44 --> 00:34:47 So that I've got points on a surface, and I'm trying 514 00:34:47 --> 00:34:49 to fit a surface to it. 515 00:34:49 --> 00:34:55 Just one message first: that's not as easy. 516 00:34:55 --> 00:34:59 It's pretty easy if those points are on 517 00:34:59 --> 00:35:00 a rectangular grid. 518 00:35:00 --> 00:35:04 So this is like typical. 519 00:35:04 --> 00:35:07 And then I'll come to your Nyquist question, which 520 00:35:07 --> 00:35:09 is a very good one. 521 00:35:09 --> 00:35:14 Can I just -- because we're coming into 2-D now. 522 00:35:14 --> 00:35:17 Suppose, there's two dimensions. 523 00:35:17 --> 00:35:18 I have a grid. 524 00:35:18 --> 00:35:20 Let's suppose it's a nice grid. 525 00:35:20 --> 00:35:27 And at every point, at every grid point, I have a height. 526 00:35:27 --> 00:35:28 And I'm fitting a surface. 527 00:35:28 --> 00:35:30 Right? 528 00:35:30 --> 00:35:37 My function is now a function of x and y. x is here, y is 529 00:35:37 --> 00:35:43 here, F is the surface coming out of board, in the 530 00:35:43 --> 00:35:44 third dimension. 531 00:35:44 --> 00:35:48 And fitting those points, if they're regularly spaced like 532 00:35:48 --> 00:35:50 that, my life would be OK. 533 00:35:50 --> 00:35:53 I could use sort of products of splines in 1-D. 534 00:35:56 --> 00:36:06 I could use products of basis, of splines in the x direction 535 00:36:06 --> 00:36:09 times splines in the y direction. 536 00:36:09 --> 00:36:13 And it would be pretty successful. 537 00:36:13 --> 00:36:18 It would be, not quite as nice, but almost OK. 538 00:36:18 --> 00:36:25 But if I had irregularly spaced points from a general 539 00:36:25 --> 00:36:30 grid, it's not as easy. 540 00:36:30 --> 00:36:33 And I won't -- people have obviously had to figure out how 541 00:36:33 --> 00:36:38 to do it, and to repeat again, that's what the CAD/CAM world 542 00:36:38 --> 00:36:42 is having to do all the time, is fit a curve, fit a 543 00:36:42 --> 00:36:44 surface through points. 544 00:36:44 --> 00:36:45 It's significant. 545 00:36:45 --> 00:36:49 Now, you asked about Nyquist. 546 00:36:49 --> 00:36:51 So that's a good question. 547 00:36:51 --> 00:37:00 Can I just say, I have to say -- so what's a function called? 548 00:37:00 --> 00:37:04 Band-limited. 549 00:37:04 --> 00:37:07 How many have heard Nyquist's name? 550 00:37:07 --> 00:37:10 Okay, some of you may know a lot more than I about it. 551 00:37:10 --> 00:37:16 But let me just get some context for band-limited 552 00:37:16 --> 00:37:18 functions. 553 00:37:18 --> 00:37:21 Okay. 554 00:37:21 --> 00:37:25 This is actually a topic that will belong in the third part 555 00:37:25 --> 00:37:27 of our course, in the Fourier part. 556 00:37:27 --> 00:37:35 So this is a Fourier idea. 557 00:37:35 --> 00:37:38 So I'll come back to it, actually. 558 00:37:38 --> 00:37:48 So right here I'm just going to say, very briefly, how it might 559 00:37:48 --> 00:37:51 connect us to what I've said today. 560 00:37:51 --> 00:38:00 But then let's make a plan to, when we've got the idea 561 00:38:00 --> 00:38:04 of Fourier coefficients. 562 00:38:04 --> 00:38:11 What is a band-limited function? 563 00:38:11 --> 00:38:17 You know the Fourier idea is to take F(x), and write it 564 00:38:17 --> 00:38:23 as some combination of pure frequencies. e^(i*K*x), 565 00:38:23 --> 00:38:25 let me say. e^(i*K*x). 566 00:38:27 --> 00:38:30 So this is Fourier that's coming. 567 00:38:30 --> 00:38:33 I take the function F(x), and I write it. 568 00:38:33 --> 00:38:38 I could think of it as a combination of pure 569 00:38:38 --> 00:38:41 exponentials, pure frequencies. 570 00:38:41 --> 00:38:44 That would be a Fourier series. 571 00:38:44 --> 00:38:48 So that's a Fourier series because I'm using -- 572 00:38:48 --> 00:38:50 K has integer values. 573 00:38:50 --> 00:38:55 The frequencies are zero, one, two, three, whatever. 574 00:38:55 --> 00:39:02 Now that we'll use, so that Fourier series comes for 575 00:39:02 --> 00:39:05 functions that are periodic. 576 00:39:05 --> 00:39:06 They repeat every 2pi. 577 00:39:06 --> 00:39:11 Because those functions, if I increase by 2pi, don't change. 578 00:39:11 --> 00:39:13 So I'm repeating every 2pi. 579 00:39:13 --> 00:39:21 Now I have to say a word about the other possibility, which 580 00:39:21 --> 00:39:26 would be to have all frequencies. 581 00:39:26 --> 00:39:27 I'll integrate, now, dK. 582 00:39:27 --> 00:39:32 Instead of summing on K, I'll integrate on K. 583 00:39:32 --> 00:39:35 What does band-limited mean? 584 00:39:35 --> 00:39:41 Band-limited means that only frequencies in a certain 585 00:39:41 --> 00:39:44 range, say a range around zero, are included. 586 00:39:44 --> 00:39:48 So a band-limited function would be a function whose 587 00:39:48 --> 00:39:55 frequencies go from some value, say minus omega to omega, 588 00:39:55 --> 00:39:58 instead of going from minus infinity to infinity. 589 00:39:58 --> 00:40:06 This would be band-limited frequencies between 590 00:40:06 --> 00:40:12 minus omega and omega. 591 00:40:12 --> 00:40:18 So that's another kind of smooth function. 592 00:40:18 --> 00:40:25 That's another way -- functions that have only low frequencies 593 00:40:25 --> 00:40:27 are associated with smoothness. 594 00:40:27 --> 00:40:31 High frequencies are associated with fast oscillations. 595 00:40:31 --> 00:40:37 So the class of band-limited functions gives me another, a 596 00:40:37 --> 00:40:41 Fourier way, to talk about smoothness. 597 00:40:41 --> 00:40:45 So for us, smoothness was something about how many 598 00:40:45 --> 00:40:47 derivatives were continuous. 599 00:40:47 --> 00:40:50 That's the sort of smoothness in the x domain. 600 00:40:50 --> 00:40:53 How many derivatives. 601 00:40:53 --> 00:40:57 Smoothness in the frequency domain is, how fast do 602 00:40:57 --> 00:40:59 the frequencies drop off. 603 00:40:59 --> 00:41:03 And here, band-limited means they drop like a shot. 604 00:41:03 --> 00:41:09 Band-limited means that the frequencies in the function, 605 00:41:09 --> 00:41:13 that these e^(i*K*x)'s are not there for high frequencies. 606 00:41:13 --> 00:41:18 High frequencies are out for a band-limited function. 607 00:41:18 --> 00:41:25 And then Shannon has a formula for the natural 608 00:41:25 --> 00:41:32 way to fit -- so our same interpolation problem. 609 00:41:32 --> 00:41:36 So now, completing the answer to your question. 610 00:41:36 --> 00:41:38 So I have these points. 611 00:41:38 --> 00:41:44 So Shannon could fit a function, and it would look 612 00:41:44 --> 00:41:47 smooth, through those points. 613 00:41:47 --> 00:41:53 And his function would be band-limited. 614 00:41:53 --> 00:41:55 So it would be smooth again. 615 00:41:55 --> 00:42:02 It would be -- yeah, it would be smooth. 616 00:42:02 --> 00:42:07 In some way, this Shannon band-limited stuff is the limit 617 00:42:07 --> 00:42:12 of splines as the spline degree goes way up. 618 00:42:12 --> 00:42:16 So we did hat functions, degree one splines. 619 00:42:16 --> 00:42:23 Cubic splines I recommended as a pretty reliable construction. 620 00:42:23 --> 00:42:26 But you could do fifth degrees splines, seventh degree 621 00:42:26 --> 00:42:29 splines, you could keep going. 622 00:42:29 --> 00:42:32 And in the limit, you would get this. 623 00:42:32 --> 00:42:37 So maybe that's some partial answer to the connection 624 00:42:37 --> 00:42:42 between splines and this Fourier world. 625 00:42:42 --> 00:42:43 OK. 626 00:42:43 --> 00:42:45 Thanks. 627 00:42:45 --> 00:42:47 So these are topics now. 628 00:42:47 --> 00:42:51 Wow, today's lecture is kind of -- can I do one really 629 00:42:51 --> 00:42:54 important thing now in today's lecture? 630 00:42:54 --> 00:42:56 For you to remember? 631 00:42:56 --> 00:42:58 Gradient and divergence? 632 00:42:58 --> 00:43:02 I don't want you to spend the weekend without thinking about 633 00:43:02 --> 00:43:04 gradient and divergence. 634 00:43:04 --> 00:43:07 [LAUGHTER] 635 00:43:07 --> 00:43:10 OK. 636 00:43:10 --> 00:43:14 Here's the idea. 637 00:43:14 --> 00:43:19 For lots and lots of applications, for a region, 638 00:43:19 --> 00:43:30 let's say, in the plane, -- what physical example 639 00:43:30 --> 00:43:31 shall I pick now? 640 00:43:31 --> 00:43:35 Maybe I'll let u be the temperature. 641 00:43:35 --> 00:43:37 So instead of being displacement, let me 642 00:43:37 --> 00:43:41 make it temperature. u. 643 00:43:41 --> 00:43:42 OK. 644 00:43:42 --> 00:43:46 Then I have a temperature gradient. 645 00:43:46 --> 00:43:47 A slope. 646 00:43:47 --> 00:43:51 But now, the whole point is, that's a function of x and y. 647 00:43:51 --> 00:43:55 Then I have a temperature gradient. 648 00:43:55 --> 00:43:59 And if I'm consistent with the notation, that'll be e(x,y). 649 00:43:59 --> 00:44:01 650 00:44:01 --> 00:44:06 And then you'll expect that there's some c(x,y). 651 00:44:08 --> 00:44:13 Some operator, c, that tells me how much heat flows. 652 00:44:13 --> 00:44:17 This will tell me something about the the, the 653 00:44:17 --> 00:44:18 thermal conductivity. 654 00:44:18 --> 00:44:20 Right? 655 00:44:20 --> 00:44:28 Really, as I speak about this framework, I'm just 656 00:44:28 --> 00:44:31 uttering the correct words. 657 00:44:31 --> 00:44:34 Having started with temperature, this thing should 658 00:44:34 --> 00:44:36 be a temperature gradient. 659 00:44:36 --> 00:44:39 Then I should have some physical thermal conductivity, 660 00:44:39 --> 00:44:43 different for different metals or different materials. 661 00:44:43 --> 00:44:46 And I'll have a heat flow, w(x,y). 662 00:44:48 --> 00:44:53 And everybody knows that w will be c times e. 663 00:44:53 --> 00:44:57 And then there will be some A transpose. 664 00:44:57 --> 00:45:01 Of course, there will be some A transpose here, 665 00:45:01 --> 00:45:03 and some A here. 666 00:45:03 --> 00:45:07 And up here I'll have a balance equation. 667 00:45:07 --> 00:45:13 OK. 668 00:45:13 --> 00:45:20 I just want to think, what's the operator A? 669 00:45:20 --> 00:45:25 If we can focus on that question, then that's what's 670 00:45:25 --> 00:45:28 going to occupy us for, certainly the whole 671 00:45:28 --> 00:45:31 of next week. 672 00:45:31 --> 00:45:35 So I've actually used the word gradient. 673 00:45:35 --> 00:45:39 We have functions of two variables. 674 00:45:39 --> 00:45:43 We're looking for the change, the rate of change, the 675 00:45:43 --> 00:45:44 steepness of those functions. 676 00:45:44 --> 00:45:52 So this A, Au, is going to give me two derivatives. 677 00:45:52 --> 00:45:56 I've got two variables, there are two first derivatives. 678 00:45:56 --> 00:46:01 Both of them are important. 679 00:46:01 --> 00:46:03 That's what the A is. 680 00:46:03 --> 00:46:09 For the next big example in the course. 681 00:46:09 --> 00:46:14 The final major example of the course is, when a acts on a 682 00:46:14 --> 00:46:18 function of two variables, because I'm in a region in the 683 00:46:18 --> 00:46:23 plane, to find its rate of change. 684 00:46:23 --> 00:46:26 And this is called the gradient. 685 00:46:26 --> 00:46:34 The shorthand is the gradient of u. 686 00:46:34 --> 00:46:37 So we have to understand that. 687 00:46:37 --> 00:46:41 We have to understand what the gradient is. 688 00:46:41 --> 00:46:45 And, of course, we want to know its transpose. 689 00:46:45 --> 00:46:49 So can I just think, what should be the transpose 690 00:46:49 --> 00:46:54 of the gradient? 691 00:46:54 --> 00:46:55 OK. 692 00:46:55 --> 00:46:57 I'll take that picture out. 693 00:46:57 --> 00:46:58 OK. 694 00:46:58 --> 00:47:03 Thinking now about the transpose of the gradient. 695 00:47:03 --> 00:47:06 OK. 696 00:47:06 --> 00:47:13 So a itself is, you could say, is d/dx and d/dy. 697 00:47:14 --> 00:47:18 You notice how I'm separating out A from Au. 698 00:47:20 --> 00:47:24 When this acts on a function, this is the gradient operator 699 00:47:24 --> 00:47:27 that acts on a function, u, to produce du/dx and du/dy. 700 00:47:29 --> 00:47:30 OK. 701 00:47:30 --> 00:47:33 Now what's the transpose of this? 702 00:47:33 --> 00:47:35 OK. 703 00:47:35 --> 00:47:38 You can guess what it should be, and then we'll see that 704 00:47:38 --> 00:47:40 yes, that guess is correct. 705 00:47:40 --> 00:47:44 So what should a transpose look like? 706 00:47:44 --> 00:47:53 If there's any justice, a transpose should be -- 707 00:47:53 --> 00:47:58 OK, this is two by one. 708 00:47:58 --> 00:48:06 The transpose you would expect to be a row, a row vector. 709 00:48:06 --> 00:48:08 I should have the transpose of that there. 710 00:48:08 --> 00:48:11 And what is the transpose of that? 711 00:48:11 --> 00:48:13 Just tell me. 712 00:48:13 --> 00:48:15 Because we have an idea. 713 00:48:15 --> 00:48:17 What should be the transpose of d/dx? 714 00:48:19 --> 00:48:20 Negative d/dx. 715 00:48:20 --> 00:48:24 716 00:48:24 --> 00:48:25 And what should be the transpose of d/dy? 717 00:48:26 --> 00:48:27 It should be negative d/dy. 718 00:48:28 --> 00:48:30 Those are two different pieces. 719 00:48:30 --> 00:48:32 This is not run together. 720 00:48:32 --> 00:48:35 There's a big space in there. 721 00:48:35 --> 00:48:37 That's two pieces. 722 00:48:37 --> 00:48:44 So what is A transpose applied to -- heat flow w. 723 00:48:44 --> 00:48:50 I want to say, what is A transpose applied to w? 724 00:48:50 --> 00:48:55 You're going to see this again, but we'll just take 725 00:48:55 --> 00:48:58 these minutes to show it for the first time. 726 00:48:58 --> 00:49:03 So A transpose -- wait a minute. 727 00:49:03 --> 00:49:08 Is w a function, or is it a vector? 728 00:49:08 --> 00:49:11 Yeah we've got to get that straight before we start. 729 00:49:11 --> 00:49:14 Here's an ordinary function, a scalar function. 730 00:49:14 --> 00:49:18 Just whatever, x squared plus y squared. 731 00:49:18 --> 00:49:21 What is e? 732 00:49:21 --> 00:49:25 Suppose this is x squared plus y squared. 733 00:49:25 --> 00:49:27 Let's have a specific example. 734 00:49:27 --> 00:49:31 What would e then be? 735 00:49:31 --> 00:49:33 It's got two components, right? 736 00:49:33 --> 00:49:36 It's got an x derivative and a y derivative. e 737 00:49:36 --> 00:49:38 is a vector, . 738 00:49:38 --> 00:49:41 739 00:49:41 --> 00:49:44 Then I multiply by c. 740 00:49:44 --> 00:49:46 So this w has two components. 741 00:49:46 --> 00:49:50 This has got a w_1(x,y), w_2(x,y). 742 00:49:50 --> 00:49:53 743 00:49:53 --> 00:49:56 So just keep things straight. 744 00:49:56 --> 00:50:00 So it's that that I want to apply A transpose to. 745 00:50:00 --> 00:50:07 So A transpose w is minus d/dx, minus d/dy. 746 00:50:08 --> 00:50:11 And everything's coming out right because it's applied 747 00:50:11 --> 00:50:13 to a function w_1 and w_2. 748 00:50:14 --> 00:50:17 Two is a vector field. 749 00:50:17 --> 00:50:20 It's not a scalar field, it's a vector field. 750 00:50:20 --> 00:50:24 And the result is just what it should be: minus 751 00:50:24 --> 00:50:28 dw_1/dx, minus dw_2/dy. 752 00:50:31 --> 00:50:37 OK, good. 753 00:50:37 --> 00:50:40 This has got to come out of integration by parts, right? 754 00:50:40 --> 00:50:43 So we'll have to think: what does integration by parts 755 00:50:43 --> 00:50:45 mean in two variables? 756 00:50:45 --> 00:50:50 And it's a famous formula named after Gauss and Green. 757 00:50:50 --> 00:50:52 The Green's formula, often. 758 00:50:52 --> 00:50:56 But do you recognize what I'm looking at here? 759 00:50:56 --> 00:51:01 This is so important it has a name. 760 00:51:01 --> 00:51:02 And what's the name? 761 00:51:02 --> 00:51:04 And then we're ready to go. 762 00:51:04 --> 00:51:08 What's the name of, if I take a vector field, like . 763 00:51:09 --> 00:51:17 Let me take , as a specific example. 764 00:51:17 --> 00:51:24 Suppose w is , and was multiplied by, let 765 00:51:24 --> 00:51:26 me take c to be one. 766 00:51:26 --> 00:51:33 Then what is A transpose w? 767 00:51:33 --> 00:51:34 Specifically. 768 00:51:34 --> 00:51:39 What am I getting out of it? 769 00:51:39 --> 00:51:43 What do I get from here? 770 00:51:43 --> 00:51:48 That's minus the x derivative of the first guy, and the x 771 00:51:48 --> 00:51:52 derivative of that guy is two, so I'm getting a minus two. 772 00:51:52 --> 00:51:58 And this is minus the y derivative of the second guy, 773 00:51:58 --> 00:52:00 so that's another minus two. 774 00:52:00 --> 00:52:02 So I'm getting a number. 775 00:52:02 --> 00:52:03 It happens to be a number here. 776 00:52:03 --> 00:52:09 I chose such a simple function it came out to be a number. 777 00:52:09 --> 00:52:11 And what's the name? 778 00:52:11 --> 00:52:15 So this is minus the what of w? 779 00:52:15 --> 00:52:20 Just tell me, what's the name everybody uses 780 00:52:20 --> 00:52:22 for that operation? 781 00:52:22 --> 00:52:24 The divergence. 782 00:52:24 --> 00:52:28 Minus the divergence of w. 783 00:52:28 --> 00:52:38 So I what I'm saying here is that this -- I'm saying it 784 00:52:38 --> 00:52:43 because somehow I remember studying vector calculus. 785 00:52:43 --> 00:52:48 And in that process, I learned about the gradient, and I 786 00:52:48 --> 00:52:51 learned about the divergence. 787 00:52:51 --> 00:52:56 But I never learned that one was the transpose of the other. 788 00:52:56 --> 00:53:03 I think, looking back, that was criminal. 789 00:53:03 --> 00:53:07 To describe those -- with a minus sign, of course. 790 00:53:07 --> 00:53:16 I learned Green's formula, but now we'll see what it means. 791 00:53:16 --> 00:53:17 OK, that's next week's job. 792 00:53:17 --> 00:53:20 Have a great weekend and see you Monday. 793 00:53:20 --> 00:53:21