1 00:00:00 --> 00:00:01 2 00:00:01 --> 00:00:03 The following content is provided under a Creative 3 00:00:03 --> 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:09 offer high-quality educational resources for free. 6 00:00:09 --> 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:20 at ocw.mit.edu. 9 00:00:20 --> 00:00:22 PROFESSOR STRANG: So. 10 00:00:22 --> 00:00:27 I got the preparation for finite elements. 11 00:00:27 --> 00:00:30 Again we're in one dimension, because that's where you can 12 00:00:30 --> 00:00:35 see first and most clearly how the system works. 13 00:00:35 --> 00:00:40 So the system was, really to begin with the weak form that 14 00:00:40 --> 00:00:43 I introduced last time. 15 00:00:43 --> 00:00:46 The Galerkin idea that I introduced just at the very end 16 00:00:46 --> 00:00:53 of last time, and that idea is that instead of the continuous 17 00:00:53 --> 00:00:57 differential equations where Galerkin's idea is how do you 18 00:00:57 --> 00:01:02 make it discrete, and he'll choose some trial functions. 19 00:01:02 --> 00:01:03 Those are functions. 20 00:01:03 --> 00:01:05 And some test function. 21 00:01:05 --> 00:01:08 And I didn't get to say, but I'll say now, very 22 00:01:08 --> 00:01:10 often they're the same. 23 00:01:10 --> 00:01:15 So very often the phis are the same as the v's. 24 00:01:15 --> 00:01:20 And probably they will be in all my examples today. 25 00:01:20 --> 00:01:28 And then what's new today is what choices would you make. 26 00:01:28 --> 00:01:33 You have pretty wide choice, but there are some natural 27 00:01:33 --> 00:01:35 ones to start with. 28 00:01:35 --> 00:01:38 And so that's where we are today. 29 00:01:38 --> 00:01:44 And then also the other part of today is how do we get from all 30 00:01:44 --> 00:01:48 that preparation to the equations that we 31 00:01:48 --> 00:01:49 actually solve. 32 00:01:49 --> 00:01:52 The KU=F; where does the K come from, where 33 00:01:52 --> 00:01:54 does the F come from? 34 00:01:54 --> 00:01:57 The F is going to come, of course, somehow from this right 35 00:01:57 --> 00:02:01 hand side and the K is going to come from the left side. 36 00:02:01 --> 00:02:06 OK, so that's the overall direction if you want to know 37 00:02:06 --> 00:02:10 how finite elements, work that's the key line there. 38 00:02:10 --> 00:02:14 And then here I've recalled what the step was, here's 39 00:02:14 --> 00:02:16 our differential equation. 40 00:02:16 --> 00:02:17 And there's its weak form. 41 00:02:17 --> 00:02:19 This is the weak form. 42 00:02:19 --> 00:02:22 And let me put this in. 43 00:02:22 --> 00:02:25 Here I've reproduced what we reached last 44 00:02:25 --> 00:02:30 time, the weak form. 45 00:02:30 --> 00:02:34 That was the strong form with its boundary conditions; now 46 00:02:34 --> 00:02:37 we get the weak form with its boundary conditions. 47 00:02:37 --> 00:02:43 And the weak form involves u, so it's the boundary conditions 48 00:02:43 --> 00:02:51 on u, the fixed ones that get used in the weak form. 49 00:02:51 --> 00:02:58 The free ones don't appear in the weak form, but by the magic 50 00:02:58 --> 00:03:04 of integration by parts, the free ones will sort of come 51 00:03:04 --> 00:03:06 out in a natural way. 52 00:03:06 --> 00:03:10 But we have to build in the essential Dirichlet boundary 53 00:03:10 --> 00:03:15 conditions like that fixed right hand n. 54 00:03:15 --> 00:03:22 OK, and because I think of v as a little movement away from u, 55 00:03:22 --> 00:03:27 but my u's all fixed at the end, therefore v has 56 00:03:27 --> 00:03:29 to be fixed, too. 57 00:03:29 --> 00:03:36 OK, so this is important. but we haven't made 58 00:03:36 --> 00:03:38 it down to Earth yet. 59 00:03:38 --> 00:03:46 We were doing a lot of ideas last time, which are the center 60 00:03:46 --> 00:03:49 of things, but now let's get down to Earth. 61 00:03:49 --> 00:03:54 And down to Earth really means, what functions do we choose? 62 00:03:54 --> 00:03:57 And then how do we get the equation. 63 00:03:57 --> 00:04:01 So that's the job today, the principle job and this is of 64 00:04:01 --> 00:04:06 course what you would actually code up to run a finite 65 00:04:06 --> 00:04:08 element simulation. 66 00:04:08 --> 00:04:10 You would make a decision on these functions. 67 00:04:10 --> 00:04:15 And let's start with piecewise linear functions. 68 00:04:15 --> 00:04:22 So a typical phi is maybe centered at a node, so 69 00:04:22 --> 00:04:25 it goes up and down. 70 00:04:25 --> 00:04:33 So if that's node two, let's number these nodes, one, 71 00:04:33 --> 00:04:40 two, three, four, and five. 72 00:04:40 --> 00:04:44 Well, that's five there but I'm going to have, let's 73 00:04:44 --> 00:04:46 see; what do I have here? 74 00:04:46 --> 00:04:57 At a typical node two, my function is zero except in the 75 00:04:57 --> 00:04:59 integrals that touch node two. 76 00:04:59 --> 00:05:00 So here's phi_2. 77 00:05:02 --> 00:05:02 phi_2(x). 78 00:05:03 --> 00:05:04 That's it's graph. 79 00:05:04 --> 00:05:07 It comes along, it's piecewise linear up, it's peacewise 80 00:05:07 --> 00:05:12 linear back down, and it's zero again. 81 00:05:12 --> 00:05:12 So that would be phi_2. 82 00:05:13 --> 00:05:15 Then phi_1, there'll be a phi_1. 83 00:05:15 --> 00:05:18 84 00:05:18 --> 00:05:20 Like so, exactly similar. 85 00:05:20 --> 00:05:24 The whole point is keep the system simple. 86 00:05:24 --> 00:05:29 That's what the finite element idea is. 87 00:05:29 --> 00:05:32 Use simple functions for the phis. 88 00:05:32 --> 00:05:35 And I'm taking them also to be the test function v. 89 00:05:35 --> 00:05:36 Keep those simple. 90 00:05:36 --> 00:05:40 Now, what about at the boundaries? 91 00:05:40 --> 00:05:44 OK, well we've said our functions have to be, 92 00:05:44 --> 00:05:46 I'm doing free-fixed. 93 00:05:46 --> 00:05:53 So fixed comes to zero there and all my 94 00:05:53 --> 00:05:54 functions will do that. 95 00:05:54 --> 00:05:58 But this end is free, so watch this. 96 00:05:58 --> 00:06:02 This is another what I'll call a half-hat. 97 00:06:02 --> 00:06:05 If I call those hat functions is that OK? 98 00:06:05 --> 00:06:08 It makes a nice short word. 99 00:06:08 --> 00:06:13 So these are hat functions. 100 00:06:13 --> 00:06:16 And then a fuller description would be piecewise linear, 101 00:06:16 --> 00:06:20 but hat functions is clear. 102 00:06:20 --> 00:06:23 OK, now notice I'm sticking in here what I maybe 103 00:06:23 --> 00:06:26 could call a half-hat. 104 00:06:26 --> 00:06:32 Because my v and my phis, my functions are not constrained 105 00:06:32 --> 00:06:33 at that left hand end. 106 00:06:33 --> 00:06:34 That's free. 107 00:06:34 --> 00:06:38 So there's a phi_1, and there's a phi_0. 108 00:06:39 --> 00:06:42 And a phi_3, and a phi_4. 109 00:06:42 --> 00:06:47 4 So altogether, I'm going to have five. 110 00:06:47 --> 00:06:49 And I've started the numbering at zero, I 111 00:06:49 --> 00:06:50 guess it just happens. 112 00:06:50 --> 00:06:52 So let's accept that. 113 00:06:52 --> 00:06:56 So I'm going to have five functions. 114 00:06:56 --> 00:07:00 And they will also be my five test functions. 115 00:07:00 --> 00:07:04 So let me first think of them as the trial functions. 116 00:07:04 --> 00:07:05 Phi. 117 00:07:05 --> 00:07:07 So what was the point about trial functions? 118 00:07:07 --> 00:07:12 The point about is my approximate, my finite element 119 00:07:12 --> 00:07:18 solution u(x) is going to be a combination of those. 120 00:07:18 --> 00:07:26 Some u_0, times the phi_0 function up to u_4 times 121 00:07:26 --> 00:07:29 the phi_4 function. 122 00:07:29 --> 00:07:33 And these are my unknowns. u_0, u_1, those numbers. 123 00:07:33 --> 00:07:35 I have five unknowns. 124 00:07:35 --> 00:07:38 And I'm using hat functions. 125 00:07:38 --> 00:07:43 So I should, really, why don't I draw a graph of u(x). 126 00:07:45 --> 00:07:48 So I don't need the words piecewise linear. 127 00:07:48 --> 00:07:53 You see, I have a kind of space of function. 128 00:07:53 --> 00:08:02 My functions are all, my approximations are combinations 129 00:08:02 --> 00:08:05 of these fixed basis functions. 130 00:08:05 --> 00:08:09 You could call these phis, trial functions, basis 131 00:08:09 --> 00:08:14 functions, you're always choosing in applied math. 132 00:08:14 --> 00:08:19 A bunch of functions whose combinations are going 133 00:08:19 --> 00:08:21 to be, is what you're going to work with. 134 00:08:21 --> 00:08:24 And here I'm making them hat functions. 135 00:08:24 --> 00:08:29 OK, so what does a combination of those guys look like? 136 00:08:29 --> 00:08:31 I'll even erase the word hat functions; 137 00:08:31 --> 00:08:32 we won't forget that. 138 00:08:32 --> 00:08:37 So what would a combination of, here's the same integral, zero, 139 00:08:37 --> 00:08:44 one, with the same mesh, one, two, three, four guys inside. 140 00:08:44 --> 00:08:50 What would, it just helps the visualization to see. 141 00:08:50 --> 00:08:57 If I combine these guys, so those were despite the 142 00:08:57 --> 00:08:59 way it might look, that's one separate function. 143 00:08:59 --> 00:09:02 Two, three, four and five. 144 00:09:02 --> 00:09:06 And now suppose I take a combination. 145 00:09:06 --> 00:09:09 What kind of a function do I get? 146 00:09:09 --> 00:09:14 How would you describe this, a combination like this? 147 00:09:14 --> 00:09:15 Of those five guys? 148 00:09:15 --> 00:09:18 What will it look like? 149 00:09:18 --> 00:09:25 Between every node it will be a straight line, right? 150 00:09:25 --> 00:09:28 Because all these guys are straight, between those. 151 00:09:28 --> 00:09:31 So a typical function will start at what? 152 00:09:31 --> 00:09:37 This height will be u_0, because, well let me 153 00:09:37 --> 00:09:38 draw a few things. 154 00:09:38 --> 00:09:42 OK, so I'll put u_0 a little higher because I want 155 00:09:42 --> 00:09:43 to end up down at zero. 156 00:09:43 --> 00:09:49 So that might be the height u_0, u_1 might be pretty close. 157 00:09:49 --> 00:09:51 u_2 might be coming down a bit. 158 00:09:51 --> 00:09:54 Coming down a bit, coming down a bit. 159 00:09:54 --> 00:09:55 And ending at zero. 160 00:09:55 --> 00:10:01 So those were meant to be corners. 161 00:10:01 --> 00:10:03 That wasn't a very good bit. 162 00:10:03 --> 00:10:05 There, OK. 163 00:10:05 --> 00:10:10 It wasn't meant to be, yeah. 164 00:10:10 --> 00:10:11 So that height is u_0. 165 00:10:11 --> 00:10:13 Now, notice why? 166 00:10:13 --> 00:10:15 Why is that? 167 00:10:15 --> 00:10:19 Why is the coefficient of phi_0 exactly the height, 168 00:10:19 --> 00:10:24 the displacement, at zero? 169 00:10:24 --> 00:10:29 Because all the other phis are zero. 170 00:10:29 --> 00:10:34 All the other phis are zero at this point. 171 00:10:34 --> 00:10:35 Only this guy's coming in. 172 00:10:35 --> 00:10:43 So we'll only see in this, at this point see, even phi_1 173 00:10:43 --> 00:10:45 has dropped to zero. 174 00:10:45 --> 00:10:48 So we're only going to see phi_0 times u_0. 175 00:10:48 --> 00:10:54 So, I should have said, we take all these heights to be one. 176 00:10:54 --> 00:10:56 Height is one. 177 00:10:56 --> 00:10:59 Course it doesn't matter because we're multiplying by 178 00:10:59 --> 00:11:00 u's, but so let's settle. 179 00:11:00 --> 00:11:02 They all have heights one. 180 00:11:02 --> 00:11:05 And this is sort of a key part of the finite 181 00:11:05 --> 00:11:07 that element idea. 182 00:11:07 --> 00:11:12 You see, Galerkin, when he created just two or three 183 00:11:12 --> 00:11:17 functions phi, he tried to follow the exact solution. 184 00:11:17 --> 00:11:21 He had an idea in his mind what the solution to 185 00:11:21 --> 00:11:22 the problem will be. 186 00:11:22 --> 00:11:24 And he wanted to take two or three functions that would 187 00:11:24 --> 00:11:26 get him close to it. 188 00:11:26 --> 00:11:31 Here we choose the functions, they're in the finite element 189 00:11:31 --> 00:11:34 library before we even know what the equation is, or 190 00:11:34 --> 00:11:35 the boundary conditions. 191 00:11:35 --> 00:11:42 These functions are like, the hat function choice. 192 00:11:42 --> 00:11:48 And they have this beautiful sort of a connect to nodes. 193 00:11:48 --> 00:11:52 In a way where in fact I got involved in finite elements 194 00:11:52 --> 00:11:55 in the first place just to understand what's the 195 00:11:55 --> 00:11:58 difference between finite elements and finite 196 00:11:58 --> 00:12:00 differences. 197 00:12:00 --> 00:12:04 Because the finite elements, as you'll see, are associated with 198 00:12:04 --> 00:12:09 nodes. phi_1 is the only guy that's not zero at node one. 199 00:12:09 --> 00:12:12 And therefore, what will this height be? 200 00:12:12 --> 00:12:14 What's that height? 201 00:12:14 --> 00:12:16 So that maybe comes down a little. 202 00:12:16 --> 00:12:19 What's this height? u_1. 203 00:12:19 --> 00:12:24 It's the coefficient of phi_1, because phi_1 is sitting there. 204 00:12:24 --> 00:12:26 And all the other phis are zero there, so this 205 00:12:26 --> 00:12:28 height is really u_1. 206 00:12:28 --> 00:12:33 And u_2, and u_3, and u_4, and u_5 is zero. 207 00:12:33 --> 00:12:41 So that was u_1, u_2, and so on. 208 00:12:41 --> 00:12:45 What I'm saying is, and we'll see it happen, is that this 209 00:12:45 --> 00:12:49 KU=F equation that we finally get to is going to look 210 00:12:49 --> 00:12:53 very like a finite difference equation. 211 00:12:53 --> 00:12:56 But it's coming from this different direction. 212 00:12:56 --> 00:13:06 And this way allows many more possibilities, gets things 213 00:13:06 --> 00:13:09 sort of more naturally right. 214 00:13:09 --> 00:13:13 It less, with the finite difference equation, we had 215 00:13:13 --> 00:13:18 to go in there and decide what it should be. 216 00:13:18 --> 00:13:22 With finite elements, our decision is just the phis. 217 00:13:22 --> 00:13:25 Once we've decided the phis, Galerkin tells us 218 00:13:25 --> 00:13:26 what the equation is. 219 00:13:26 --> 00:13:31 And we'll get to the KU=F, what it is. 220 00:13:31 --> 00:13:37 But here I'm getting you to see what our approximate 221 00:13:37 --> 00:13:39 solution can look like. 222 00:13:39 --> 00:13:43 And this beautiful fact that the coefficients in here 223 00:13:43 --> 00:13:45 have a physical meaning. 224 00:13:45 --> 00:13:49 They're actually the displacements at the nodes 225 00:13:49 --> 00:13:51 for these simple functions. 226 00:13:51 --> 00:13:54 OK. 227 00:13:54 --> 00:13:56 You got a picture of what the trial functions are, some 228 00:13:56 --> 00:14:02 people would think about the functions as these guys. 229 00:14:02 --> 00:14:07 Other people might think of this picture, the combinations. 230 00:14:07 --> 00:14:11 So those are the individual basis functions. 231 00:14:11 --> 00:14:15 That's a typical combination of the typical one. 232 00:14:15 --> 00:14:21 OK, so we're looking for an equation for these u's. 233 00:14:21 --> 00:14:23 Five equations, of course. 234 00:14:23 --> 00:14:27 Because we've got five u's. 235 00:14:27 --> 00:14:30 So that's my final step here. 236 00:14:30 --> 00:14:33 What are the five equations for the five u's. 237 00:14:33 --> 00:14:35 And those are the equations that I'm going to call KU=F. 238 00:14:36 --> 00:14:38 OK. 239 00:14:38 --> 00:14:40 So here's now a critical moment. 240 00:14:40 --> 00:14:43 Where do the equations come from? 241 00:14:43 --> 00:14:47 Well, the equations come from the weak form. 242 00:14:47 --> 00:14:50 So I take the weak form. 243 00:14:50 --> 00:14:59 And in for u, for u here, I guess it's just there. 244 00:14:59 --> 00:15:00 I put this. 245 00:15:00 --> 00:15:02 I put capital U. 246 00:15:02 --> 00:15:10 So so can I just copy, this is the weak form for before 247 00:15:10 --> 00:15:11 we've made it discrete. 248 00:15:11 --> 00:15:14 Before we've chosen n phis. 249 00:15:14 --> 00:15:16 OK, now let's choose the n phis, so now this'll 250 00:15:16 --> 00:15:18 be the weak form. 251 00:15:18 --> 00:15:27 Again, the weak form with Galerkin. 252 00:15:27 --> 00:15:28 After the decision. 253 00:15:28 --> 00:15:31 So it'll be the integral, from zero to one of this 254 00:15:31 --> 00:15:33 c(x), whatever it is. 255 00:15:33 --> 00:15:39 Times the u(x), times the dU/dx, right? dU/dx, 256 00:15:39 --> 00:15:42 so what is dU/dx? 257 00:15:43 --> 00:15:46 Oh, you have to pay attention. 258 00:15:46 --> 00:15:47 This was a true solution. 259 00:15:47 --> 00:15:49 Little u. 260 00:15:49 --> 00:15:51 But now this is where I'm working. 261 00:15:51 --> 00:15:54 I'm working with capital U. 262 00:15:54 --> 00:15:59 So instead of the d little u/dx, it's d capital U/dx. 263 00:16:00 --> 00:16:02 Maybe I'll put it in there. d capital U/dx. 264 00:16:03 --> 00:16:06 And then I'll put down here what it is. 265 00:16:06 --> 00:16:07 What is it? 266 00:16:07 --> 00:16:13 It's u_0*phi_0, can I use prime just to, or 267 00:16:13 --> 00:16:18 d phi_0/dx, whatever? 268 00:16:18 --> 00:16:20 Can I use prime for derivative? 269 00:16:20 --> 00:16:22 Just save a little space. 270 00:16:22 --> 00:16:25 So this is the derivative of my guy. 271 00:16:25 --> 00:16:33 u_1*phi_1'(x), up to whatever it was. u_4*phi_4'(x). 272 00:16:33 --> 00:16:37 273 00:16:37 --> 00:16:40 That's what that term is. 274 00:16:40 --> 00:16:43 And that multiplies dV/dx. 275 00:16:43 --> 00:16:50 Where V is, here V is any test function. 276 00:16:50 --> 00:16:53 Any test, function only required to have V(1)=0. 277 00:16:54 --> 00:17:00 But now, I'm going discrete. 278 00:17:00 --> 00:17:04 So instead of any test function, I'll use 279 00:17:04 --> 00:17:06 these five functions. 280 00:17:06 --> 00:17:08 So I've got five functions. 281 00:17:08 --> 00:17:11 The phis are the same as the V's, then. 282 00:17:11 --> 00:17:15 V_1, V_2, V_3 and V_4. 283 00:17:15 --> 00:17:17 Same guys. 284 00:17:17 --> 00:17:22 So now I'll put in dV, can I say dV_i/dx? 285 00:17:22 --> 00:17:27 286 00:17:27 --> 00:17:32 And on the right hand side I have the integral from zero to 287 00:17:32 --> 00:17:47 one of F(x)*V_i(x)dx, i is zero, one, two, three, or four. 288 00:17:47 --> 00:17:50 I'm testing against five V's. 289 00:17:50 --> 00:17:55 So I have this equation for five different V's. 290 00:17:55 --> 00:17:58 So i equals zero, one, two, three, four, gives me 291 00:17:58 --> 00:18:00 my five equations. 292 00:18:00 --> 00:18:02 Here are my five unknowns. 293 00:18:02 --> 00:18:05 This is my five by five system. 294 00:18:05 --> 00:18:08 Let me just step back a minute so you see what happened there. 295 00:18:08 --> 00:18:11 So what do you have to do? 296 00:18:11 --> 00:18:19 You chose the basis functions, the phis and the V's. 297 00:18:19 --> 00:18:23 Then you just plug into the weak form, you plug in dU/dx, 298 00:18:23 --> 00:18:25 is coming from there. 299 00:18:25 --> 00:18:27 So this is dU/dx. 300 00:18:27 --> 00:18:32 You have to plug dV/dx, you have to do the integrals. 301 00:18:32 --> 00:18:34 But to do the integrals, that's something we didn't have 302 00:18:34 --> 00:18:36 in finite differences. 303 00:18:36 --> 00:18:39 Finite elements involves doing the integrals, left side 304 00:18:39 --> 00:18:42 and right hand side. 305 00:18:42 --> 00:18:48 OK, so and here we have five different integrals to do. 306 00:18:48 --> 00:18:52 We have F(x) times each V. 307 00:18:52 --> 00:18:56 This will be, this number will be F_i. 308 00:18:57 --> 00:19:06 So my f vector is going to be an F_0, F_1, down to F_4. 309 00:19:06 --> 00:19:10 The five guys that I get from these five integrals. 310 00:19:10 --> 00:19:13 Alright. 311 00:19:13 --> 00:19:17 And the K matrix is sitting here somewhere. 312 00:19:17 --> 00:19:20 That's the last thing, that's the final thing is to see 313 00:19:20 --> 00:19:23 what is the K matrix. 314 00:19:23 --> 00:19:24 Which is coming. 315 00:19:24 --> 00:19:28 This is somehow K's times U's are sitting here. 316 00:19:28 --> 00:19:30 F's are sitting over there. 317 00:19:30 --> 00:19:33 So it may be good to see the f first. 318 00:19:33 --> 00:19:34 So do you see this now? 319 00:19:34 --> 00:19:38 We made the choices, then what's our job? 320 00:19:38 --> 00:19:44 Our next job is to do all the integrations. 321 00:19:44 --> 00:19:47 Integrate my function against V. 322 00:19:47 --> 00:19:52 Let's make the natural first example, let F be one. 323 00:19:52 --> 00:19:56 First example, let F be one. 324 00:19:56 --> 00:19:57 All right. 325 00:19:57 --> 00:20:07 So if F is one, I'm going to find the system KU=F. 326 00:20:08 --> 00:20:14 So if I know F(x) is one, then I have everything I need 327 00:20:14 --> 00:20:16 to find these numbers. 328 00:20:16 --> 00:20:24 OK, actually we can probably do those by, you can probably 329 00:20:24 --> 00:20:26 tell me what they are. 330 00:20:26 --> 00:20:30 If F(x) is one, now. 331 00:20:30 --> 00:20:31 So this is example one. 332 00:20:31 --> 00:20:33 F(x) is a constant. 333 00:20:33 --> 00:20:37 One we have solved before. 334 00:20:37 --> 00:20:41 What's the integral of V_0? 335 00:20:41 --> 00:20:43 Right, that's what I have to do. 336 00:20:43 --> 00:20:47 What's the integral of this F(x) being one, I'm just 337 00:20:47 --> 00:20:49 asking, I just have V_0(x)? 338 00:20:49 --> 00:20:53 The integral of V_0(x), and let me again draw 339 00:20:53 --> 00:20:55 V_0, which is phi_0. 340 00:20:56 --> 00:21:01 It's a half hat and then it goes along at zero. 341 00:21:01 --> 00:21:04 What's the integral of that function? 342 00:21:04 --> 00:21:06 One, yeah. 343 00:21:06 --> 00:21:08 How do I think about that integral? 344 00:21:08 --> 00:21:10 It's the area of the triangle. 345 00:21:10 --> 00:21:11 It's the area. 346 00:21:11 --> 00:21:13 That's what an integral is, it's the area. 347 00:21:13 --> 00:21:20 So the area is, I've got delta x there. 348 00:21:20 --> 00:21:22 Right, delta x as the base. 349 00:21:22 --> 00:21:28 One as the height, and you see the formula for the area of 350 00:21:28 --> 00:21:32 a triangle, it's got a half in there somewhere, right? 351 00:21:32 --> 00:21:33 A half. 352 00:21:33 --> 00:21:36 OK, can I factor out the delta x? 353 00:21:36 --> 00:21:38 Because the delta x is going to come in. 354 00:21:38 --> 00:21:41 I think there's a half there. 355 00:21:41 --> 00:21:43 And then what about F_1? 356 00:21:43 --> 00:21:51 What's the integral of this times V_1(x), the next V? 357 00:21:51 --> 00:21:56 It's the area under this dashed function. 358 00:21:56 --> 00:22:00 Which is now the basis 2 delta x, so I get a one. 359 00:22:00 --> 00:22:02 Is that right? 360 00:22:02 --> 00:22:06 I get a one, one, one, one. 361 00:22:06 --> 00:22:10 OK, so that was obviously not too tough, right? 362 00:22:10 --> 00:22:17 That was straightforward and notice something. 363 00:22:17 --> 00:22:20 Even here; in fact, we see it here. 364 00:22:20 --> 00:22:24 I don't know if you remember about that half. 365 00:22:24 --> 00:22:29 Do you remember something about when we did finite differences 366 00:22:29 --> 00:22:33 and we had a free boundary? 367 00:22:33 --> 00:22:36 And we lost an order of accuracy if we 368 00:22:36 --> 00:22:37 didn't do it right? 369 00:22:37 --> 00:22:40 Do you remember that? 370 00:22:40 --> 00:22:43 At the fixed boundary we were fine, but with finite 371 00:22:43 --> 00:22:46 differences that's a free boundary where I was 372 00:22:46 --> 00:22:48 using the matrix T. 373 00:22:48 --> 00:22:52 With one minus one at the top row. 374 00:22:52 --> 00:22:55 I lost an order of accuracy. 375 00:22:55 --> 00:22:59 Unless I made some change on the right hand side. 376 00:22:59 --> 00:23:01 Look what's happening. 377 00:23:01 --> 00:23:04 The finite element method is making the change for me 378 00:23:04 --> 00:23:06 on the right hand side. 379 00:23:06 --> 00:23:11 So the finite element method is going to automatically keep 380 00:23:11 --> 00:23:13 the second order accuracy. 381 00:23:13 --> 00:23:15 Keep the second order accuracy. 382 00:23:15 --> 00:23:18 So that's a key point. 383 00:23:18 --> 00:23:23 That these piecewise linear functions are associated 384 00:23:23 --> 00:23:27 with second order accuracy. 385 00:23:27 --> 00:23:29 Later we'll move up to parabolas. 386 00:23:29 --> 00:23:32 To cubics that will move up the order of 387 00:23:32 --> 00:23:35 accuracy in a nice way. 388 00:23:35 --> 00:23:40 Where with finite differences we would have had to create new 389 00:23:40 --> 00:23:42 finite difference formulas. 390 00:23:42 --> 00:23:47 Our minus one, two, minus one formula, that was good for 391 00:23:47 --> 00:23:49 second order accuracy. 392 00:23:49 --> 00:23:53 Then we would have to figure out in the quiz and partly 393 00:23:53 --> 00:23:57 started it, what if there's a c(x) in there, what do you do? 394 00:23:57 --> 00:24:00 Finite differences, is more thinking involved. 395 00:24:00 --> 00:24:04 Finite elements is like just press the button. 396 00:24:04 --> 00:24:07 Well, there's a little more to it than that of course, because 397 00:24:07 --> 00:24:09 it's taking a whole lecture. 398 00:24:09 --> 00:24:17 But in the end it's more systematic, you could say. 399 00:24:17 --> 00:24:19 So that's the F. 400 00:24:19 --> 00:24:22 Now are you ready for the K? 401 00:24:22 --> 00:24:24 So this is the key part, OK? 402 00:24:24 --> 00:24:30 So you have to can get this thing to simplify. 403 00:24:30 --> 00:24:33 So what am I looking for here? 404 00:24:33 --> 00:24:39 This whole left hand side should be K times U. 405 00:24:39 --> 00:24:45 So I'm looking to see what multiplies, I'm looking to 406 00:24:45 --> 00:24:46 make sense out of this. 407 00:24:46 --> 00:24:48 What's the first equation? 408 00:24:48 --> 00:24:52 Right, so the first equation or the zeroth equation, I guess. 409 00:24:52 --> 00:24:57 The zeroth equation, the one that'll run along and have this 410 00:24:57 --> 00:25:02 right hand side, the zeroth equation is the equation 411 00:25:02 --> 00:25:05 when i is zero. 412 00:25:05 --> 00:25:10 It's the equation that comes from testing our 413 00:25:10 --> 00:25:13 weak form for V_0. 414 00:25:13 --> 00:25:17 For that particular form. 415 00:25:17 --> 00:25:21 Maybe I'll just start over on this board. 416 00:25:21 --> 00:25:23 Then I can write a formula, but I'd rather you 417 00:25:23 --> 00:25:26 see how it comes. 418 00:25:26 --> 00:25:31 So I'm looking at equation zero. 419 00:25:31 --> 00:25:34 So take i=0. 420 00:25:34 --> 00:25:36 421 00:25:36 --> 00:25:40 So I have my left side is my integral, of c(x). 422 00:25:41 --> 00:25:44 Times this combination that I wrote, U_0*phi_0' 423 00:25:44 --> 00:25:44 +...+u_4*phi_4'. 424 00:25:44 --> 00:25:52 425 00:25:52 --> 00:26:02 Times dV_0/dx*dx equal, and on the right side is where I got 426 00:26:02 --> 00:26:05 the F_0, which I already figured out to be 427 00:26:05 --> 00:26:07 delta x times a half. 428 00:26:07 --> 00:26:10 It's the left side that I'm worrying about. 429 00:26:10 --> 00:26:14 OK, you see what's happening here? 430 00:26:14 --> 00:26:19 This is some matrix. 431 00:26:19 --> 00:26:22 Its zeroth row is what we're finding. 432 00:26:22 --> 00:26:34 Multiplying U_0, U_1, U_2, U_3, and U_4 equaling the F vector. 433 00:26:34 --> 00:26:37 I'm supposed to be getting the first row of the matrix, the 434 00:26:37 --> 00:26:42 top row of the matrix, from the top V. 435 00:26:42 --> 00:26:44 OK, so let's just do these. 436 00:26:44 --> 00:26:47 We've got integrals to do again. 437 00:26:47 --> 00:26:50 Alright, what is dV_0/dx? 438 00:26:50 --> 00:26:55 439 00:26:55 --> 00:26:56 Do you see? 440 00:26:56 --> 00:26:57 Let me just see? 441 00:26:57 --> 00:27:02 What number is going in here? 442 00:27:02 --> 00:27:03 What number is going in there? 443 00:27:03 --> 00:27:06 Yeah, if we see that we're golden. 444 00:27:06 --> 00:27:08 What number is going in there? 445 00:27:08 --> 00:27:15 That's the thing that multiplies U_0 in the first row 446 00:27:15 --> 00:27:19 that means I should use V_0, so this is the point, 447 00:27:19 --> 00:27:21 this is K_00. 448 00:27:22 --> 00:27:25 And what's its formula? 449 00:27:25 --> 00:27:28 You realize I'm starting the count at zero because 450 00:27:28 --> 00:27:29 all these counts. 451 00:27:29 --> 00:27:30 So what is K_00? 452 00:27:33 --> 00:27:35 It's an integral. 453 00:27:35 --> 00:27:40 Of what? c(x), good. 454 00:27:40 --> 00:27:47 Times this guy, because it's multiplying times 455 00:27:47 --> 00:27:52 this guy, V_0. dx. 456 00:27:52 --> 00:27:54 That's what you have to do. 457 00:27:54 --> 00:28:00 That's what you have to do. c(x) times phi', it's phi_0', 458 00:28:00 --> 00:28:03 that's what would sit there. 459 00:28:03 --> 00:28:11 And maybe, well, let's figure that one, shall we? 460 00:28:11 --> 00:28:15 I have to know c(x), right, that's part of the problem. 461 00:28:15 --> 00:28:17 What would you like me to choose for c(x)? 462 00:28:18 --> 00:28:18 One. 463 00:28:18 --> 00:28:20 Thank you. 464 00:28:20 --> 00:28:22 I'll choose one. 465 00:28:22 --> 00:28:24 Let this be one. 466 00:28:24 --> 00:28:27 Or I could make it capital C and you would see a capital 467 00:28:27 --> 00:28:30 C appearing everywhere, but let's make it one. 468 00:28:30 --> 00:28:32 So what are we doing now? 469 00:28:32 --> 00:28:33 What's our equation? 470 00:28:33 --> 00:28:37 Our right hand side is one, our c(x) is one, our equation 471 00:28:37 --> 00:28:39 has reduced to -U''=1. 472 00:28:41 --> 00:28:44 The first equation in the course. 473 00:28:44 --> 00:28:50 So we're back to September the 3rd or whatever it was. 474 00:28:50 --> 00:28:54 But doing it now by finite elements. 475 00:28:54 --> 00:28:58 OK, so let c(x) be one and tell me what this integral is. 476 00:28:58 --> 00:29:03 So c(x) is now, we're taking in our problem we're 477 00:29:03 --> 00:29:05 supposing it's one. 478 00:29:05 --> 00:29:11 Let me just say suppose it's function. 479 00:29:11 --> 00:29:20 Then we have lots of integrals to do involving that function. 480 00:29:20 --> 00:29:24 And we might not do them exactly, that would be alright. 481 00:29:24 --> 00:29:29 It's certainly totally OK to do the integrals approximately, 482 00:29:29 --> 00:29:33 because we're doing everything else approximately. 483 00:29:33 --> 00:29:36 So we just have to be sure that we do the integrals with 484 00:29:36 --> 00:29:39 sufficient accuracy so that we don't lose accuracy 485 00:29:39 --> 00:29:41 in the integrals. 486 00:29:41 --> 00:29:44 Of course, with a one we're going to do the 487 00:29:44 --> 00:29:45 integral exactly. 488 00:29:45 --> 00:29:49 But if c(x) was some variable function, I wouldn't have to do 489 00:29:49 --> 00:29:52 it exactly, I would just have to do it with enough accuracy 490 00:29:52 --> 00:29:59 so that I don't lose extra accuracy beyond what I'm losing 491 00:29:59 --> 00:30:02 in the whole Galerkin approximation. 492 00:30:02 --> 00:30:05 OK, ready for that number. 493 00:30:05 --> 00:30:09 What number comes out of that? phi_0', let's graph phi_0'. 494 00:30:11 --> 00:30:14 And of course it's the same as V_0', so can I put 495 00:30:14 --> 00:30:16 a little graph here? 496 00:30:16 --> 00:30:20 Here is zero to one, and I'm going to graph phi_0'. 497 00:30:22 --> 00:30:23 So what's phi_0'? 498 00:30:23 --> 00:30:26 499 00:30:26 --> 00:30:30 Oh, it negative, isn't it? 500 00:30:30 --> 00:30:32 My little graph isn't going to work. 501 00:30:32 --> 00:30:35 I didn't even have room. 502 00:30:35 --> 00:30:39 It's negative. 503 00:30:39 --> 00:30:40 So I'll just write it in words. 504 00:30:40 --> 00:30:44 It's the same as V_0', and what is it? 505 00:30:44 --> 00:30:50 Tell me what it is, what's the derivative of that function? 506 00:30:50 --> 00:30:52 It's what? 507 00:30:52 --> 00:30:54 Negative one. 508 00:30:54 --> 00:30:57 Wait a minute. 509 00:30:57 --> 00:31:01 Yeah, it's going to have a certain value, yeah. 510 00:31:01 --> 00:31:04 You can tell me what it is beyond that point real fast. 511 00:31:04 --> 00:31:13 So it's something up to delta. 512 00:31:13 --> 00:31:15 So what is the slope? 513 00:31:15 --> 00:31:18 What's that slope there, of phi_0? 514 00:31:20 --> 00:31:25 It's not negative one, because remember, what's the base here? 515 00:31:25 --> 00:31:30 That's not the point one, I'm sorry. 516 00:31:30 --> 00:31:36 All these were delta x's. 517 00:31:36 --> 00:31:38 Those were just numbering the nodes. 518 00:31:38 --> 00:31:43 But the actual length is scale is the delta x scale. 519 00:31:43 --> 00:31:46 So now tell me what it is. 520 00:31:46 --> 00:31:52 The derivative is negative one over delta x, right? 521 00:31:52 --> 00:31:56 It dropped by one when it went across by delta x. 522 00:31:56 --> 00:32:02 And this is only up to node one. 523 00:32:02 --> 00:32:06 Up to delta x and then zero afterwards. 524 00:32:06 --> 00:32:09 This is a key point. 525 00:32:09 --> 00:32:14 That all our functions are local. 526 00:32:14 --> 00:32:16 Our functions are local. 527 00:32:16 --> 00:32:18 What does that mean? 528 00:32:18 --> 00:32:24 You can tell me what am I going to get when I integrate, for 529 00:32:24 --> 00:32:29 example, when later on I might be integrating phi_1' 530 00:32:29 --> 00:32:31 against V_4'. 531 00:32:31 --> 00:32:34 532 00:32:34 --> 00:32:37 What's the answer? 533 00:32:37 --> 00:32:39 This is the key point. 534 00:32:39 --> 00:32:43 Later, when I'm looking for the one, four entry, when I'm 535 00:32:43 --> 00:32:47 looking there, I'm going to do an integral of phi_1'. 536 00:32:49 --> 00:32:54 I'll erase for a moment and do this in my head. 537 00:32:54 --> 00:32:59 When I integrate phi_1' against V_4'. 538 00:33:01 --> 00:33:06 Maybe it's the fourth row. 539 00:33:06 --> 00:33:09 And the first guy over, maybe it's this guy I'm doing. 540 00:33:09 --> 00:33:11 Doesn't matter a whole lot. 541 00:33:11 --> 00:33:18 Because the answer is, when I integrate phi_1' against V_4' 542 00:33:18 --> 00:33:22 just, it's nice to get the easy ones. 543 00:33:22 --> 00:33:23 It's zero. 544 00:33:23 --> 00:33:26 Why is it zero? 545 00:33:26 --> 00:33:31 Why is the integral of phi_1' against V_4' zero? 546 00:33:31 --> 00:33:37 Because these phis are local. phi_1' is only non-zero here. 547 00:33:37 --> 00:33:41 V_4' is only non-zero over here. 548 00:33:41 --> 00:33:45 The two don't overlap. 549 00:33:45 --> 00:33:48 Anywhere the one is not zero, the other is zero. 550 00:33:48 --> 00:33:52 So that's a zero there. 551 00:33:52 --> 00:33:59 In fact, our overlaps, I'm just sort of looking ahead here. 552 00:33:59 --> 00:34:05 Our overlaps, a phi overlaps itself, of course. 553 00:34:05 --> 00:34:08 And its right hand neighbor and its left hand neighbor. 554 00:34:08 --> 00:34:13 But nobody two or three or more away. 555 00:34:13 --> 00:34:17 I think our K, all our integrals are going to be zero 556 00:34:17 --> 00:34:21 outside, we'll have another tri-diagonal matrix. 557 00:34:21 --> 00:34:24 We're going to have zeroes all here. 558 00:34:24 --> 00:34:37 And we'll only have entries where phi against V when 559 00:34:37 --> 00:34:40 they're either the same or just differ by one. 560 00:34:40 --> 00:34:45 So we'll only have three diagonals. 561 00:34:45 --> 00:34:48 OK, we were about to find out what that number is. 562 00:34:48 --> 00:34:54 So the slope of this is minus one over delta x, and that's - 563 00:34:54 --> 00:34:59 I'm sorry, let me go back to zero, zero. 564 00:34:59 --> 00:35:02 OK. 565 00:35:02 --> 00:35:06 This is what we're keeping our fingers crossed for. 566 00:35:06 --> 00:35:09 What's that number? 567 00:35:09 --> 00:35:15 So I have this thing, actually is it just squared? 568 00:35:15 --> 00:35:17 And that's the slope. 569 00:35:17 --> 00:35:21 And then the phi and the V I'm choosing the same, so 570 00:35:21 --> 00:35:23 that's the slope again. 571 00:35:23 --> 00:35:28 I think I'm just getting one over delta x squared for that 572 00:35:28 --> 00:35:30 times that times the one. 573 00:35:30 --> 00:35:31 So what's K_00? 574 00:35:33 --> 00:35:35 One over delta x. 575 00:35:35 --> 00:35:37 Where'd the delta x come from? 576 00:35:37 --> 00:35:43 Because we're only integrating over, it looks like zero to 577 00:35:43 --> 00:35:46 one but they're all zero. 578 00:35:46 --> 00:35:50 We're really only integrating, the only reality was 579 00:35:50 --> 00:35:51 out to node one. 580 00:35:51 --> 00:35:53 Out to delta x. 581 00:35:53 --> 00:35:59 You see that the number there, the number here on the 582 00:35:59 --> 00:36:08 diagonal is one over delta x. 583 00:36:08 --> 00:36:14 OK, how about doing K_11 for me? 584 00:36:14 --> 00:36:17 So again, now these guys will be the same guys. 585 00:36:17 --> 00:36:19 It's a square. 586 00:36:19 --> 00:36:24 No it's the integral phi_1' against V_1', they're the same. 587 00:36:24 --> 00:36:31 And what is phi_1', which is the same as V_1'? 588 00:36:32 --> 00:36:35 What's the derivative now? 589 00:36:35 --> 00:36:39 It's, ah. 590 00:36:39 --> 00:36:42 What's the slope of this function? 591 00:36:42 --> 00:36:46 It goes up and goes back down, right? 592 00:36:46 --> 00:36:51 I have a plus part, so the slope going up is the 593 00:36:51 --> 00:36:53 one over delta x. 594 00:36:53 --> 00:36:57 And then the slope coming down is minus one over delta x. 595 00:36:57 --> 00:37:05 So this was up to delta x and then to two delta 596 00:37:05 --> 00:37:08 x, and then zero. 597 00:37:08 --> 00:37:12 That's a much more typical thing, this smoke goes the 598 00:37:12 --> 00:37:16 function, the hat function goes up to the top of the hat. 599 00:37:16 --> 00:37:18 Back down. 600 00:37:18 --> 00:37:21 The slope up and the slope down are easy. 601 00:37:21 --> 00:37:23 And now the integral's easy. 602 00:37:23 --> 00:37:28 So I'm just squaring, well, when I square it, this 603 00:37:28 --> 00:37:30 squared is the one over delta x squared. 604 00:37:30 --> 00:37:34 This is the same, because the minus will get squared. 605 00:37:34 --> 00:37:35 So what's K_11? 606 00:37:37 --> 00:37:41 What's K_11 now? 607 00:37:41 --> 00:37:46 Have you got K_11 in your head? 608 00:37:46 --> 00:37:50 This is one over delta x squared. 609 00:37:50 --> 00:37:54 And now what is the integral? 610 00:37:54 --> 00:37:57 Two over delta x. 611 00:37:57 --> 00:38:04 Because now we're integrating from zero to two delta x, 612 00:38:04 --> 00:38:07 because that's where my functions are going out 613 00:38:07 --> 00:38:09 from zero to node two. 614 00:38:09 --> 00:38:12 If the function's numbered one. 615 00:38:12 --> 00:38:17 So it's two delta x times this; I think we get a two over 616 00:38:17 --> 00:38:22 delta x on that diagonal. 617 00:38:22 --> 00:38:28 Would you care to guess the rest of the diagonal? 618 00:38:28 --> 00:38:34 Yes, you tell me what's K_22 and K_33 and K_44? 619 00:38:36 --> 00:38:37 They're all the same. 620 00:38:37 --> 00:38:39 We're just shifting over. 621 00:38:39 --> 00:38:44 So two over delta x goes down there. 622 00:38:44 --> 00:38:47 Alright, one more to do. 623 00:38:47 --> 00:38:50 One more integral to do. 624 00:38:50 --> 00:38:53 This next guy. 625 00:38:53 --> 00:38:56 So can you tell me what do I get now for K_01? 626 00:38:58 --> 00:39:07 K_01, so now this is the case where I'm in row zero, so this 627 00:39:07 --> 00:39:12 should be V_0, because that tells me the row I'm in. 628 00:39:12 --> 00:39:13 But phi_1. 629 00:39:13 --> 00:39:17 630 00:39:17 --> 00:39:22 What happens when I integrate, just see the picture here. 631 00:39:22 --> 00:39:28 Let me just draw it small. phi_1', so let me draw phi_1. 632 00:39:30 --> 00:39:33 And V_0. 633 00:39:33 --> 00:39:35 OK. 634 00:39:35 --> 00:39:37 But it's the derivatives that I want. 635 00:39:37 --> 00:39:39 It's the slopes that I want, OK? 636 00:39:39 --> 00:39:45 So what do I get from here on out? 637 00:39:45 --> 00:39:48 Zero, because this guy only got to there. 638 00:39:48 --> 00:39:51 That's the half hat, the first guy stopped at delta x. 639 00:39:51 --> 00:39:53 So whatever is happening here is going to be 640 00:39:53 --> 00:39:55 multiplied by zero. 641 00:39:55 --> 00:39:57 So it's just here. 642 00:39:57 --> 00:40:04 One delta x integral for this one. 643 00:40:04 --> 00:40:07 They just overlap in one interval, of course. 644 00:40:07 --> 00:40:11 This guy and its neighbor only overlap in one interval. 645 00:40:11 --> 00:40:15 And what's the deal about the two slopes? 646 00:40:15 --> 00:40:17 They're opposite. 647 00:40:17 --> 00:40:20 One's coming down, one's going up. 648 00:40:20 --> 00:40:23 But the slopes are one over delta x and minus 649 00:40:23 --> 00:40:24 one over delta x. 650 00:40:24 --> 00:40:26 Do you see what's happening here? 651 00:40:26 --> 00:40:26 I'm integrating. 652 00:40:26 --> 00:40:31 Here I have a slowpoke of one over delta x, and here I have a 653 00:40:31 --> 00:40:35 slope of minus one over delta x, so I should multiply those. 654 00:40:35 --> 00:40:41 Minus one over delta x squared integrate, what goes in K_01? 655 00:40:41 --> 00:40:47 What's that number? 656 00:40:47 --> 00:40:53 It's that times that integrated, but now the 657 00:40:53 --> 00:40:58 integral is only going really out to delta x because 658 00:40:58 --> 00:41:01 basically I'm just stopping there. 659 00:41:01 --> 00:41:03 So but there's a minus now. 660 00:41:03 --> 00:41:05 Because it's not the square. 661 00:41:05 --> 00:41:07 It's this times its neighbor. 662 00:41:07 --> 00:41:10 One's going up, and one's going down. 663 00:41:10 --> 00:41:13 So it's delta x squared, and then the length of 664 00:41:13 --> 00:41:23 the integral, this is a minus one over delta x. 665 00:41:23 --> 00:41:28 Would you care to guess the rest of this matrix? 666 00:41:28 --> 00:41:32 What's the rest of that diagonal, above 667 00:41:32 --> 00:41:34 the main diagonal? 668 00:41:34 --> 00:41:36 It's all the same. 669 00:41:36 --> 00:41:44 That stays the same, because when I do phi_2*V_1, my picture 670 00:41:44 --> 00:41:47 is just like shifted over. 671 00:41:47 --> 00:41:50 But I still have one coming down, and one going up. 672 00:41:50 --> 00:41:53 When I do phi_3*V_2, same thing. 673 00:41:53 --> 00:42:00 And if I do phi_1*V_2, it'll be the same. 674 00:42:00 --> 00:42:04 I'm going to get this minus one over delta x all the 675 00:42:04 --> 00:42:07 way on that diagonal, also. 676 00:42:07 --> 00:42:08 Symmetry. 677 00:42:08 --> 00:42:10 It's going to come out symmetric. 678 00:42:10 --> 00:42:14 Actually, since the course started by speaking about 679 00:42:14 --> 00:42:19 properties of matrices, let me just say K is going to turn 680 00:42:19 --> 00:42:21 out to be symmetric positive definite. 681 00:42:21 --> 00:42:24 And what's more, for this example we recognize 682 00:42:24 --> 00:42:27 K completely. 683 00:42:27 --> 00:42:33 You will say why did you take so long to get to this result. 684 00:42:33 --> 00:42:40 K is the one over delta x part times, what's the matrix? 685 00:42:40 --> 00:42:42 It's T. 686 00:42:42 --> 00:42:43 It's T. 687 00:42:43 --> 00:42:49 So it's one, minus one, minus one, two, minus one, minus one, 688 00:42:49 --> 00:42:53 two, minus one, minus one, two, minus one, and I guess 689 00:42:53 --> 00:42:57 we had five of them. 690 00:42:57 --> 00:43:01 Oh, but nobody there, right? 691 00:43:01 --> 00:43:02 That's not there. 692 00:43:02 --> 00:43:06 That fixed, why do we not have a minus one? 693 00:43:06 --> 00:43:09 Because we've got no, there isn't a six. 694 00:43:09 --> 00:43:10 That would be column. 695 00:43:10 --> 00:43:13 We've got one, two, three, four, five columns; there's 696 00:43:13 --> 00:43:20 no U_5, there's no V_5, we've got them all. 697 00:43:20 --> 00:43:27 And the F, so that, so KU, this thing multiplies U_0 to U_4, to 698 00:43:27 --> 00:43:35 U_4, and it produces F, which is one over delta, 699 00:43:35 --> 00:43:39 which is what? 700 00:43:39 --> 00:43:44 Oh, delta x is in the numerator, right. 701 00:43:44 --> 00:43:53 Times a half, one, one, one and one. 702 00:43:53 --> 00:43:56 That is the finite element system KU=F. 703 00:43:56 --> 00:44:00 704 00:44:00 --> 00:44:04 For this simple problem. 705 00:44:04 --> 00:44:06 It's exactly what finite differences did. 706 00:44:06 --> 00:44:11 So you can see why my first introduction to finite elements 707 00:44:11 --> 00:44:15 was with the question what's the difference. 708 00:44:15 --> 00:44:21 The finite element community at that point, this was like 709 00:44:21 --> 00:44:24 the golden age of finite elements, all this was just 710 00:44:24 --> 00:44:26 beginning to be created. 711 00:44:26 --> 00:44:33 These elements were being used. 712 00:44:33 --> 00:44:36 Especially in civil and structural engineering, that's 713 00:44:36 --> 00:44:40 where a lot of the earliest papers came out of. 714 00:44:40 --> 00:44:45 And then, in a model problem it didn't look anything new. 715 00:44:45 --> 00:44:50 It looked like our original finite difference matrix. 716 00:44:50 --> 00:44:55 But there were some new things. 717 00:44:55 --> 00:44:59 First, there was this new 1/2, that we hadn't particularly 718 00:44:59 --> 00:45:02 noticed with finite differences. 719 00:45:02 --> 00:45:04 We we could catch onto that. 720 00:45:04 --> 00:45:06 Here's a minor difference. 721 00:45:06 --> 00:45:10 You notice that the delta x is strictly speaking the delta x 722 00:45:10 --> 00:45:15 is up here then, but when I divide by delta x then I'm back 723 00:45:15 --> 00:45:16 to the finite difference. 724 00:45:16 --> 00:45:19 I have the one over delta x squared, it looks like 725 00:45:19 --> 00:45:22 finite differences again. 726 00:45:22 --> 00:45:24 So everything looks the same. 727 00:45:24 --> 00:45:30 But, of course, if c(x) isn't one or if F(x) 728 00:45:30 --> 00:45:31 isn't one, oh yeah. 729 00:45:31 --> 00:45:37 If c(x) isn't one then I've got integrals to do. 730 00:45:37 --> 00:45:38 I would approximate those. 731 00:45:38 --> 00:45:41 And I could then come out with something that would look 732 00:45:41 --> 00:45:43 like a finite differences. 733 00:45:43 --> 00:45:46 Let me take our other favorite model problem. 734 00:45:46 --> 00:45:51 What would be the F if, yeah, here's a question. 735 00:45:51 --> 00:45:56 What would be the right side if my vector, instead of being 736 00:45:56 --> 00:46:00 one, what's my other favorite choice? 737 00:46:00 --> 00:46:03 Delta. 738 00:46:03 --> 00:46:08 So I take delta at x minus, let me take delta at 739 00:46:08 --> 00:46:10 x minus 1/4, first. 740 00:46:10 --> 00:46:12 Suppose that's my F. 741 00:46:12 --> 00:46:18 Then I've got to change all these guys. 742 00:46:18 --> 00:46:20 And what would they be? 743 00:46:20 --> 00:46:25 What would be the new right hand side when I 744 00:46:25 --> 00:46:33 have this point low? 745 00:46:33 --> 00:46:35 I have to go back to the integrals, right? 746 00:46:35 --> 00:46:38 I have to go back to these guys. 747 00:46:38 --> 00:46:43 These integrals, with that new F, this is now delta of x 748 00:46:43 --> 00:46:48 minus a 1/4, times each V. 749 00:46:48 --> 00:46:52 Times dx, I have to integrate delta of x minus 1/4 750 00:46:52 --> 00:46:54 against every hat function. 751 00:46:54 --> 00:46:56 And see what it equals? 752 00:46:56 --> 00:46:59 And what will I get? 753 00:46:59 --> 00:47:00 You're going to tell me right away. 754 00:47:00 --> 00:47:04 What are those integrals? 755 00:47:04 --> 00:47:08 That's a point load at node one. 756 00:47:08 --> 00:47:14 Times the V integrated over the whole thing. 757 00:47:14 --> 00:47:18 What do I get? 758 00:47:18 --> 00:47:21 I get a one, yeah. 759 00:47:21 --> 00:47:25 That integral is going to pick out the value at a quarter. 760 00:47:25 --> 00:47:27 Right, that's what the delta function does, the 761 00:47:27 --> 00:47:29 spike is at a quarter. 762 00:47:29 --> 00:47:33 Has area one, so it picks out the V_i at a quarter. 763 00:47:33 --> 00:47:37 V_i at a quarter will be? 764 00:47:37 --> 00:47:46 One for the, I think we get a . 765 00:47:46 --> 00:47:56 Again a little bit what our finite differences suggested 766 00:47:56 --> 00:47:59 that we should do. 767 00:47:59 --> 00:48:02 Alright, here's one final one for today. 768 00:48:02 --> 00:48:05 Suppose the delta function is not at a node. 769 00:48:05 --> 00:48:10 Suppose it's at 3/8. 770 00:48:10 --> 00:48:15 Or it could be at any point a, but let me just take a 771 00:48:15 --> 00:48:18 typical, a special one where I can do it. 772 00:48:18 --> 00:48:21 Suppose the load is at 3/8. 773 00:48:22 --> 00:48:27 What do I get for the integrals now? 774 00:48:27 --> 00:48:31 So now, it's delta of x minus 3/8. 775 00:48:31 --> 00:48:40 The spike is at this point here. 776 00:48:40 --> 00:48:44 That's where delta is now, spiking at 3/8. 777 00:48:44 --> 00:48:47 Is that right? 778 00:48:47 --> 00:48:50 We had 1/4, tell me what - oh, I should have 779 00:48:50 --> 00:48:53 had 1/5 before, sorry. 780 00:48:53 --> 00:48:55 Change that on the videotape. 781 00:48:55 --> 00:48:59 All those 1/4s where that 1/4 was 1/5, and 782 00:48:59 --> 00:49:01 now what do I want? 783 00:49:01 --> 00:49:03 Three? 784 00:49:03 --> 00:49:07 I wanted to take a nice one that was halfway. 785 00:49:07 --> 00:49:09 I just forgot what halfway was. 786 00:49:09 --> 00:49:11 Where is halfway there? 787 00:49:11 --> 00:49:16 3/10 now for delta. 788 00:49:16 --> 00:49:19 So that was before I had it for when delta. 789 00:49:19 --> 00:49:28 So previously was delta at x minus 1/5 and now delta at x 790 00:49:28 --> 00:49:34 minus 3/10, what's the F now? 791 00:49:34 --> 00:49:35 What's the F now? 792 00:49:35 --> 00:49:39 So the spike is right in the middle between one and two. 793 00:49:39 --> 00:49:43 What's do those integrals come out to be? 794 00:49:43 --> 00:49:48 If I integrate delta function times the different 795 00:49:48 --> 00:49:51 hats, what do I get? 796 00:49:51 --> 00:49:52 What do I get, yeah. 797 00:49:52 --> 00:49:56 I get a zero for this first guy because it didn't 798 00:49:56 --> 00:49:57 touch the half hat. 799 00:49:57 --> 00:50:00 And then what do I get there? 800 00:50:00 --> 00:50:01 Half. 801 00:50:01 --> 00:50:03 And what do I get at the next one? 802 00:50:03 --> 00:50:04 Half again. 803 00:50:04 --> 00:50:07 And then the other guys it doesn't touch. 804 00:50:07 --> 00:50:09 You see, it automatically does it. 805 00:50:09 --> 00:50:11 Does those smart things. 806 00:50:11 --> 00:50:14 It automatically makes the smart choice. 807 00:50:14 --> 00:50:22 And if the spike was at a, at any point a, then at that 808 00:50:22 --> 00:50:26 typical point a wherever it is, like there, spike 809 00:50:26 --> 00:50:27 could be there. 810 00:50:27 --> 00:50:31 Then I would have, what would I have if the spike was there? 811 00:50:31 --> 00:50:35 I'd have a little bit of phi_3, and a big bit of phi_4. 812 00:50:36 --> 00:50:38 And the two parts would add to one. 813 00:50:38 --> 00:50:40 It would take the right proportion. 814 00:50:40 --> 00:50:47 It would be the proportion, by however much this spike was 815 00:50:47 --> 00:50:50 near there, it would give that extra weight to phi_4. 816 00:50:51 --> 00:50:54 OK. 817 00:50:54 --> 00:50:57 So there is the finite element method. 818 00:50:57 --> 00:51:02 It produced something that you might say, oh, we knew that. 819 00:51:02 --> 00:51:08 But you've got to see that it deals automatically with c(x), 820 00:51:08 --> 00:51:12 it deals automatically with F(x), it deals automatically 821 00:51:12 --> 00:51:13 with the free boundary. 822 00:51:13 --> 00:51:20 You see, the solution there is going to take sort of a 823 00:51:20 --> 00:51:24 balance, a pretty close balance, of this half hat with 824 00:51:24 --> 00:51:29 this one, and the solution will actually be a pretty 825 00:51:29 --> 00:51:30 close to free. 826 00:51:30 --> 00:51:34 It'll be pretty close to having the right zero slope there. 827 00:51:34 --> 00:51:36 OK, good.