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