1 00:00:00,030 --> 00:00:02,400 The following content is provided under a Creative 2 00:00:02,400 --> 00:00:03,780 Commons license. 3 00:00:03,780 --> 00:00:06,020 Your support will help MIT OpenCourseWare 4 00:00:06,020 --> 00:00:10,100 continue to offer high quality educational resources for free. 5 00:00:10,100 --> 00:00:12,670 To make a donation, or to view additional materials 6 00:00:12,670 --> 00:00:16,405 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:16,405 --> 00:00:17,030 at ocw.mit.edu. 8 00:00:26,230 --> 00:00:29,030 PROFESSOR: OK, now we're recording. 9 00:00:29,030 --> 00:00:33,110 I think about half of my lectures are up on Stella, 10 00:00:33,110 --> 00:00:35,850 because about a quarter, I forgot to push record, 11 00:00:35,850 --> 00:00:38,050 and another quarter, something went astray 12 00:00:38,050 --> 00:00:42,460 with the microphone, and all you hear is like, blegh-egh-egh. 13 00:00:42,460 --> 00:00:44,420 But there's about half of them up there, 14 00:00:44,420 --> 00:00:45,880 the most important ones. 15 00:00:45,880 --> 00:00:48,290 OK, so the residual is the remainder 16 00:00:48,290 --> 00:00:53,693 when an approximate solution is substituted into the governing 17 00:00:53,693 --> 00:00:54,192 PDE. 18 00:00:57,360 --> 00:01:01,310 And remember, what's so powerful about the residual 19 00:01:01,310 --> 00:01:03,830 is that we can take an approximate solution, 20 00:01:03,830 --> 00:01:07,310 we can see how close the PDE is to being satisfied, 21 00:01:07,310 --> 00:01:10,011 which gives us some idea of how good that solution is, 22 00:01:10,011 --> 00:01:12,510 but we don't actually need to know the true solution, right? 23 00:01:12,510 --> 00:01:14,218 We don't need to know the exact solution. 24 00:01:14,218 --> 00:01:16,270 So this is different to an error. 25 00:01:16,270 --> 00:01:19,225 But it is some measure of how far our PDE is 26 00:01:19,225 --> 00:01:20,100 from being satisfied. 27 00:01:20,100 --> 00:01:22,558 And so it turns out that this is a really useful thing when 28 00:01:22,558 --> 00:01:28,550 we're looking for finding good approximate solutions. 29 00:01:28,550 --> 00:01:32,590 And the example that we worked with the most 30 00:01:32,590 --> 00:01:36,500 was the diffusion or heat equation, 31 00:01:36,500 --> 00:01:41,160 which we wrote as K dT / dx, all differentiated 32 00:01:41,160 --> 00:01:44,460 with respect to x, equal to minus q, 33 00:01:44,460 --> 00:01:46,867 where q is the heat source. 34 00:01:46,867 --> 00:01:48,450 So I can just write the x's down here. 35 00:01:48,450 --> 00:01:51,026 This is notation for differentiation with respect 36 00:01:51,026 --> 00:01:51,526 to x. 37 00:01:55,640 --> 00:01:58,030 So if that is our governing equation, 38 00:01:58,030 --> 00:02:01,950 and we have an approximate solution that we 39 00:02:01,950 --> 00:02:10,460 call T tilde of x, then the residual 40 00:02:10,460 --> 00:02:12,920 would be [? r. ?] It's a function 41 00:02:12,920 --> 00:02:14,530 of that approximate solution. 42 00:02:14,530 --> 00:02:17,414 It's also a function of x. 43 00:02:17,414 --> 00:02:20,200 And it would be defined as bring everything over 44 00:02:20,200 --> 00:02:21,470 to the left-hand side. 45 00:02:21,470 --> 00:02:25,390 So K, then substitute in the approximate solution. 46 00:02:25,390 --> 00:02:32,690 So d T tilde / dx, all differentiated, plus q. 47 00:02:32,690 --> 00:02:35,440 So that would be the definition of the residual. 48 00:02:35,440 --> 00:02:38,560 And if the approximate solution were exact-- in other words, 49 00:02:38,560 --> 00:02:44,720 if we put not T tilde, but T in here, the residual would be 0. 50 00:02:44,720 --> 00:02:46,640 And so remember, we define the residuals. 51 00:02:46,640 --> 00:02:52,160 And then we said, let's say that this approximate solution, 52 00:02:52,160 --> 00:02:55,910 T tilde, is discretized and represented 53 00:02:55,910 --> 00:02:57,932 with n degrees of freedom. 54 00:02:57,932 --> 00:02:59,140 And there are different ways. 55 00:02:59,140 --> 00:03:01,460 We could use a Fourier-type analysis 56 00:03:01,460 --> 00:03:04,600 and assume that this thing is a linear combination of sines 57 00:03:04,600 --> 00:03:06,980 and cosines, or when we get to finite element, 58 00:03:06,980 --> 00:03:08,910 we could assume it's linear combinations 59 00:03:08,910 --> 00:03:10,850 of these special hat functions. 60 00:03:10,850 --> 00:03:14,140 But whatever it is, if we have n degrees of freedom representing 61 00:03:14,140 --> 00:03:16,430 our approximate solution, then we 62 00:03:16,430 --> 00:03:19,620 need n conditions to be able to solve 63 00:03:19,620 --> 00:03:21,300 for that approximate solution. 64 00:03:21,300 --> 00:03:24,160 And we talked about two different ways to get to that. 65 00:03:24,160 --> 00:03:27,480 One was the collocation method, where, remember, 66 00:03:27,480 --> 00:03:34,590 we set the residual to be 0 at the collocation points. 67 00:03:34,590 --> 00:03:40,930 So required the residual to be 0 at, 68 00:03:40,930 --> 00:03:46,150 let's say, capital N points, where this approximate solution 69 00:03:46,150 --> 00:03:50,460 here is represented with n degrees of freedom. 70 00:03:50,460 --> 00:03:52,170 So that was the collocation method, 71 00:03:52,170 --> 00:03:55,500 pinning the residual down to be 0 at n points, which gave us 72 00:03:55,500 --> 00:03:57,170 the n conditions that let us solve 73 00:03:57,170 --> 00:03:58,740 for the n degrees of freedom. 74 00:03:58,740 --> 00:04:04,320 Or the method of weighted residuals, which said, 75 00:04:04,320 --> 00:04:11,230 let's instead define the j-th weighted residual, 76 00:04:11,230 --> 00:04:14,520 where what we do is we take the residual, 77 00:04:14,520 --> 00:04:17,880 we weight it by another basis function, 78 00:04:17,880 --> 00:04:21,230 and then we integrate over the domain. 79 00:04:21,230 --> 00:04:25,750 So that means the j-th weighted residual-- still 80 00:04:25,750 --> 00:04:28,045 a function of our approximate solution 81 00:04:28,045 --> 00:04:34,640 T-- is some weighting function, Wj, 82 00:04:34,640 --> 00:04:41,939 times our residual, integrated over [? our ?] 1D domain. 83 00:04:46,430 --> 00:04:49,160 So define the j-th weighted residual in this way. 84 00:04:51,890 --> 00:04:53,105 That would be the first step. 85 00:04:53,105 --> 00:04:54,480 And then the second step would be 86 00:04:54,480 --> 00:05:00,390 to require that n weighted residuals now are equal to 0. 87 00:05:13,180 --> 00:05:15,680 You guys remember all of this? 88 00:05:15,680 --> 00:05:16,532 Yeah? 89 00:05:16,532 --> 00:05:18,210 And then remember, the key is now, OK, 90 00:05:18,210 --> 00:05:20,660 what are these weighting functions? 91 00:05:20,660 --> 00:05:22,490 And you remember, we talked specifically 92 00:05:22,490 --> 00:05:27,590 about a kind of weighting called Galerkin weighting, which says, 93 00:05:27,590 --> 00:05:30,666 choose the weighting functions to be the same basis 94 00:05:30,666 --> 00:05:32,290 vectors, the same functions that you're 95 00:05:32,290 --> 00:05:36,996 using to approximate the T tilde and its n degrees of freedom. 96 00:05:36,996 --> 00:05:41,630 And so that's what's key about a Galerkin method 97 00:05:41,630 --> 00:05:46,870 of weighted residuals, is that the weighting functions 98 00:05:46,870 --> 00:05:55,410 are the same as the functions used 99 00:05:55,410 --> 00:05:57,290 to approximate [? as ?] a solution. 100 00:06:15,600 --> 00:06:18,115 And again, then requiring n of those weighted residuals 101 00:06:18,115 --> 00:06:22,110 to be equal to 0 gave us, remember, the n-by-n system, 102 00:06:22,110 --> 00:06:25,150 where each row in the system was the equation that 103 00:06:25,150 --> 00:06:26,910 said Rj equals 0. 104 00:06:26,910 --> 00:06:28,770 And each column in the matrix system 105 00:06:28,770 --> 00:06:31,350 corresponded to the unknown degree of freedom 106 00:06:31,350 --> 00:06:35,220 describing our approximate solution, T tilde. 107 00:06:35,220 --> 00:06:37,780 OK, so that's the method of weighted residuals. 108 00:06:37,780 --> 00:06:40,310 But actually, I think once you understand that, you have, 109 00:06:40,310 --> 00:06:41,889 more or less, all the building blocks 110 00:06:41,889 --> 00:06:43,180 to then move to finite element. 111 00:06:45,870 --> 00:06:51,140 And so what's the jump in terms of finite element 112 00:06:51,140 --> 00:06:54,590 is that finite element uses a very specific kind 113 00:06:54,590 --> 00:06:57,510 of basis function that represents 114 00:06:57,510 --> 00:07:00,690 a solution in this special way that then turns out 115 00:07:00,690 --> 00:07:03,910 to have really nice properties. 116 00:07:03,910 --> 00:07:06,930 And there are a variety of basis functions 117 00:07:06,930 --> 00:07:10,324 that you can use, depending on what kind of an approximation 118 00:07:10,324 --> 00:07:12,365 you want, whether you want a linear approximation 119 00:07:12,365 --> 00:07:15,390 in each element, or quadratic approximation, 120 00:07:15,390 --> 00:07:17,780 or even higher order. 121 00:07:17,780 --> 00:07:21,340 And what did we talk about? 122 00:07:21,340 --> 00:07:25,850 So we talked about finite element basis functions 123 00:07:25,850 --> 00:07:26,875 in 1D and 2D. 124 00:07:32,030 --> 00:07:37,405 And we talked mostly about the nodal basis. 125 00:07:42,980 --> 00:07:44,932 And I think we talked even mostly 126 00:07:44,932 --> 00:07:46,140 about the linear nodal basis. 127 00:07:46,140 --> 00:07:46,681 I'm not sure. 128 00:07:46,681 --> 00:07:50,820 Did Vikram talk about the quadratic basis for 1D 129 00:07:50,820 --> 00:07:53,064 in the lecture that he gave? 130 00:07:53,064 --> 00:07:53,870 No. 131 00:07:53,870 --> 00:07:58,829 So I think maybe you saw only the linear nodal basis. 132 00:08:03,050 --> 00:08:13,780 So e.g., if we look at the linear nodal basis in 1D, 133 00:08:13,780 --> 00:08:16,340 remember that these hat functions, 134 00:08:16,340 --> 00:08:18,940 they have the property that they are 135 00:08:18,940 --> 00:08:24,306 0 at all nodes except their own node, where they're equal to 1. 136 00:08:24,306 --> 00:08:31,590 So this is a plot of [? bi. ?] And it's got a value of 1 137 00:08:31,590 --> 00:08:35,960 at node xi. 138 00:08:35,960 --> 00:08:40,390 It goes to 0 at node xi plus 1. 139 00:08:40,390 --> 00:08:46,440 And then it stays 0 for all nodes 140 00:08:46,440 --> 00:08:47,820 to the right of xi plus 1. 141 00:08:47,820 --> 00:08:53,570 It also goes to 0 at xi minus 1 and stays to 0. 142 00:08:53,570 --> 00:08:55,320 So the basis function is actually 143 00:08:55,320 --> 00:08:59,370 defined on the whole domain at 0, and then it's up to 1, 144 00:08:59,370 --> 00:09:04,580 down to 0, and then stays at 0 for the rest. 145 00:09:04,580 --> 00:09:06,880 And then, just to run by the finite element notation, 146 00:09:06,880 --> 00:09:12,280 we talked about element i as being the element-- the piece 147 00:09:12,280 --> 00:09:15,299 of the x-axis that lies between xi and xi plus 1. 148 00:09:15,299 --> 00:09:16,840 The element to the left is i minus 1. 149 00:09:16,840 --> 00:09:21,470 The element to the right is element i plus 1. 150 00:09:21,470 --> 00:09:23,590 And what's key about these basis functions 151 00:09:23,590 --> 00:09:25,670 is that they're 0 in most of the domain. 152 00:09:25,670 --> 00:09:28,550 The only place where Ci is non-zero 153 00:09:28,550 --> 00:09:31,205 is on element i minus 1 and element i. 154 00:09:31,205 --> 00:09:33,580 And we use that fact when we get all those integrals that 155 00:09:33,580 --> 00:09:36,610 come out of the definition of the weighted residual, 156 00:09:36,610 --> 00:09:38,730 that a whole bunch of integrals go to 0, right? 157 00:09:38,730 --> 00:09:40,670 Because you're multiplying things together 158 00:09:40,670 --> 00:09:44,310 that are 0 on big parts of the domain. 159 00:09:47,831 --> 00:09:48,330 All right. 160 00:09:48,330 --> 00:09:54,410 Questions about [? your ?] [? advisor ?] remembering this? 161 00:09:54,410 --> 00:09:54,910 Yes. 162 00:09:57,884 --> 00:09:59,550 Any questions about either of those two? 163 00:10:04,530 --> 00:10:08,830 So I will next just remind you about integration 164 00:10:08,830 --> 00:10:09,940 in the reference element. 165 00:10:25,630 --> 00:10:26,410 What's the idea? 166 00:10:26,410 --> 00:10:35,580 Well, first of all, in 1D we have things 167 00:10:35,580 --> 00:10:38,620 in the physical x domain. 168 00:10:38,620 --> 00:10:42,700 So we have xj, say, and xj plus 1. 169 00:10:42,700 --> 00:10:45,230 And the idea is that the elements 170 00:10:45,230 --> 00:10:47,160 could be all those different [? links, ?] 171 00:10:47,160 --> 00:10:49,260 depending on how we decided to make the bridge, 172 00:10:49,260 --> 00:10:51,009 based on what's going on with the physics. 173 00:10:51,009 --> 00:10:53,360 So the j-th element might be a lot bigger 174 00:10:53,360 --> 00:10:55,850 than the j minus 1 element, or smaller, 175 00:10:55,850 --> 00:10:57,340 or however we'd like to do it. 176 00:10:57,340 --> 00:11:01,800 And what we'd like to do is map to the [? xc ?] 177 00:11:01,800 --> 00:11:09,190 space where the element goes from minus 1 to 1. 178 00:11:09,190 --> 00:11:16,200 So every element in the x space, element j going from xj 179 00:11:16,200 --> 00:11:19,090 to xj plus 1, could be mapped to the reference element 180 00:11:19,090 --> 00:11:23,140 in the [? xc ?] space that goes from minus 1 to 1. 181 00:11:23,140 --> 00:11:25,640 And the mapping that does that is 182 00:11:25,640 --> 00:11:38,560 x-- as a function of [? xc ?] is xj plus 1/2, 1 plus [? xc ?] 183 00:11:38,560 --> 00:11:42,170 times xj plus 1 minus xj. 184 00:11:42,170 --> 00:11:44,670 And you should be able to see that when I set [? xc ?] equal 185 00:11:44,670 --> 00:11:46,620 to minus 1, I get xj. 186 00:11:46,620 --> 00:11:51,490 And when I set [? xc ?] equal to plus 1, these terms cancel out 187 00:11:51,490 --> 00:11:52,680 and I get xj plus 1. 188 00:11:52,680 --> 00:11:55,910 And then everything in between is just the linear mapping. 189 00:11:55,910 --> 00:12:00,860 The middle point here is the middle point here, and so on. 190 00:12:00,860 --> 00:12:03,450 So that's what it looks like in 1D. 191 00:12:03,450 --> 00:12:07,290 In 2D, we need to map to the reference element, 192 00:12:07,290 --> 00:12:13,030 which is a standard triangle. 193 00:12:13,030 --> 00:12:18,710 So in 2D, we have a generic element 194 00:12:18,710 --> 00:12:20,770 that might look something like that, 195 00:12:20,770 --> 00:12:22,250 where it's got coordinates. 196 00:12:22,250 --> 00:12:29,620 Now I'll say x1,y1, x2,y2, and x3,y3. 197 00:12:29,620 --> 00:12:33,130 Those are the xy coordinates of the three 198 00:12:33,130 --> 00:12:36,110 nodes in this element. 199 00:12:36,110 --> 00:12:39,300 And I want to map it to the reference element, which again, 200 00:12:39,300 --> 00:12:43,270 is in [? xc ?] space, which, remember, 201 00:12:43,270 --> 00:12:49,840 looks like this right triangle with this node at 0,0, 202 00:12:49,840 --> 00:12:54,600 this guy at 1,0, and this guy here at 0,1. 203 00:12:54,600 --> 00:12:57,730 This is coordinate direction [? xc1 ?] and this is 204 00:12:57,730 --> 00:13:03,506 coordinate direction [? xc2. ?] And again, 205 00:13:03,506 --> 00:13:05,880 we can write down the generic mapping just like we did it 206 00:13:05,880 --> 00:13:06,920 here. 207 00:13:06,920 --> 00:13:14,440 We now have to map x and y, and they are given by x1-- 208 00:13:14,440 --> 00:13:22,240 the mapping at x1,y1 plus a matrix that looks like x2 minus 209 00:13:22,240 --> 00:13:30,860 x1, x3 minus x1, y2 minus y1, y3 minus y1, 210 00:13:30,860 --> 00:13:32,120 times [? xc1 ?] [? xc2. ?] 211 00:13:38,480 --> 00:13:40,540 Just in the same way as here, we can 212 00:13:40,540 --> 00:13:43,416 see that varying xc from minus 1 to 1 213 00:13:43,416 --> 00:13:45,297 gave back xj and xj plus 1. 214 00:13:45,297 --> 00:13:46,630 You can see the same thing here. 215 00:13:46,630 --> 00:13:50,120 If you vary [? xc1 ?] and [? xc2 ?] from the 0,0 point, 216 00:13:50,120 --> 00:13:53,076 clearly 0,0 is going to give you back x1,y1. 217 00:13:53,076 --> 00:13:56,760 1,0 should give you the x2,y2, and 0,1 should give you 218 00:13:56,760 --> 00:13:57,330 the x3,y3. 219 00:14:00,110 --> 00:14:02,885 So you can define these transformations. 220 00:14:02,885 --> 00:14:04,290 And this is generic, right? 221 00:14:04,290 --> 00:14:06,510 I can now give any element, any triangle, 222 00:14:06,510 --> 00:14:09,605 and you can always get me to a reference triangle. 223 00:14:09,605 --> 00:14:10,980 And what that means is that, now, 224 00:14:10,980 --> 00:14:12,690 when you do the integrations that show up 225 00:14:12,690 --> 00:14:19,700 in the finite element method-- so an integral over, let's say, 226 00:14:19,700 --> 00:14:27,290 a domain, over element K, some function, function of x, these 227 00:14:27,290 --> 00:14:29,290 are the kind of integrals that show up in the 2D 228 00:14:29,290 --> 00:14:30,810 finite element method. 229 00:14:30,810 --> 00:14:34,285 We can now do an integration over the reference elemental, 230 00:14:34,285 --> 00:14:37,320 [INAUDIBLE] omega [? xc. ?] We're now 231 00:14:37,320 --> 00:14:41,920 writing f as a function of x of [? xc. ?] 232 00:14:41,920 --> 00:14:43,850 And what we need to do is to introduce 233 00:14:43,850 --> 00:14:48,150 the Jacobian of the mapping so that we can now 234 00:14:48,150 --> 00:14:52,480 integrate with respect to the reference element. 235 00:14:52,480 --> 00:14:55,080 And the Jacobian here, this is just 236 00:14:55,080 --> 00:14:56,577 the determinant of this matrix. 237 00:14:56,577 --> 00:14:58,285 Can't remember, but I think you guys must 238 00:14:58,285 --> 00:15:00,076 have done this with Vikram, because I think 239 00:15:00,076 --> 00:15:02,280 I was away [INAUDIBLE] yeah? 240 00:15:02,280 --> 00:15:04,320 So we end up with this j, and this j here 241 00:15:04,320 --> 00:15:11,620 is just the determinant of this x2 minus x1, x3 minus x1, y2 242 00:15:11,620 --> 00:15:15,840 minus y1, y3 minus y1. 243 00:15:15,840 --> 00:15:20,800 So basically, this accounts for the change in area, 244 00:15:20,800 --> 00:15:24,110 because you're integrating over this guy That gives you 245 00:15:24,110 --> 00:15:26,277 the reference element. 246 00:15:26,277 --> 00:15:28,360 Sometimes I think it seems a little bit messy when 247 00:15:28,360 --> 00:15:29,180 you see it written down. 248 00:15:29,180 --> 00:15:31,555 But the reality is it makes you code really clean, right? 249 00:15:31,555 --> 00:15:33,740 Because you just introduced these mappings, and then 250 00:15:33,740 --> 00:15:35,239 every single integration in the code 251 00:15:35,239 --> 00:15:36,880 takes place over the reference element. 252 00:15:36,880 --> 00:15:39,390 You just go account for the mappings from whichever element 253 00:15:39,390 --> 00:15:43,930 you happen to be in through the determinant of this matrix. 254 00:15:46,495 --> 00:15:49,510 Is that good? 255 00:15:49,510 --> 00:15:54,440 OK, so somewhat related to that, because we'll 256 00:15:54,440 --> 00:15:56,990 still talking about integration, was Gaussian quadrature. 257 00:16:00,028 --> 00:16:03,600 A really simple idea, but quite powerful, 258 00:16:03,600 --> 00:16:07,150 and you had a chance to practice that on the last homework. 259 00:16:07,150 --> 00:16:15,540 So remember, for Guassian quadrature, 260 00:16:15,540 --> 00:16:18,150 for the simple examples that we worked through in class, 261 00:16:18,150 --> 00:16:20,800 we could do the integrals analytically, 262 00:16:20,800 --> 00:16:24,029 because we were integrating constants, or linear functions. 263 00:16:24,029 --> 00:16:25,945 So we were integrating things like e to the x, 264 00:16:25,945 --> 00:16:27,280 or xc to the x. 265 00:16:27,280 --> 00:16:29,410 But in practice, for real problems, 266 00:16:29,410 --> 00:16:32,910 you may end up with integrals that you can't do analytically, 267 00:16:32,910 --> 00:16:36,000 either in the stiffness matrix or in the right-hand side 268 00:16:36,000 --> 00:16:38,630 system, on the system. 269 00:16:38,630 --> 00:16:40,770 So if you can't do the integrals analytically, 270 00:16:40,770 --> 00:16:44,530 then you resort to Gaussian quadrature. 271 00:16:44,530 --> 00:16:46,240 And remember that Gaussian quadrature 272 00:16:46,240 --> 00:16:49,210 in 1D looks like this. 273 00:16:49,210 --> 00:16:53,530 If we're trying to integrate some function, g of xi, 274 00:16:53,530 --> 00:16:57,170 over the domain minus 1 to 1, we approximate 275 00:16:57,170 --> 00:17:04,410 that as the sum of the function evaluated at quadrature points 276 00:17:04,410 --> 00:17:09,980 xi i weighted by weighting coefficient alpha i, 277 00:17:09,980 --> 00:17:15,240 and it's the sum from i equals 1 to nq. 278 00:17:15,240 --> 00:17:18,984 So nq here is the number of quadrature points. 279 00:17:18,984 --> 00:17:22,383 Number of quadrature points. 280 00:17:22,383 --> 00:17:27,730 [? xci ?] here is the i-th quadrature point, 281 00:17:27,730 --> 00:17:30,950 and alpha i here is the i-th quadrature weighting. 282 00:17:39,210 --> 00:17:41,370 Do you remember-- where do the rules come from? 283 00:17:41,370 --> 00:17:44,056 How do we figure out the [? xci ?] [? alpha i ?] 284 00:17:44,056 --> 00:17:51,744 [? pairs? ?] Perfect integration of a polynomial. 285 00:17:51,744 --> 00:17:57,180 So if, for example, we wanted to just use one quadrature point, 286 00:17:57,180 --> 00:17:58,850 then we would say, with one point 287 00:17:58,850 --> 00:18:01,625 we can perfectly integrate a linear function, right? 288 00:18:01,625 --> 00:18:04,386 Because if I take any linear function, 289 00:18:04,386 --> 00:18:07,170 and what I'm interested in is the area under the function, 290 00:18:07,170 --> 00:18:10,030 I can get that perfectly by just evaluating its midpoint, 291 00:18:10,030 --> 00:18:13,491 and the area of the rectangle is the same area of the-- 292 00:18:13,491 --> 00:18:14,904 what is this thing called? 293 00:18:14,904 --> 00:18:15,850 AUDIENCE: Trapezoid. 294 00:18:15,850 --> 00:18:18,818 PROFESSOR: Trapezoid, yeah. 295 00:18:18,818 --> 00:18:21,790 So with one quadrature point, I can typically 296 00:18:21,790 --> 00:18:23,370 integrate a linear function. 297 00:18:23,370 --> 00:18:26,950 And I would do that by setting alpha 1 equal to 2 298 00:18:26,950 --> 00:18:29,320 and xc 1 equal to 0. 299 00:18:29,320 --> 00:18:32,600 So again, midpoint and the area. 300 00:18:32,600 --> 00:18:35,010 If I am willing to have two quadrature points, 301 00:18:35,010 --> 00:18:37,220 it turns out that I can integrate linear functions 302 00:18:37,220 --> 00:18:41,150 exactly, I can integrate quadratics exactly, 303 00:18:41,150 --> 00:18:44,660 and I can actually also integrate cubics exactly. 304 00:18:44,660 --> 00:18:47,000 And it turns out that the weights 305 00:18:47,000 --> 00:18:52,120 I should choose are alpha 2 equals 1 and quadrature points 306 00:18:52,120 --> 00:18:55,760 at plus or minus 1 over root 3. 307 00:18:55,760 --> 00:18:58,040 And again, those points are chosen 308 00:18:58,040 --> 00:19:01,544 to give perfect integration of polynomials. 309 00:19:04,150 --> 00:19:08,810 And of course, when we apply those quadrature schemes 310 00:19:08,810 --> 00:19:12,470 to non-polynomial functions, we introduce an approximation, 311 00:19:12,470 --> 00:19:15,120 but typically that's something that we're 312 00:19:15,120 --> 00:19:18,220 willing to tolerate so that we use not too many quadrature 313 00:19:18,220 --> 00:19:22,540 points in the scheme. 314 00:19:22,540 --> 00:19:25,260 OK, questions about reference elements 315 00:19:25,260 --> 00:19:26,362 or Guassian quadrature? 316 00:19:29,038 --> 00:19:31,275 Is that good? 317 00:19:31,275 --> 00:19:32,050 Yeah, Kevin. 318 00:19:32,050 --> 00:19:34,515 AUDIENCE: [INAUDIBLE] just slightly [INAUDIBLE] 319 00:19:34,515 --> 00:19:35,994 quadrature. 320 00:19:35,994 --> 00:19:39,691 This is on [INAUDIBLE] assuming there's no quadrature that 321 00:19:39,691 --> 00:19:42,400 can approximate [INAUDIBLE] 322 00:19:42,400 --> 00:19:44,190 PROFESSOR: Yeah. 323 00:19:44,190 --> 00:19:47,950 So the question is that-- so it's not only for polynomials, 324 00:19:47,950 --> 00:19:49,370 but these are the points that are 325 00:19:49,370 --> 00:19:53,210 derived by considering exact integration of polynomials. 326 00:19:53,210 --> 00:19:56,610 And yes, absolutely, there are other famous quadrature 327 00:19:56,610 --> 00:19:57,730 schemes. 328 00:19:57,730 --> 00:20:00,282 There are Chebyshev points, and there 329 00:20:00,282 --> 00:20:02,740 are all kinds of points that are derived in different ways. 330 00:20:02,740 --> 00:20:04,198 Some of them are derived by looking 331 00:20:04,198 --> 00:20:06,446 at sinusoidal functions. 332 00:20:06,446 --> 00:20:08,370 Yeah, absolutely. 333 00:20:08,370 --> 00:20:12,762 Yeah, it's a whole study of math, quadrature points 334 00:20:12,762 --> 00:20:13,720 and quadrature schemes. 335 00:20:13,720 --> 00:20:15,573 It's actually kind of neat stuff. 336 00:20:15,573 --> 00:20:16,072 Yeah. 337 00:20:19,720 --> 00:20:25,770 All right, so let's move on and talk about boundary conditions, 338 00:20:25,770 --> 00:20:27,830 and then we'll close by forming the system. 339 00:20:27,830 --> 00:20:32,860 And then, that will be finite element in a nutshell. 340 00:20:40,550 --> 00:20:43,650 Number five is boundary conditions. 341 00:20:43,650 --> 00:20:47,870 And the main types of boundary conditions that we discussed 342 00:20:47,870 --> 00:20:51,870 were Dirichlet, where, remember, for a Dirichlet condition, 343 00:20:51,870 --> 00:20:59,505 you specify-- what do we specify? 344 00:20:59,505 --> 00:21:00,850 Yeah, the value of the unknown. 345 00:21:00,850 --> 00:21:01,850 The solution at a point. 346 00:21:06,820 --> 00:21:13,060 And for a Dirichlet condition, we 347 00:21:13,060 --> 00:21:21,470 are going to replace the weighted residual equation. 348 00:21:21,470 --> 00:21:24,045 So we're going to form the system, 349 00:21:24,045 --> 00:21:26,580 we're going to look at forming the system in just a second. 350 00:21:26,580 --> 00:21:30,020 But we already said that setting each weighted residual 351 00:21:30,020 --> 00:21:34,700 equal to 0 gives us one row in our matrix system, right? 352 00:21:34,700 --> 00:21:38,430 One row corresponds to the equation [? Rj ?] equals 0. 353 00:21:38,430 --> 00:21:41,110 So if there's a Dirichlet condition in a node-- that's 354 00:21:41,110 --> 00:21:43,720 usually at the boundary, maybe at the first one-- 355 00:21:43,720 --> 00:21:44,580 we're going to come in and we're going 356 00:21:44,580 --> 00:21:46,788 to strike out that weighted residual equation that we 357 00:21:46,788 --> 00:21:48,955 got from multiplying by [? c1 ?] and getting 358 00:21:48,955 --> 00:21:50,080 the weighted residual to 0. 359 00:21:50,080 --> 00:21:52,390 We're going to strike that out and replace it 360 00:21:52,390 --> 00:21:56,830 with an equation that might look like 10000 equals to whatever 361 00:21:56,830 --> 00:21:58,080 the Dirichlet condition is. 362 00:21:58,080 --> 00:22:00,177 Then we're going to fit the value. 363 00:22:00,177 --> 00:22:01,760 And we have to be a little bit careful 364 00:22:01,760 --> 00:22:04,426 and make sure that we're setting truly the value of the unknown. 365 00:22:04,426 --> 00:22:05,940 If we're using the nodal basis-- I 366 00:22:05,940 --> 00:22:08,439 guess I didn't state explicitly when I drew the nodal basis, 367 00:22:08,439 --> 00:22:13,090 but what's so special about the nodal basis? 368 00:22:13,090 --> 00:22:15,132 What does it mean for the unknowns? 369 00:22:20,469 --> 00:22:22,510 Yeah, that's right, that the unknown coefficients 370 00:22:22,510 --> 00:22:24,020 that you solve for turn out to be 371 00:22:24,020 --> 00:22:26,310 the values of the approximate solution at the node. 372 00:22:26,310 --> 00:22:29,110 And that's because, by construction, those basis 373 00:22:29,110 --> 00:22:32,520 functions are 1 at their own node and 0 everywhere else. 374 00:22:32,520 --> 00:22:34,300 So if you're using the nodal basis, 375 00:22:34,300 --> 00:22:36,850 the unknown coefficients correspond 376 00:22:36,850 --> 00:22:40,069 to the value of the approximate solution at the node. 377 00:22:40,069 --> 00:22:41,860 Which means that for a Dirichlet condition, 378 00:22:41,860 --> 00:22:43,960 you can directly manipulate that coefficient. 379 00:22:47,070 --> 00:22:49,120 And then the other kind of boundary condition 380 00:22:49,120 --> 00:22:51,960 that we talked about was a Neumann condition, where 381 00:22:51,960 --> 00:22:53,690 now you specify the flux. 382 00:22:56,930 --> 00:23:00,095 And what we see is that when we do the weighted residual, when 383 00:23:00,095 --> 00:23:04,610 you integrate by parts, you get a term 384 00:23:04,610 --> 00:23:09,300 out that is a boundary term that's where the flux shows up 385 00:23:09,300 --> 00:23:10,300 exactly. 386 00:23:10,300 --> 00:23:13,460 And so a Neumann condition contributes 387 00:23:13,460 --> 00:23:14,550 to the weighted residual. 388 00:23:14,550 --> 00:23:16,350 You'll see its place exactly in the derivation 389 00:23:16,350 --> 00:23:18,350 of your weighted residual, where you can go in-- 390 00:23:18,350 --> 00:23:20,445 if the Neumann condition is flux equal to 0, 391 00:23:20,445 --> 00:23:22,720 it basically strikes out that term. 392 00:23:22,720 --> 00:23:24,726 If it's a non-zero, a non-homogenous Neumann 393 00:23:24,726 --> 00:23:27,100 condition, then you could go in and put that contribution 394 00:23:27,100 --> 00:23:28,620 as the flux. 395 00:23:28,620 --> 00:23:34,140 So in this case, you leave the weighted residual equation, 396 00:23:34,140 --> 00:23:37,580 but you add the contribution. 397 00:23:37,580 --> 00:23:40,734 So two different boundary conditions, two different 398 00:23:40,734 --> 00:23:41,400 implementations. 399 00:23:45,975 --> 00:23:48,350 And so what this means is it's an additional contribution 400 00:23:48,350 --> 00:23:49,440 to the stiffness matrix. 401 00:24:00,660 --> 00:24:01,940 So it's getting a little low. 402 00:24:01,940 --> 00:24:04,530 It says, add contribution to weighted residual, additional 403 00:24:04,530 --> 00:24:06,323 contribution to stiffness matrix. 404 00:24:17,190 --> 00:24:19,940 OK, so last thing. 405 00:24:19,940 --> 00:24:22,240 I'll just kind of put all those pieces together 406 00:24:22,240 --> 00:24:25,310 for the 1D diffusion, and then finally, 407 00:24:25,310 --> 00:24:30,745 end with just showing how the matrix system gets formed. 408 00:24:34,020 --> 00:24:34,520 Yep? 409 00:24:34,520 --> 00:24:35,395 AUDIENCE: [INAUDIBLE] 410 00:24:38,010 --> 00:24:39,010 PROFESSOR: That's right. 411 00:24:39,010 --> 00:24:41,320 The Robin condition is a combination of the two. 412 00:24:41,320 --> 00:24:45,364 So there's a Dirichlet component and a Neumann component. 413 00:24:45,364 --> 00:24:46,780 I don't know if you actually did-- 414 00:24:46,780 --> 00:24:48,270 were they discussed in the finite element? 415 00:24:48,270 --> 00:24:49,210 They were mostly discussed in, I think, 416 00:24:49,210 --> 00:24:51,260 the finite volume, finite difference section. 417 00:24:51,260 --> 00:24:53,679 But yeah, it's just a combination. 418 00:24:53,679 --> 00:24:55,470 We've put something in the right-hand side. 419 00:24:55,470 --> 00:24:56,206 What's that? 420 00:24:56,206 --> 00:24:56,940 AUDIENCE: We had them in the project. 421 00:24:56,940 --> 00:24:57,920 PROFESSOR: Oh, you had them in the project. 422 00:24:57,920 --> 00:25:00,086 So then you know how to do them, right? 423 00:25:00,086 --> 00:25:01,580 Or you know how not to do them. 424 00:25:01,580 --> 00:25:03,062 [LAUGHTER] 425 00:25:05,038 --> 00:25:07,020 Yeah. 426 00:25:07,020 --> 00:25:13,730 OK, so just as the last bringing it all together, 427 00:25:13,730 --> 00:25:19,860 let's think about finite element for 1D diffusion, 428 00:25:19,860 --> 00:25:22,669 and we need to make sure that you are clear that you 429 00:25:22,669 --> 00:25:23,960 can go through all these steps. 430 00:25:23,960 --> 00:25:29,880 So starting off with the governing equation, K dT / dx, 431 00:25:29,880 --> 00:25:31,643 differentiated again with respect 432 00:25:31,643 --> 00:25:37,925 to x, equals minus q on the domain minus L over 2 to L 433 00:25:37,925 --> 00:25:39,665 over 2 [INAUDIBLE] x. 434 00:25:42,647 --> 00:25:48,330 So let's see. 435 00:25:48,330 --> 00:25:50,340 We would write the approximate solution, 436 00:25:50,340 --> 00:25:59,430 T of x, as being the sum from i equals 1 to n 437 00:25:59,430 --> 00:26:06,859 of sum ai times Ci of x. 438 00:26:06,859 --> 00:26:09,420 These here are our finite element basis functions. 439 00:26:09,420 --> 00:26:13,600 We might, for example, choose to use the linear nodal basis, 440 00:26:13,600 --> 00:26:15,100 those hat functions. 441 00:26:18,370 --> 00:26:20,930 So again, those ai, the unknown coefficients 442 00:26:20,930 --> 00:26:23,010 that we're going to solve for, are 443 00:26:23,010 --> 00:26:25,210 going to end up corresponding to the value 444 00:26:25,210 --> 00:26:28,530 of our approximate solution at the nodes in the finite element 445 00:26:28,530 --> 00:26:29,630 mesh. 446 00:26:29,630 --> 00:26:33,229 We want to write down, then, the j-th weighted residual. 447 00:26:39,145 --> 00:26:46,400 We'll call it [? Rj. ?] And what is it? 448 00:26:46,400 --> 00:26:51,220 It's take everything over on the left-hand side, substitute 449 00:26:51,220 --> 00:26:53,900 in the approximate solution. 450 00:26:53,900 --> 00:26:57,810 So we're going to get a K d T tilde / dx, all differentiated, 451 00:26:57,810 --> 00:26:59,620 plus q. 452 00:26:59,620 --> 00:27:02,880 Weight it with the j-th spaces function. 453 00:27:02,880 --> 00:27:05,630 And because it's Galerkin, we're going to use the same C. 454 00:27:05,630 --> 00:27:10,190 So we weight it with Cj, and then integrate over the domain, 455 00:27:10,190 --> 00:27:13,040 integrate from minus L over 2 to L over 2. 456 00:27:13,040 --> 00:27:14,690 I could write out all the steps, but I 457 00:27:14,690 --> 00:27:16,940 think you've seen it many times in the notes. 458 00:27:16,940 --> 00:27:19,148 So we get that, and then what's the next thing we do? 459 00:27:24,620 --> 00:27:25,250 What do we do? 460 00:27:27,836 --> 00:27:30,490 What's the first thing-- what are we going to end up with? 461 00:27:30,490 --> 00:27:34,250 We're going to end up with [? Cxx. ?] 462 00:27:37,020 --> 00:27:38,820 We can assume K is constant, if you want. 463 00:27:38,820 --> 00:27:41,830 We're going to end up with [? Cxx's ?] multiplied by C, 464 00:27:41,830 --> 00:27:44,080 so we're going to end up with [INAUDIBLE] the integral 465 00:27:44,080 --> 00:27:46,690 of [? C ?] times the second derivative of C with respect 466 00:27:46,690 --> 00:27:47,310 to x. 467 00:27:47,310 --> 00:27:48,750 What do we do? 468 00:27:48,750 --> 00:27:50,300 Integrate by parts. 469 00:27:50,300 --> 00:27:52,660 [? Usually you ?] always [INAUDIBLE] integrate by parts. 470 00:27:52,660 --> 00:27:55,380 That's going to move one differential off the C, 471 00:27:55,380 --> 00:27:58,590 onto the other C. Yeah. 472 00:27:58,590 --> 00:28:04,430 So get the approximate solution, substitute it in, 473 00:28:04,430 --> 00:28:06,810 bring everything to the left-hand side, multiply by Cj, 474 00:28:06,810 --> 00:28:07,950 and integrate. 475 00:28:07,950 --> 00:28:10,510 Integrate by parts, and when you integrate by parts-- 476 00:28:10,510 --> 00:28:13,175 I can write it out, if you feel uncomfortable, 477 00:28:13,175 --> 00:28:15,050 but again, I think you've seen it many times, 478 00:28:15,050 --> 00:28:15,966 and it's in the notes. 479 00:28:15,966 --> 00:28:19,120 I'm going to keep the T tilde, rather than writing the sum. 480 00:28:19,120 --> 00:28:21,654 This thing is really the sum of the [? ai's ?] times 481 00:28:21,654 --> 00:28:22,570 the [? Ci's, ?] right? 482 00:28:22,570 --> 00:28:24,320 But I'm just going to write it as T tilde, 483 00:28:24,320 --> 00:28:26,560 because I think it's a little bit clearer. 484 00:28:26,560 --> 00:28:28,780 You can [INAUDIBLE] if you're working through things, 485 00:28:28,780 --> 00:28:31,600 feel free to leave the T tilde in there 486 00:28:31,600 --> 00:28:33,240 until you get to the bottom, so you 487 00:28:33,240 --> 00:28:34,448 don't have to write too many. 488 00:28:34,448 --> 00:28:36,789 So there's the-- we're integrating v to u, 489 00:28:36,789 --> 00:28:38,580 so there's the [? uv ?] term that comes out 490 00:28:38,580 --> 00:28:41,420 on the boundaries, out of the integration by parts, 491 00:28:41,420 --> 00:28:47,110 minus now the integral where we have moved-- 492 00:28:47,110 --> 00:28:49,060 we're going to differentiate Cj, and this 493 00:28:49,060 --> 00:28:51,200 is the Cj that's coming from the weighting 494 00:28:51,200 --> 00:28:53,630 for the j-th weighted residual. 495 00:28:53,630 --> 00:28:56,510 And then our other one has been integrated, so now we just 496 00:28:56,510 --> 00:29:00,712 have a K d T tilde / dx. 497 00:29:00,712 --> 00:29:03,020 dx. 498 00:29:03,020 --> 00:29:05,860 And then we have the q term, which 499 00:29:05,860 --> 00:29:10,500 looks like an integral from minus L over 2 to L over 2. 500 00:29:10,500 --> 00:29:13,190 And again, it's the Cj times q dx. 501 00:29:13,190 --> 00:29:15,090 We don't have to do any integration by parts. 502 00:29:15,090 --> 00:29:18,940 This side just stays the way it is. 503 00:29:18,940 --> 00:29:22,360 So I jumped one step there, but again, the [? first line ?] 504 00:29:22,360 --> 00:29:26,510 of the residual would have a Cj times this full term with the T 505 00:29:26,510 --> 00:29:27,790 tilde there. 506 00:29:27,790 --> 00:29:31,180 One step of integration by parts gives us the boundary term 507 00:29:31,180 --> 00:29:33,270 minus the integral with one derivative 508 00:29:33,270 --> 00:29:35,250 on the Cj, the weighting Cj, and one derivative 509 00:29:35,250 --> 00:29:37,630 on the approximate solution. 510 00:29:37,630 --> 00:29:40,170 Yes? 511 00:29:40,170 --> 00:29:42,450 No? 512 00:29:42,450 --> 00:29:43,710 Yes? 513 00:29:43,710 --> 00:29:45,710 OK. 514 00:29:45,710 --> 00:29:49,780 So where do all the bits go? 515 00:29:49,780 --> 00:29:52,850 Here is if we had a Neumann condition. 516 00:29:52,850 --> 00:29:54,990 This is where this contribution would go. 517 00:29:54,990 --> 00:29:55,490 Yeah? 518 00:29:59,860 --> 00:30:06,480 This term here is going to give us the stiffness matrix, 519 00:30:06,480 --> 00:30:09,386 and this term here is going to give us the right-hand side. 520 00:30:09,386 --> 00:30:09,886 Yep. 521 00:30:15,190 --> 00:30:22,020 Let's just remember how all that goes together, conceptually. 522 00:30:25,961 --> 00:30:28,464 This guy here is going to go to our stiffness matrix. 523 00:30:33,870 --> 00:30:36,220 This guy here is going to go the right-hand side. 524 00:30:40,450 --> 00:30:52,390 And if we think about just integral xj minus 1 to xj 525 00:30:52,390 --> 00:31:01,256 plus 1 of Cj x K d T tilde / dx. 526 00:31:04,672 --> 00:31:08,088 So why did I change the limits here? 527 00:31:08,088 --> 00:31:09,552 AUDIENCE: [INAUDIBLE] 528 00:31:11,710 --> 00:31:13,008 PROFESSOR: What is it? 529 00:31:13,008 --> 00:31:13,960 Mumble a bit louder. 530 00:31:13,960 --> 00:31:14,460 Yeah? 531 00:31:14,460 --> 00:31:15,756 AUDIENCE: [INAUDIBLE] 532 00:31:15,997 --> 00:31:17,580 PROFESSOR: Yeah, because we're looking 533 00:31:17,580 --> 00:31:18,470 at the j-th weighted residual. 534 00:31:18,470 --> 00:31:20,470 We've got the Cj x sitting out in front here, 535 00:31:20,470 --> 00:31:24,020 and we know-- again, if you sketch the Cj x, 536 00:31:24,020 --> 00:31:27,200 you know that it's only non-zero over elements 537 00:31:27,200 --> 00:31:30,570 that go from xj minus 1 to xj and xj to xj plus 1. 538 00:31:30,570 --> 00:31:34,100 So all the other parts of the integral go to 0. 539 00:31:34,100 --> 00:31:36,230 So that's the only bit that's left. 540 00:31:36,230 --> 00:31:40,840 And again, I'll skip over a few steps, 541 00:31:40,840 --> 00:31:42,640 but it's all derived in the notes. 542 00:31:42,640 --> 00:31:47,870 If you then substitute in the T tilde [? has been ?] the sum 543 00:31:47,870 --> 00:31:51,070 of the [? ai ?] times the [? Ci's, ?] again, 544 00:31:51,070 --> 00:31:52,960 a lot of the [? Ci's ?] are going to be 0. 545 00:31:52,960 --> 00:31:56,820 The only ones that are going to be non-zero on this part 546 00:31:56,820 --> 00:32:04,330 are going to be this one, so Ci equal to Cj, and then 547 00:32:04,330 --> 00:32:05,220 this one, right? 548 00:32:05,220 --> 00:32:08,320 Ci equal to Cj minus 1. 549 00:32:08,320 --> 00:32:10,180 So itself and its left neighbor are 550 00:32:10,180 --> 00:32:14,400 the only ones that are going to be non-zero over this. 551 00:32:14,400 --> 00:32:17,730 Because in the next one-- oh, and this guy here. 552 00:32:17,730 --> 00:32:18,580 And this guy here. 553 00:32:18,580 --> 00:32:19,746 That's right, there you are. 554 00:32:19,746 --> 00:32:20,529 Three of them. 555 00:32:20,529 --> 00:32:22,570 Itself, its left neighbor, and its right neighbor 556 00:32:22,570 --> 00:32:25,525 are all going to contribute to the way I've written it, 557 00:32:25,525 --> 00:32:27,470 this full integral. 558 00:32:27,470 --> 00:32:29,390 And so what does it end up looking like? 559 00:32:29,390 --> 00:32:31,098 It ends up looking something like there's 560 00:32:31,098 --> 00:32:39,550 an a j minus an a j minus 1 over delta x j minus 1 squared, 561 00:32:39,550 --> 00:32:44,670 and here are I've left in the K. If K were a constant, 562 00:32:44,670 --> 00:32:46,434 it would just be coming out. 563 00:32:46,434 --> 00:32:47,850 And then there's another term that 564 00:32:47,850 --> 00:32:53,225 looks like a j plus 1 minus a j over delta x j 565 00:32:53,225 --> 00:32:59,760 squared integral x j to xj plus 1. 566 00:32:59,760 --> 00:33:04,220 OK, so I mean you could work through all of these, 567 00:33:04,220 --> 00:33:05,980 but what's the important concept? 568 00:33:05,980 --> 00:33:09,000 The important concept is that-- let me draw this a little bit 569 00:33:09,000 --> 00:33:11,530 more clearly. 570 00:33:11,530 --> 00:33:16,294 The important concept is that when you're an-- x j-- always 571 00:33:16,294 --> 00:33:17,960 draw the picture for yourself, because I 572 00:33:17,960 --> 00:33:20,220 think it really helps. 573 00:33:20,220 --> 00:33:22,270 Don't get too embroiled in trying to integrate 574 00:33:22,270 --> 00:33:23,547 things and plug things in. 575 00:33:23,547 --> 00:33:24,630 It's easy to make mistake. 576 00:33:24,630 --> 00:33:27,083 Just think about where things are going to be going. 577 00:33:27,083 --> 00:33:29,730 So there's Cj. 578 00:33:33,950 --> 00:33:35,515 There Cj plus 1. 579 00:33:40,320 --> 00:33:44,891 And there's Cj minus 1. 580 00:33:47,540 --> 00:33:50,820 So when we think about this element, 581 00:33:50,820 --> 00:33:52,700 the j minus 1 element, which goes 582 00:33:52,700 --> 00:33:56,640 from x j minus 1 to x j, which two get activated? 583 00:33:56,640 --> 00:33:58,426 It's j minus 1 and j. 584 00:33:58,426 --> 00:34:01,469 So we expect the coefficients aj and aj minus 1 585 00:34:01,469 --> 00:34:03,510 to be the ones that are going to get coefficients 586 00:34:03,510 --> 00:34:05,676 put in front of them in the stiffness matrix, right? 587 00:34:05,676 --> 00:34:06,510 Nothing else. 588 00:34:06,510 --> 00:34:10,671 And when we think about this element, xj and xj-- from xj 589 00:34:10,671 --> 00:34:12,650 to xj plus 1, this is the j-th element, 590 00:34:12,650 --> 00:34:15,480 it's Cj and Cj plus 1 that are going to get activated. 591 00:34:15,480 --> 00:34:19,780 So we expect to see coefficients aj and aj plus 1, 592 00:34:19,780 --> 00:34:23,150 with something [? multiplying ?] them. 593 00:34:23,150 --> 00:34:29,010 And so before we went through we worked out all the integrals, 594 00:34:29,010 --> 00:34:33,310 again, you could do it by just plugging and substituting, 595 00:34:33,310 --> 00:34:36,000 but you could also just think, conceptually, 596 00:34:36,000 --> 00:34:39,196 what is the system going to look like? 597 00:34:39,196 --> 00:34:40,654 At the end of the day, you're going 598 00:34:40,654 --> 00:34:45,949 to end up with a big matrix, the stiffness matrix, multiplying 599 00:34:45,949 --> 00:34:48,960 these unknown coefficients, which correspond 600 00:34:48,960 --> 00:34:53,350 to the approximate solution at the nodes in the finite element 601 00:34:53,350 --> 00:34:56,510 [? match, ?] and then the right-hand side. 602 00:35:01,280 --> 00:35:07,840 And again, remember that the j-th row 603 00:35:07,840 --> 00:35:13,780 corresponds to setting the j-th weighted residual equal to 0. 604 00:35:13,780 --> 00:35:16,590 So each row in the matrix comes from setting a weighted 605 00:35:16,590 --> 00:35:21,160 residual equal to 0, and then each column-- 606 00:35:21,160 --> 00:35:32,710 so i-th column multiplies [? an ?] [? ai. ?] So how does 607 00:35:32,710 --> 00:35:34,910 this system start looking? 608 00:35:34,910 --> 00:35:37,249 Well, we know if this were the first element, 609 00:35:37,249 --> 00:35:38,290 we would be getting what? 610 00:35:41,860 --> 00:35:44,350 [? c1 ?] and a [? c2, ?] so we might get entries here 611 00:35:44,350 --> 00:35:45,290 and here. 612 00:35:45,290 --> 00:35:47,150 Although, if we had a Dirichlet condition, 613 00:35:47,150 --> 00:35:54,460 we'd see 0 [AUDIO OUT] entries. 614 00:35:59,579 --> 00:36:00,620 First, second, and third. 615 00:36:03,540 --> 00:36:06,890 The matrix starts to look like this. 616 00:36:06,890 --> 00:36:09,880 And again, it's because when we do the j-th weighted residual, 617 00:36:09,880 --> 00:36:12,340 which is here, we're going to trigger contributions to j 618 00:36:12,340 --> 00:36:16,470 minus 1, to j, and to j plus 1. 619 00:36:16,470 --> 00:36:18,750 And that's because the j-th weighting function, 620 00:36:18,750 --> 00:36:20,870 again, triggers two elements, the j 621 00:36:20,870 --> 00:36:25,440 minus 1 element and the j-th element. 622 00:36:25,440 --> 00:36:28,920 OK, so I think [INAUDIBLE] two sets 623 00:36:28,920 --> 00:36:30,050 of skills you have to have. 624 00:36:30,050 --> 00:36:31,190 One is that you have to be comfortable 625 00:36:31,190 --> 00:36:33,565 doing the integration, writing down the weighted residual 626 00:36:33,565 --> 00:36:36,080 and doing integration by parts. 627 00:36:36,080 --> 00:36:37,603 And then the other is not to lose 628 00:36:37,603 --> 00:36:40,980 sight of the big picture of forming this matrix system. 629 00:36:40,980 --> 00:36:43,309 Columns correspond to the unknowns, 630 00:36:43,309 --> 00:36:45,100 rows correspond to j-th weighted residuals, 631 00:36:45,100 --> 00:36:47,391 and it has a very specific structure because of the way 632 00:36:47,391 --> 00:36:48,773 we choose the nodal basis. 633 00:36:54,395 --> 00:36:54,895 Questions? 634 00:36:58,652 --> 00:37:00,360 You guys feel like you have a good handle 635 00:37:00,360 --> 00:37:01,380 on the finite element? 636 00:37:08,310 --> 00:37:10,990 Is that a no, or a yes, or you will 637 00:37:10,990 --> 00:37:13,746 have by Monday and Tuesday? 638 00:37:13,746 --> 00:37:19,810 So the last thing I want to do is go back, 639 00:37:19,810 --> 00:37:26,170 and I want to remind you that I've given you 640 00:37:26,170 --> 00:37:30,690 a very specific list of measurable outcomes, which 641 00:37:30,690 --> 00:37:33,630 represent the things that I want you to take away 642 00:37:33,630 --> 00:37:34,542 from the class. 643 00:37:34,542 --> 00:37:36,000 And so when I construct assessments 644 00:37:36,000 --> 00:37:37,791 like the final exam, that's what I'm doing, 645 00:37:37,791 --> 00:37:39,750 is I'm trying to measure those outcomes. 646 00:37:39,750 --> 00:37:44,030 So if-- when you are studying for the final exam, 647 00:37:44,030 --> 00:37:47,370 going back to those measurable outcomes and going through them 648 00:37:47,370 --> 00:37:52,400 I think is, hopefully, a really helpful guide for you. 649 00:37:52,400 --> 00:37:58,840 Because it really, again-- let me get plugged in here-- 650 00:37:58,840 --> 00:38:01,270 really, again, tells you exactly what 651 00:38:01,270 --> 00:38:04,150 it is that I want you to be able to do. 652 00:38:04,150 --> 00:38:06,370 So let's go through them. 653 00:38:06,370 --> 00:38:08,910 And I just-- so I've pulled them. 654 00:38:08,910 --> 00:38:13,270 And I'll go back to the [INAUDIBLE] site, or the MITx 655 00:38:13,270 --> 00:38:14,465 site where they are. 656 00:38:14,465 --> 00:38:18,740 But starting at Measurable Outcome 212, this one is, 657 00:38:18,740 --> 00:38:23,434 "Describe"-- and I also want to point out that the verbs are 658 00:38:23,434 --> 00:38:28,229 also important-- "Describe how the method of weighted 659 00:38:28,229 --> 00:38:30,270 residuals can be used to calculate an approximate 660 00:38:30,270 --> 00:38:31,015 solution to a PDE." 661 00:38:31,015 --> 00:38:32,470 Hopefully, you feel comfortable with that. 662 00:38:32,470 --> 00:38:34,110 "Describe the differences between method 663 00:38:34,110 --> 00:38:36,026 of weighted residuals and collocation method." 664 00:38:36,026 --> 00:38:38,810 We didn't actually talk about least squares, so just 665 00:38:38,810 --> 00:38:40,150 the first two. 666 00:38:40,150 --> 00:38:42,560 "Describe the Galerkin method of weighted residuals." 667 00:38:42,560 --> 00:38:44,930 And we just went over all of that. 668 00:38:44,930 --> 00:38:47,490 Then under finite element, describe the choice 669 00:38:47,490 --> 00:38:50,290 of approximate solutions, which are sometimes 670 00:38:50,290 --> 00:38:51,420 called the test functions. 671 00:38:51,420 --> 00:38:53,544 So that's the choice of the [? Ci's ?] that you use 672 00:38:53,544 --> 00:38:55,220 to approximate the solution. 673 00:38:55,220 --> 00:38:57,900 Give examples of a basis, in particular, 674 00:38:57,900 --> 00:38:58,980 including a nodal basis. 675 00:38:58,980 --> 00:39:00,200 And I've crossed out the quadratic, 676 00:39:00,200 --> 00:39:02,325 because I don't think [? Vikrum ?] actually covered 677 00:39:02,325 --> 00:39:03,380 it in that lecture. 678 00:39:03,380 --> 00:39:05,680 But if you're comfortable with the linear nodal basis, 679 00:39:05,680 --> 00:39:07,196 that will be good. 680 00:39:07,196 --> 00:39:08,820 To describe how integrals are performed 681 00:39:08,820 --> 00:39:10,310 using a reference element. 682 00:39:10,310 --> 00:39:13,140 Explain how Guassian quadrature rules are derived, 683 00:39:13,140 --> 00:39:16,010 and also how they're used, in terms of doing integrations 684 00:39:16,010 --> 00:39:18,530 in the reference element for the finite element. 685 00:39:18,530 --> 00:39:20,730 We went through all of these. 686 00:39:20,730 --> 00:39:23,020 Explain how Dirichlet and Neumann boundary conditions 687 00:39:23,020 --> 00:39:25,770 are implemented for the diffusion equation, 688 00:39:25,770 --> 00:39:27,784 or Laplace's equation. 689 00:39:27,784 --> 00:39:33,230 So Robin not actually necessary for the finite element. 690 00:39:33,230 --> 00:39:35,930 And then describe how that all goes together and gives you 691 00:39:35,930 --> 00:39:38,470 this system of discrete equations. 692 00:39:38,470 --> 00:39:40,810 Describe the meaning of the entries, rows and columns. 693 00:39:40,810 --> 00:39:42,500 So again, this is what I was meaning 694 00:39:42,500 --> 00:39:44,570 by, this is kind of the big picture, right? 695 00:39:44,570 --> 00:39:45,710 Now, to do the integrals and come up 696 00:39:45,710 --> 00:39:47,160 with numbers is one thing, but explaining 697 00:39:47,160 --> 00:39:49,284 what the system means, and what all the pieces are, 698 00:39:49,284 --> 00:39:52,340 and how they go together, is important. 699 00:39:52,340 --> 00:39:56,450 So I think that's essentially what we just covered. 700 00:39:56,450 --> 00:40:02,080 And I also want to remind you that if you go to the MITx web 701 00:40:02,080 --> 00:40:04,700 page, so there's the Courseware where the notes are, 702 00:40:04,700 --> 00:40:06,574 but remember, there's this Measurable Outcome 703 00:40:06,574 --> 00:40:10,540 Index that has all the measurable outcomes. 704 00:40:10,540 --> 00:40:13,539 And they're also linked to the notes. 705 00:40:13,539 --> 00:40:15,330 And I know one piece of feedback I've heard 706 00:40:15,330 --> 00:40:17,860 is that it would be really helpful to be able to search 707 00:40:17,860 --> 00:40:19,115 on this web page. 708 00:40:19,115 --> 00:40:20,990 I know you can't search, but this is actually 709 00:40:20,990 --> 00:40:24,420 one way to navigate, that we could come in here 710 00:40:24,420 --> 00:40:26,840 and click on one of these. 711 00:40:26,840 --> 00:40:29,480 And I think our tagging is pretty thorough, 712 00:40:29,480 --> 00:40:30,990 but as you click on that, here are 713 00:40:30,990 --> 00:40:33,882 all the places in the notes where-- in particular one, 714 00:40:33,882 --> 00:40:36,090 describe how integrals are performed in the reference 715 00:40:36,090 --> 00:40:39,740 element-- these are the sections in the notes that relate 716 00:40:39,740 --> 00:40:41,770 to this measurable outcome, and then these 717 00:40:41,770 --> 00:40:44,350 are the sections in the notes that have embedded questions 718 00:40:44,350 --> 00:40:45,210 in them. 719 00:40:45,210 --> 00:40:47,360 So again, if you're looking for a study guide, 720 00:40:47,360 --> 00:40:49,230 going through these measurable outcomes, 721 00:40:49,230 --> 00:40:50,896 and going back and looking at the notes, 722 00:40:50,896 --> 00:40:57,810 and making sure that you can execute whatever it says here. 723 00:40:57,810 --> 00:40:58,310 Yep. 724 00:41:01,370 --> 00:41:05,350 OK, any questions about finite element? 725 00:41:11,000 --> 00:41:13,012 You guys look worried or tired. 726 00:41:15,930 --> 00:41:17,156 OK. 727 00:41:17,156 --> 00:41:19,280 All right, so I'm going to do the same thing, then, 728 00:41:19,280 --> 00:41:20,840 for probabilistic analysis and optimization. 729 00:41:20,840 --> 00:41:22,298 I'll go through a bit more quickly, 730 00:41:22,298 --> 00:41:25,920 just because hopefully that stuff is a little bit fresher. 731 00:41:25,920 --> 00:41:29,955 But again, I just want to touch on the main topics. 732 00:41:29,955 --> 00:41:31,580 We'll hit the high points on the board, 733 00:41:31,580 --> 00:41:34,038 and then we'll just take a look at the measurable outcomes. 734 00:41:34,038 --> 00:41:35,690 And particularly, I just want to make 735 00:41:35,690 --> 00:41:37,680 sure you're clear on a lot the last bits, which 736 00:41:37,680 --> 00:41:39,780 are a little bit introductory, what it is that I expect 737 00:41:39,780 --> 00:41:40,655 you to be able to do. 738 00:41:47,984 --> 00:41:50,400 Does it feel like you've learned a lot since spring break? 739 00:41:50,400 --> 00:41:52,120 Remember on spring break, wherever you guys were, 740 00:41:52,120 --> 00:41:54,560 in Florida or whatever, you didn't know finite element. 741 00:41:54,560 --> 00:41:56,537 You didn't know Monte Carlo. 742 00:41:56,537 --> 00:41:58,620 You maybe didn't know anything about optimization. 743 00:41:58,620 --> 00:42:00,560 It seems like a long time ago, no? 744 00:42:03,560 --> 00:42:06,648 AUDIENCE: It's a long time, but a short time. 745 00:42:06,648 --> 00:42:07,606 PROFESSOR: It's a what? 746 00:42:07,606 --> 00:42:08,689 AUDIENCE: Long short time. 747 00:42:08,689 --> 00:42:10,292 PROFESSOR: A long short time? 748 00:42:10,292 --> 00:42:11,284 AUDIENCE: [INAUDIBLE] 749 00:42:14,377 --> 00:42:15,252 PROFESSOR: All right. 750 00:42:22,196 --> 00:42:25,417 So over there are the six main topics 751 00:42:25,417 --> 00:42:27,250 that we've covered in probabilistic analysis 752 00:42:27,250 --> 00:42:30,920 and optimization, the basics of Monte Carlo, 753 00:42:30,920 --> 00:42:32,390 the Monte Carlo estimators. 754 00:42:32,390 --> 00:42:34,160 We talked about various reduction methods. 755 00:42:34,160 --> 00:42:36,040 We talked about design of experiment methods 756 00:42:36,040 --> 00:42:37,490 for sampling. 757 00:42:37,490 --> 00:42:40,270 We did a very basic intro to design optimization, 758 00:42:40,270 --> 00:42:42,680 and then we talked about responsiveness models 759 00:42:42,680 --> 00:42:44,038 in the last lecture. 760 00:42:44,038 --> 00:42:50,750 So let's just go through and-- where are my notes? 761 00:42:56,260 --> 00:42:59,355 So this is probabilistic analysis and optimization, 762 00:42:59,355 --> 00:43:03,036 so I'm going to start numbering from 1 again. 763 00:43:03,036 --> 00:43:07,710 So again, Monte Carlo simulation, I hope by now, 764 00:43:07,710 --> 00:43:13,290 after the project, you feel pretty comfortable 765 00:43:13,290 --> 00:43:15,210 with the idea. 766 00:43:15,210 --> 00:43:17,920 I think the little block diagram says a lot. 767 00:43:17,920 --> 00:43:20,890 If we have a model, we have inputs. 768 00:43:20,890 --> 00:43:25,180 Maybe we have x1, x2, and x3, and maybe the model 769 00:43:25,180 --> 00:43:28,400 produces one or more outputs. 770 00:43:28,400 --> 00:43:32,400 So inputs, in this case, maybe just a single output 771 00:43:32,400 --> 00:43:34,150 is always considered. 772 00:43:34,150 --> 00:43:39,870 That we want to represent our inputs as random variables, 773 00:43:39,870 --> 00:43:44,360 and so if we propagate random variables through the model, 774 00:43:44,360 --> 00:43:46,935 then our output will also be a random variable. 775 00:43:52,220 --> 00:43:56,470 And the idea of Monte Carlo simulation 776 00:43:56,470 --> 00:43:58,595 is really quite simple. 777 00:43:58,595 --> 00:44:02,300 Remember, we broke it into the three steps. 778 00:44:02,300 --> 00:44:08,176 The first step is to define the input PDEs. 779 00:44:08,176 --> 00:44:09,880 So once you make the decision that you 780 00:44:09,880 --> 00:44:11,840 want to-- not PDEs, PDFs. 781 00:44:16,250 --> 00:44:17,760 Input PDFs. 782 00:44:17,760 --> 00:44:21,540 Once you decide you want to model these things 783 00:44:21,540 --> 00:44:23,839 as random variables, you have to come up with some way 784 00:44:23,839 --> 00:44:25,380 where you can probabilistic analysis, 785 00:44:25,380 --> 00:44:28,330 some way of describing what kind of distribution 786 00:44:28,330 --> 00:44:29,720 these guys follow. 787 00:44:29,720 --> 00:44:31,870 And for pretty much everything that we did, 788 00:44:31,870 --> 00:44:33,030 those were given to you. 789 00:44:33,030 --> 00:44:34,780 Remember I said that, in practice, this is 790 00:44:34,780 --> 00:44:36,520 a really difficult thing to do. 791 00:44:36,520 --> 00:44:38,460 You can use data that you might have collected 792 00:44:38,460 --> 00:44:40,750 from manufacturing, or you might query experts, 793 00:44:40,750 --> 00:44:44,780 but you somehow have to come up and define the input PDFs. 794 00:44:44,780 --> 00:44:48,700 Then, once you have those PDFs defined, 795 00:44:48,700 --> 00:44:50,125 you sample your inputs randomly. 796 00:44:59,410 --> 00:45:03,280 Each random [? draw ?] you solve by running through the model, 797 00:45:03,280 --> 00:45:08,250 and so what this means is that if we make capital N samples, 798 00:45:08,250 --> 00:45:09,890 then we have to do n solves. 799 00:45:09,890 --> 00:45:13,650 So each solve is going to be one run of our model, 800 00:45:13,650 --> 00:45:15,540 which might be a finite element model 801 00:45:15,540 --> 00:45:20,590 or whatever kind of stimulation it would be. 802 00:45:20,590 --> 00:45:24,790 So now we've taken N samples, we've run the model n times, 803 00:45:24,790 --> 00:45:29,020 we have n samples of the output, and the third step 804 00:45:29,020 --> 00:45:32,526 is to analyze those resulting samples. 805 00:45:32,526 --> 00:45:40,303 So analyze the resulting samples of the output, 806 00:45:40,303 --> 00:45:43,270 or outputs, if there's more than one. 807 00:45:43,270 --> 00:45:45,277 And in particular, we might be-- well, 808 00:45:45,277 --> 00:45:47,547 we're usually interested in estimating 809 00:45:47,547 --> 00:45:48,505 statistics of interest. 810 00:45:52,650 --> 00:45:55,070 Statistics of interest. 811 00:45:55,070 --> 00:45:59,620 And those statistics might include means, variances, 812 00:45:59,620 --> 00:46:08,510 probabilities of failure, or whatever it 813 00:46:08,510 --> 00:46:11,410 is that we want to calculate. 814 00:46:15,210 --> 00:46:20,270 And if these inputs are uniform random variables, 815 00:46:20,270 --> 00:46:23,080 then drawing a sample from them is pretty straightforward. 816 00:46:23,080 --> 00:46:26,445 You can draw them just randomly [? under ?] [? 01. ?] If these 817 00:46:26,445 --> 00:46:29,100 things are not uniform random variables, then, remember, 818 00:46:29,100 --> 00:46:32,370 we talked about the inversion method, where you use the CDF, 819 00:46:32,370 --> 00:46:34,640 you generate a uniform random variable, 820 00:46:34,640 --> 00:46:37,430 which is like picking where you're going to be on the CDF, 821 00:46:37,430 --> 00:46:38,980 go along, invert through the CDF, 822 00:46:38,980 --> 00:46:40,760 and that gives you a sample of x. 823 00:46:40,760 --> 00:46:43,440 And in doing that, by sampling uniformly on this axis, 824 00:46:43,440 --> 00:46:45,410 remember, we graphically saw that that 825 00:46:45,410 --> 00:46:48,032 puts the right [? entity ?] of points on the x-axis. 826 00:46:48,032 --> 00:46:50,640 And again, you implemented that in the project 827 00:46:50,640 --> 00:46:53,400 with the triangular distributions. 828 00:46:53,400 --> 00:46:54,380 What? 829 00:46:54,380 --> 00:46:55,850 AUDIENCE: [INAUDIBLE] 830 00:47:02,240 --> 00:47:03,532 PROFESSOR: Nothing awful. 831 00:47:03,532 --> 00:47:04,860 Yeah. 832 00:47:04,860 --> 00:47:07,110 I think the triangular is the only one that's 833 00:47:07,110 --> 00:47:10,380 really analytically tractable. 834 00:47:10,380 --> 00:47:11,730 AUDIENCE: [INAUDIBLE] 835 00:47:14,900 --> 00:47:15,810 PROFESSOR: Yeah. 836 00:47:15,810 --> 00:47:18,773 I'm not going to have you do Monte Carlo simulation by hand. 837 00:47:18,773 --> 00:47:19,460 [LAUGHTER] 838 00:47:19,460 --> 00:47:22,775 Although it could be interesting. 839 00:47:22,775 --> 00:47:24,900 We could correlate your grade with how many samples 840 00:47:24,900 --> 00:47:28,040 you could execute in a fixed amount of time. 841 00:47:28,040 --> 00:47:31,880 See what the [? process ?] of power is. 842 00:47:31,880 --> 00:47:32,970 But yeah, no. 843 00:47:32,970 --> 00:47:33,910 Triangular is fine. 844 00:47:33,910 --> 00:47:36,368 Triangular is fine, as long as you understand it generally. 845 00:47:36,368 --> 00:47:38,660 AUDIENCE: Can we build [INAUDIBLE] 846 00:47:39,454 --> 00:47:41,370 PROFESSOR: If you can do that in the half-hour 847 00:47:41,370 --> 00:47:43,370 you have to prepare with the pieces of the paper 848 00:47:43,370 --> 00:47:45,410 that you have with you. 849 00:47:45,410 --> 00:47:46,820 That would be impressive. 850 00:47:46,820 --> 00:47:52,190 OK, so I think the more conceptually difficult part 851 00:47:52,190 --> 00:47:55,260 of Monte Carlo are the estimators. 852 00:47:55,260 --> 00:47:58,020 And let me just-- I know, I feel like I've 853 00:47:58,020 --> 00:48:00,380 been harping on about these for a while, 854 00:48:00,380 --> 00:48:02,712 but let me just make sure that they're really clear, 855 00:48:02,712 --> 00:48:05,136 because I think it can get confusing. 856 00:48:05,136 --> 00:48:08,810 So we talked about three main estimators, the mean, 857 00:48:08,810 --> 00:48:11,250 the variance, and probability estimators. 858 00:48:11,250 --> 00:48:20,650 So if we want to estimate the mean, and it's the mean of y, 859 00:48:20,650 --> 00:48:28,500 y being our output of interest-- so let's call it mu sub y. 860 00:48:28,500 --> 00:48:29,470 Then what do we do? 861 00:48:29,470 --> 00:48:33,930 We use the sample mean as the estimator, 862 00:48:33,930 --> 00:48:37,340 and we denote the sample mean as y bar. 863 00:48:37,340 --> 00:48:43,870 And it's equal to 1 over n, the sum from i equals 1 n of y i, 864 00:48:43,870 --> 00:48:48,795 where this guy is the i-th Monte Carlo sample. 865 00:48:52,060 --> 00:48:54,180 The y that we get when we run the i-th Monte Carlo 866 00:48:54,180 --> 00:48:57,380 sample through our model. 867 00:48:57,380 --> 00:49:00,460 So we're trying to estimate mu of y, which is the real mean. 868 00:49:00,460 --> 00:49:02,240 To do that, we use the sample mean, 869 00:49:02,240 --> 00:49:05,720 y bar, which is just the standard sample mean. 870 00:49:05,720 --> 00:49:08,522 And what we know is that for n, as long 871 00:49:08,522 --> 00:49:12,970 as we take a large enough n-- large, 30 872 00:49:12,970 --> 00:49:19,130 or 40-- that this estimator-- so let me back up a second. 873 00:49:19,130 --> 00:49:23,120 This estimator-- this thing is the true mean. 874 00:49:23,120 --> 00:49:24,480 It's a number. 875 00:49:24,480 --> 00:49:26,644 The estimator is a random variable. 876 00:49:26,644 --> 00:49:28,310 And it's a random variable because we're 877 00:49:28,310 --> 00:49:30,870 sampling randomly, so any time we do this, 878 00:49:30,870 --> 00:49:33,230 we could get a slightly different answer. 879 00:49:33,230 --> 00:49:35,040 So this is a deterministic quantity. 880 00:49:35,040 --> 00:49:36,762 This is a random variable. 881 00:49:36,762 --> 00:49:38,220 We need to be able to say something 882 00:49:38,220 --> 00:49:40,053 about the properties of this random variable 883 00:49:40,053 --> 00:49:42,220 to be able to say how accurate it is. 884 00:49:42,220 --> 00:49:44,030 What we know is that for large n, where 885 00:49:44,030 --> 00:49:46,680 large means of the order of 30 or 40, 886 00:49:46,680 --> 00:49:51,770 this random variable, y bar, will be normally distributed. 887 00:49:51,770 --> 00:49:56,100 And the mean of-- let's call it mu 888 00:49:56,100 --> 00:50:00,952 sub y bar, the mean of x-- mean of mu sub y bar, 889 00:50:00,952 --> 00:50:04,640 and variant sigma y bar squared. 890 00:50:04,640 --> 00:50:09,960 OK, so this is the mean of y bar and a variant of y bar. 891 00:50:09,960 --> 00:50:14,460 And what we can show is that the mean of y 892 00:50:14,460 --> 00:50:18,050 bar-- the expected value of our estimator, y bar, 893 00:50:18,050 --> 00:50:20,180 is in fact equal to mu of y. 894 00:50:20,180 --> 00:50:22,900 It's equal to the thing that we're trying to estimate. 895 00:50:22,900 --> 00:50:25,660 And so this is what's called an unbiased estimator, 896 00:50:25,660 --> 00:50:31,240 because on average, it gives us the correct result. 897 00:50:31,240 --> 00:50:32,620 So that's great, on average. 898 00:50:32,620 --> 00:50:34,330 But now, the variance of that estimator 899 00:50:34,330 --> 00:50:37,150 is important, because it tells us how far off could we 900 00:50:37,150 --> 00:50:39,940 be if we just run it one time. 901 00:50:39,940 --> 00:50:44,970 And we could also derive-- that variance of the mean estimator 902 00:50:44,970 --> 00:50:50,730 is given by the variance of y itself divided 903 00:50:50,730 --> 00:50:54,940 by the number of samples that we drew. 904 00:50:54,940 --> 00:50:56,960 And the square root of this thing, sigma y bar, 905 00:50:56,960 --> 00:50:59,622 is sometimes called the standard error of the estimator. 906 00:50:59,622 --> 00:51:01,580 I tend to not use that term so much, because it 907 00:51:01,580 --> 00:51:02,860 confuses me a little bit. 908 00:51:02,860 --> 00:51:06,370 I just like to think of this as the variance of the estimator. 909 00:51:06,370 --> 00:51:08,900 So I really recommend that when you write these things, 910 00:51:08,900 --> 00:51:14,580 use the subscripts to denote mean of y bar, mean of y, 911 00:51:14,580 --> 00:51:17,570 variance of y bar, variance of y. 912 00:51:17,570 --> 00:51:19,920 Keep it straight. 913 00:51:19,920 --> 00:51:21,890 Yes, Kevin. 914 00:51:21,890 --> 00:51:23,315 AUDIENCE: [INAUDIBLE] 915 00:51:31,490 --> 00:51:33,690 PROFESSOR: This is not an estimator. 916 00:51:33,690 --> 00:51:35,700 The estimator is y bar. 917 00:51:35,700 --> 00:51:38,890 This is the mean and the variance of that estimator. 918 00:51:38,890 --> 00:51:41,920 We haven't yet talked about the estimator for the variance, 919 00:51:41,920 --> 00:51:43,874 which could biased. 920 00:51:43,874 --> 00:51:45,290 Yeah, so this is not an estimator. 921 00:51:45,290 --> 00:51:50,150 This is just the variance of this estimator. 922 00:51:50,150 --> 00:51:50,650 OK? 923 00:51:50,650 --> 00:51:51,150 Yep. 924 00:51:54,660 --> 00:51:58,440 OK, so that's the mean estimator. 925 00:51:58,440 --> 00:52:01,650 And the other ones we talked about 926 00:52:01,650 --> 00:52:07,726 were variance and probability. 927 00:52:07,726 --> 00:52:14,710 So let's say we want to estimate the variance of y. 928 00:52:14,710 --> 00:52:17,454 And again, y is the output of our code. 929 00:52:17,454 --> 00:52:21,210 And so this is sigma y squared. 930 00:52:21,210 --> 00:52:23,410 Then, here we have a variety of different options. 931 00:52:23,410 --> 00:52:25,474 I think Alex presented three to you. 932 00:52:28,920 --> 00:52:34,960 Maybe the one of choice is f y squared, 933 00:52:34,960 --> 00:52:41,350 which is given by 1 over n minus 1, the sum from i equal 1 to n 934 00:52:41,350 --> 00:52:45,915 of the [? yi's ?] minus the y bar squared. 935 00:52:49,520 --> 00:52:54,510 OK, so again-- and I guess the notation is a little bit 936 00:52:54,510 --> 00:52:59,100 unfortunate, because this isn't what people use. 937 00:52:59,100 --> 00:53:04,230 The f y squared is the estimator for the variance sigma 938 00:53:04,230 --> 00:53:05,720 y squared. 939 00:53:05,720 --> 00:53:07,650 And again, this is a random variable, 940 00:53:07,650 --> 00:53:10,470 and we want to know what its expectation and its variance 941 00:53:10,470 --> 00:53:12,980 are, because that tells us how good of an estimator 942 00:53:12,980 --> 00:53:14,380 it might be. 943 00:53:14,380 --> 00:53:17,800 And what we can show is that the expected value 944 00:53:17,800 --> 00:53:21,082 of this particular estimator is actually 945 00:53:21,082 --> 00:53:23,040 equal to the variance we're trying to estimate. 946 00:53:23,040 --> 00:53:24,940 So this one is unbiased. 947 00:53:24,940 --> 00:53:28,070 And Kevin, to your question, if we had 1 over n there, 948 00:53:28,070 --> 00:53:29,330 that would be biased. 949 00:53:29,330 --> 00:53:31,034 And I think [INAUDIBLE] Alex also 950 00:53:31,034 --> 00:53:34,502 showed you 1 over n minus 1/2? 951 00:53:34,502 --> 00:53:39,880 Oh, 1 over n minus 1.5. 952 00:53:39,880 --> 00:53:42,120 That one, I think, turns out to be unbiased estimate 953 00:53:42,120 --> 00:53:43,042 of the standard deviation. 954 00:53:43,042 --> 00:53:43,542 Yep, yep. 955 00:53:46,490 --> 00:53:50,210 OK, and so that's the mean of it. 956 00:53:50,210 --> 00:53:55,180 It turns out that the variance, or the standard deviation 957 00:53:55,180 --> 00:54:00,450 of this estimator is generally not known. 958 00:54:00,450 --> 00:54:03,160 So the mean estimate, we know by central limit theorem, 959 00:54:03,160 --> 00:54:06,960 follows the normal distribution, and we know its variance. 960 00:54:06,960 --> 00:54:10,760 For the variance, typically it's generally not known. 961 00:54:10,760 --> 00:54:12,252 How could we get a handle on this? 962 00:54:15,411 --> 00:54:16,660 We could do it multiple times. 963 00:54:16,660 --> 00:54:18,576 Maybe we can't afford to do it multiple times. 964 00:54:18,576 --> 00:54:21,090 How else could we get [INAUDIBLE] 965 00:54:21,090 --> 00:54:23,910 what's the cheating way of doing it multiple times? 966 00:54:23,910 --> 00:54:24,547 Bootstrapping. 967 00:54:24,547 --> 00:54:26,630 Bootstrapping, which is redrawing from the samples 968 00:54:26,630 --> 00:54:28,140 we've already evaluated. 969 00:54:28,140 --> 00:54:31,570 That could be a way to get a handle on how good that is. 970 00:54:31,570 --> 00:54:34,960 Turns out there's a case that if y is normally distributed, 971 00:54:34,960 --> 00:54:38,160 then you do know what this is, and this estimator follows 972 00:54:38,160 --> 00:54:42,190 a chi squared distribution that's mentioned in the notes. 973 00:54:42,190 --> 00:54:43,630 That's a very restrictive case. 974 00:54:43,630 --> 00:54:45,260 So in general, we don't know what 975 00:54:45,260 --> 00:54:52,390 this variance is, the variance of the variance estimator. 976 00:54:52,390 --> 00:54:54,580 Yep. 977 00:54:54,580 --> 00:54:59,450 And then, the third kind of estimator that we talked about 978 00:54:59,450 --> 00:55:00,905 was for probability. 979 00:55:00,905 --> 00:55:04,214 So estimate mean, estimate variance, 980 00:55:04,214 --> 00:55:05,463 and then estimate probability. 981 00:55:12,221 --> 00:55:13,970 So let's say that we're trying to estimate 982 00:55:13,970 --> 00:55:16,930 the probability of some event A, which I'm just going 983 00:55:16,930 --> 00:55:20,740 to call p, little p for short. 984 00:55:20,740 --> 00:55:25,725 And so we would use as an estimator, 985 00:55:25,725 --> 00:55:34,110 let's say, p hat of a, which is na over a-- over n. 986 00:55:34,110 --> 00:55:36,560 The number of times that a occurred in our sample 987 00:55:36,560 --> 00:55:39,010 divided by the total number of samples. 988 00:55:39,010 --> 00:55:40,600 Now, again, for this one, we know 989 00:55:40,600 --> 00:55:44,660 that by central limit theorem, for large n-- so again, 990 00:55:44,660 --> 00:55:47,260 this estimator, t hat a, is a random variable. 991 00:55:47,260 --> 00:55:53,830 For large n, it follows a normal distribution, 992 00:55:53,830 --> 00:55:56,430 with the mean equal to the probability 993 00:55:56,430 --> 00:55:59,170 that we're actually trying to estimate, 994 00:55:59,170 --> 00:56:01,230 and the variance equal to the probability 995 00:56:01,230 --> 00:56:03,730 we're trying to estimate times 1 minus the probability we're 996 00:56:03,730 --> 00:56:06,670 trying to estimate divided by n. 997 00:56:06,670 --> 00:56:09,000 So this guy here means that it's unbiased. 998 00:56:14,752 --> 00:56:16,720 AUDIENCE: So you cannot say that in general, 999 00:56:16,720 --> 00:56:24,100 an estimator of [INAUDIBLE] variance, 1000 00:56:24,100 --> 00:56:28,774 true population variance, you have to include for each type 1001 00:56:28,774 --> 00:56:29,520 of estimator-- 1002 00:56:29,520 --> 00:56:31,660 PROFESSOR: That's right. 1003 00:56:31,660 --> 00:56:33,400 Yeah, and I think that's a place where 1004 00:56:33,400 --> 00:56:36,470 some people were a little confused in the project. 1005 00:56:36,470 --> 00:56:41,540 It turns out that this is a variance of n. 1006 00:56:41,540 --> 00:56:44,170 But this is the variance of the Bernoulli random variable 1007 00:56:44,170 --> 00:56:48,222 that's the [? 01 ?] indicator that can come out of the code. 1008 00:56:48,222 --> 00:56:50,680 And so that's a way-- if you feel more comfortable thinking 1009 00:56:50,680 --> 00:56:52,804 about it that way, you can think about it that way. 1010 00:56:52,804 --> 00:56:56,130 But I much prefer to think that this is the mean 1011 00:56:56,130 --> 00:56:58,530 and this is a variance-- the mean of the estimator 1012 00:56:58,530 --> 00:57:00,146 and the variance of the estimator. 1013 00:57:00,146 --> 00:57:01,520 And the variance of the estimator 1014 00:57:01,520 --> 00:57:05,350 is this whole thing, just like the variance of this estimator 1015 00:57:05,350 --> 00:57:08,100 is this whole thing here. 1016 00:57:08,100 --> 00:57:10,860 And there do turn out to be other variances divided by n, 1017 00:57:10,860 --> 00:57:13,170 but that relationship is a little bit murky, 1018 00:57:13,170 --> 00:57:15,128 and I think you could get yourself into trouble 1019 00:57:15,128 --> 00:57:17,260 if you think of it that way. 1020 00:57:17,260 --> 00:57:18,385 It doesn't work over there. 1021 00:57:18,385 --> 00:57:19,600 Yeah. 1022 00:57:19,600 --> 00:57:25,140 So it's definitely-- it's not a general result. Yeah. 1023 00:57:25,140 --> 00:57:27,480 Maybe the key is that here you can write a probability 1024 00:57:27,480 --> 00:57:31,090 as a mean, because it's the average with that indicator 1025 00:57:31,090 --> 00:57:32,650 function. 1026 00:57:32,650 --> 00:57:35,020 And so you can use the same result 1027 00:57:35,020 --> 00:57:36,880 that you have used here to get to this one. 1028 00:57:36,880 --> 00:57:40,184 But again, that seems a little-- if the ideas are 1029 00:57:40,184 --> 00:57:42,350 clear in your mind, you can think about it that way, 1030 00:57:42,350 --> 00:57:43,550 if you want to. 1031 00:57:47,960 --> 00:57:54,315 OK, so once you have this, then specifying an accuracy level 1032 00:57:54,315 --> 00:57:56,690 with a given confidence is pretty straightforward, right? 1033 00:57:56,690 --> 00:57:58,148 If we say that we want our estimate 1034 00:57:58,148 --> 00:58:02,850 to be plus or minus 0.1 with confidence 99 percentile, 1035 00:58:02,850 --> 00:58:05,430 then what we're saying is that this distribution's 1036 00:58:05,430 --> 00:58:08,110 standard deviation-- square root of this guy-- 1037 00:58:08,110 --> 00:58:12,060 has to be within plus or minus, if it's 1038 00:58:12,060 --> 00:58:18,282 99 percentile, 3-ish times that 0.1, or whatever I said it was. 1039 00:58:18,282 --> 00:58:20,130 Yep. 1040 00:58:20,130 --> 00:58:22,890 And so that will tell you how many-- should make this 1041 00:58:22,890 --> 00:58:25,950 a bit of a curly n-- how many samples 1042 00:58:25,950 --> 00:58:29,010 you need to run in order to drive-- so the more samples you 1043 00:58:29,010 --> 00:58:32,720 run, the more you're shrinking this distribution of p hat 1044 00:58:32,720 --> 00:58:37,450 a, and making sure that the one run you do-- shrink, shrink, 1045 00:58:37,450 --> 00:58:39,215 shrink-- falls within the given tolerance 1046 00:58:39,215 --> 00:58:43,039 that you've been given, with a given amount of confidence. 1047 00:58:43,039 --> 00:58:44,580 Now, of course, the trick is that you 1048 00:58:44,580 --> 00:58:51,370 don't know p, in order to figure out what this variance is. 1049 00:58:51,370 --> 00:58:53,780 But like in the project, worst-case, variance 1050 00:58:53,780 --> 00:58:56,280 is maximized when p is 1/2, so you could use that. 1051 00:58:56,280 --> 00:58:59,630 Or you could do some kind of an on-the-fly checking as you go, 1052 00:58:59,630 --> 00:59:02,800 get an estimate for p hat, and then use that in here, 1053 00:59:02,800 --> 00:59:03,869 and keep checking. 1054 00:59:03,869 --> 00:59:05,660 And so then again, it would be approximate, 1055 00:59:05,660 --> 00:59:07,970 but if you built in a little bit of conservatism, 1056 00:59:07,970 --> 00:59:10,084 then you would be OK. 1057 00:59:10,084 --> 00:59:11,500 I posted solutions for the project 1058 00:59:11,500 --> 00:59:13,255 last night, where that's explained. 1059 00:59:16,770 --> 00:59:23,602 OK, questions about Monte Carlo estimators? 1060 00:59:23,602 --> 00:59:25,060 Three different kinds of estimators 1061 00:59:25,060 --> 00:59:26,768 that I expect you to be comfortable with. 1062 00:59:29,450 --> 00:59:32,085 OK? 1063 00:59:32,085 --> 00:59:35,070 You guys are very talkative today. 1064 00:59:35,070 --> 00:59:37,300 Very talkative. 1065 00:59:37,300 --> 00:59:43,300 All right, so moving on, variance reduction methods. 1066 00:59:46,110 --> 00:59:48,160 The main one that we talked about 1067 00:59:48,160 --> 00:59:56,840 was importance sampling, where again, 1068 00:59:56,840 --> 00:59:59,150 it's kind of a trick to help control 1069 00:59:59,150 --> 01:00:01,992 the error in our estimates. 1070 01:00:01,992 --> 01:00:04,610 So in particular, we looked at estimating 1071 01:00:04,610 --> 01:00:10,140 a mean, mu of x, which is the expectation 1072 01:00:10,140 --> 01:00:11,730 of some random variable x. 1073 01:00:11,730 --> 01:00:14,610 And remember, I was putting the little x down there 1074 01:00:14,610 --> 01:00:16,530 to denote that we're taking expectation 1075 01:00:16,530 --> 01:00:22,060 over x, because we're going to play around with the sampling. 1076 01:00:22,060 --> 01:00:24,560 And remember, we said that we could write this 1077 01:00:24,560 --> 01:00:30,010 as the integral of x times f of x dx, where this f of x 1078 01:00:30,010 --> 01:00:33,090 is the PDF of x. 1079 01:00:33,090 --> 01:00:36,380 And then, remember, we just play this trick where we divide by z 1080 01:00:36,380 --> 01:00:40,630 and multiply by z, which means that we don't actually 1081 01:00:40,630 --> 01:00:43,840 change anything. 1082 01:00:43,840 --> 01:00:48,090 But then we define z such that z times f of x 1083 01:00:48,090 --> 01:00:51,010 is actually another density, f of z. 1084 01:00:53,580 --> 01:00:55,450 Which means that we can interpret 1085 01:00:55,450 --> 01:00:59,740 the mean of x as being the expectation over x with respect 1086 01:00:59,740 --> 01:01:02,640 the density f x, or we can also interpret it 1087 01:01:02,640 --> 01:01:07,110 as being the expectation of x over z 1088 01:01:07,110 --> 01:01:09,436 with respect to the density z. 1089 01:01:13,910 --> 01:01:16,450 And why do we do that? 1090 01:01:22,510 --> 01:01:24,630 We do that because now we have two ways 1091 01:01:24,630 --> 01:01:27,645 to think about this mean that we're trying to estimate. 1092 01:01:30,240 --> 01:01:33,910 We can think about it as the expectation 1093 01:01:33,910 --> 01:01:37,060 of x under the density f of x, which 1094 01:01:37,060 --> 01:01:44,521 means that we would sample x, again, under this density, f 1095 01:01:44,521 --> 01:01:45,020 of x. 1096 01:01:47,640 --> 01:01:50,950 And then we would get our mean estimate. 1097 01:01:50,950 --> 01:01:53,450 And more importantly, we would get our estimator variance 1098 01:01:53,450 --> 01:01:56,130 that we just saw a couple minutes ago 1099 01:01:56,130 --> 01:02:04,671 as being the variance, again, under f of x of x over root n. 1100 01:02:04,671 --> 01:02:07,436 So that would be the variance of-- the mean [INAUDIBLE] 1101 01:02:07,436 --> 01:02:09,060 so that's just the standard Monte Carlo 1102 01:02:09,060 --> 01:02:10,980 that we've been talking about. 1103 01:02:10,980 --> 01:02:12,650 But what we just saw over there was 1104 01:02:12,650 --> 01:02:14,600 that we can also think about this thing 1105 01:02:14,600 --> 01:02:19,330 as being the expectation of x over z taken 1106 01:02:19,330 --> 01:02:23,050 with respect to the pdfz. 1107 01:02:23,050 --> 01:02:28,095 So this would mean, conceptually, sample now x 1108 01:02:28,095 --> 01:02:33,440 over z, under now f of z. 1109 01:02:36,670 --> 01:02:39,340 And then, the real reason that we do that 1110 01:02:39,340 --> 01:02:42,260 is that we can then play around with the estimator variance. 1111 01:02:44,830 --> 01:02:49,810 And it now is the variance of x over z 1112 01:02:49,810 --> 01:02:52,304 with respect to z over n. 1113 01:02:52,304 --> 01:02:53,720 And while these guys are the same, 1114 01:02:53,720 --> 01:02:56,300 because the mean is the linear calculation, 1115 01:02:56,300 --> 01:02:59,299 these two are not necessarily the same. 1116 01:02:59,299 --> 01:03:01,340 So then, remember, we talked about different ways 1117 01:03:01,340 --> 01:03:04,560 that we could come up with a clever f of z that 1118 01:03:04,560 --> 01:03:06,080 would put more samples, for example, 1119 01:03:06,080 --> 01:03:09,740 in a probability region that we're trying to explore, 1120 01:03:09,740 --> 01:03:11,660 that could have the effect of reducing 1121 01:03:11,660 --> 01:03:14,280 the variance of the estimator, meaning less samples 1122 01:03:14,280 --> 01:03:16,810 for the same level of accuracy, while giving still 1123 01:03:16,810 --> 01:03:19,480 the correct estimate of the probability 1124 01:03:19,480 --> 01:03:21,260 in that particular case. 1125 01:03:21,260 --> 01:03:23,710 And we also talked about how you would modify the Monte 1126 01:03:23,710 --> 01:03:25,730 Carlo-- remember, the Monte Carlo estimator had 1127 01:03:25,730 --> 01:03:35,465 that x over z, and then the z scaling back [? inside it. ?] 1128 01:03:35,465 --> 01:03:37,840 I think, unfortunately, that is one of the lectures where 1129 01:03:37,840 --> 01:03:39,820 the audio got scrambled. 1130 01:03:39,820 --> 01:03:43,800 But I scanned in my notes, and they're posted online. 1131 01:03:49,870 --> 01:03:53,646 OK, how are we doing on time? 1132 01:03:53,646 --> 01:04:00,816 [? 46. ?] So we talked briefly about variance-based 1133 01:04:00,816 --> 01:04:02,190 sensitivity analysis, and I think 1134 01:04:02,190 --> 01:04:03,356 I'll put it up on the board. 1135 01:04:03,356 --> 01:04:07,202 But I really just introduced you to the idea 1136 01:04:07,202 --> 01:04:08,660 of doing variance-based sensitivity 1137 01:04:08,660 --> 01:04:12,390 analysis of defining those main effects sensitivity 1138 01:04:12,390 --> 01:04:16,600 indices that gave us a sense of how the variance in the output 1139 01:04:16,600 --> 01:04:20,890 changes if you learn something about one of the inputs. 1140 01:04:20,890 --> 01:04:26,250 We talked about different DOE methods, the idea 1141 01:04:26,250 --> 01:04:38,030 being that what we're trying to do is sample the design space, 1142 01:04:38,030 --> 01:04:41,810 but not do full random Monte Carlo sampling, 1143 01:04:41,810 --> 01:04:43,576 maybe because we can't afford it. 1144 01:04:43,576 --> 01:04:51,960 So in DOE [INAUDIBLE] that the idea 1145 01:04:51,960 --> 01:04:54,740 is that we would define factors, which are inputs. 1146 01:04:54,740 --> 01:04:57,500 And we would define discrete levels at which we might 1147 01:04:57,500 --> 01:04:59,790 want to test those factors. 1148 01:04:59,790 --> 01:05:04,500 And that we're going to run some combination of factors 1149 01:05:04,500 --> 01:05:07,420 and levels through the model, and collect 1150 01:05:07,420 --> 01:05:12,300 outputs, which are sometimes called observations 1151 01:05:12,300 --> 01:05:15,750 in DOE language. 1152 01:05:15,750 --> 01:05:17,950 And that the different DOE methods 1153 01:05:17,950 --> 01:05:20,940 are different ways to choose combinations 1154 01:05:20,940 --> 01:05:22,164 of factors and levels. 1155 01:05:22,164 --> 01:05:23,830 And we talked about the parameter study, 1156 01:05:23,830 --> 01:05:27,600 the one-at-a-time, orthogonal arrays, Latin hypercubes. 1157 01:05:27,600 --> 01:05:30,240 So again, different DOE methods are different ways 1158 01:05:30,240 --> 01:05:33,940 to choose which combinations of factors and levels. 1159 01:05:33,940 --> 01:05:36,860 And then we also talked about the main effects, 1160 01:05:36,860 --> 01:05:39,370 averaging over all the experiments 1161 01:05:39,370 --> 01:05:41,580 with a factor at a particular level, 1162 01:05:41,580 --> 01:05:44,030 looking at that contingent average of all experiments. 1163 01:05:44,030 --> 01:05:45,863 And remember, the paper airplane experiment, 1164 01:05:45,863 --> 01:05:48,700 where we looked at the effects of the different design 1165 01:05:48,700 --> 01:05:50,260 variable settings. 1166 01:05:50,260 --> 01:05:55,760 That gives us some insight to our design space. 1167 01:05:55,760 --> 01:06:03,990 OK, and then lastly, in optimization, not too 1168 01:06:03,990 --> 01:06:05,830 much to say here. 1169 01:06:05,830 --> 01:06:09,730 Just a basic idea of unconstrained optimization, 1170 01:06:09,730 --> 01:06:11,220 what an optimization problem looks 1171 01:06:11,220 --> 01:06:15,560 like, the basic idea of how a simple algorithm 1172 01:06:15,560 --> 01:06:18,290 like steepest descent, or conjugate gradient, or Newton's 1173 01:06:18,290 --> 01:06:21,030 method might work. 1174 01:06:21,030 --> 01:06:25,870 We talked about the different methods to compute gradients. 1175 01:06:25,870 --> 01:06:30,339 And we saw particularly that finite difference 1176 01:06:30,339 --> 01:06:32,880 approximations, which you saw when you were approximating PDE 1177 01:06:32,880 --> 01:06:36,160 terms, can also be used to compute gradients, 1178 01:06:36,160 --> 01:06:39,210 or to estimate gradients, in the design space. 1179 01:06:39,210 --> 01:06:41,360 And then, we also talked about how 1180 01:06:41,360 --> 01:06:45,280 we could use samples to fit a polynomial response surface 1181 01:06:45,280 --> 01:06:50,990 model, if we needed to approximate an expensive model, 1182 01:06:50,990 --> 01:06:52,375 and use it in an optimization. 1183 01:06:56,010 --> 01:06:59,300 So that was the last-- really, the last two lectures. 1184 01:07:05,270 --> 01:07:12,930 All right, so let me put up-- quickly look at the outcomes. 1185 01:07:12,930 --> 01:07:14,935 Everybody got-- what's that? 1186 01:07:14,935 --> 01:07:16,360 AUDIENCE: [INAUDIBLE] 1187 01:07:20,160 --> 01:07:21,950 PROFESSOR: We'll go look at the outcomes 1188 01:07:21,950 --> 01:07:24,200 for that last section, the probabilistic analysis 1189 01:07:24,200 --> 01:07:24,910 and optimization. 1190 01:07:24,910 --> 01:07:27,932 And again, these are specifically 1191 01:07:27,932 --> 01:07:29,390 what I expect you to be able to do. 1192 01:07:29,390 --> 01:07:30,500 I'm not going to ask you to do anything 1193 01:07:30,500 --> 01:07:31,320 that's not in these outcomes. 1194 01:07:31,320 --> 01:07:33,480 If you can do every single one of these outcomes, 1195 01:07:33,480 --> 01:07:36,510 you will be 100% fine. 1196 01:07:36,510 --> 01:07:40,910 So 3.1 and 3.2 related to some basic probability stuff. 1197 01:07:40,910 --> 01:07:43,310 3.2 described the process of Monte Carlo sampling 1198 01:07:43,310 --> 01:07:45,125 from uniform distributions. 1199 01:07:45,125 --> 01:07:47,200 3.4 described how to generalize it 1200 01:07:47,200 --> 01:07:51,580 to arbitrary univariate distributions, like triangular. 1201 01:07:54,100 --> 01:07:55,720 Use it to propagate uncertainty. 1202 01:07:55,720 --> 01:08:00,890 You've [INAUDIBLE] this one in the project-- [? horray. ?] 1203 01:08:00,890 --> 01:08:04,970 Then, a whole bunch of outcomes that relate to the estimators. 1204 01:08:04,970 --> 01:08:06,740 Describe what an estimator is. 1205 01:08:06,740 --> 01:08:11,470 Define its bias and variance. 1206 01:08:11,470 --> 01:08:14,830 State unbiased estimators for the mean and variance 1207 01:08:14,830 --> 01:08:18,420 of a random variable and for the probability of an event. 1208 01:08:18,420 --> 01:08:20,229 Describe the typical convergence rate. 1209 01:08:20,229 --> 01:08:23,910 So this is how does the variance, 1210 01:08:23,910 --> 01:08:26,500 how do the standard deviations of these estimators 1211 01:08:26,500 --> 01:08:28,455 behave as n increases? 1212 01:08:32,512 --> 01:08:36,039 For the estimators, define the standard error and the sampling 1213 01:08:36,039 --> 01:08:36,580 distribution. 1214 01:08:36,580 --> 01:08:38,038 So this is what we're talking about 1215 01:08:38,038 --> 01:08:40,689 with the normal distributions that we can derive for the mean 1216 01:08:40,689 --> 01:08:42,090 and for the probability. 1217 01:08:42,090 --> 01:08:43,550 In the variance, we typically don't 1218 01:08:43,550 --> 01:08:45,800 know what it is, unless we have that very special case 1219 01:08:45,800 --> 01:08:49,316 that the outputs themselves are normal. 1220 01:08:49,316 --> 01:08:51,352 Give standard errors for the sample estimators 1221 01:08:51,352 --> 01:08:53,060 of mean, variance, and event probability. 1222 01:08:53,060 --> 01:08:56,319 This one should really only be in that very special case. 1223 01:08:56,319 --> 01:08:58,430 And then, obtain confidence intervals, 1224 01:08:58,430 --> 01:09:02,310 and be able to use those to determine how many samples you 1225 01:09:02,310 --> 01:09:05,470 need in a Monte Carlo simulation. 1226 01:09:05,470 --> 01:09:07,986 Then on Design of Experiments and Response Surfaces, 1227 01:09:07,986 --> 01:09:10,069 so just describe how to apply the different design 1228 01:09:10,069 --> 01:09:12,652 of experiments methods that we talked about-- parameter study, 1229 01:09:12,652 --> 01:09:15,420 one-at-a-time, Latin hypercube sampling, 1230 01:09:15,420 --> 01:09:16,899 and orthogonal arrays. 1231 01:09:16,899 --> 01:09:18,550 Describe the Response Surface Method, 1232 01:09:18,550 --> 01:09:21,520 and describe how you could construct it 1233 01:09:21,520 --> 01:09:23,970 using least squares regression. 1234 01:09:23,970 --> 01:09:25,279 Remember, we did the points. 1235 01:09:25,279 --> 01:09:27,069 We construct the least square system. 1236 01:09:27,069 --> 01:09:29,359 Use it to get the unknown coefficients 1237 01:09:29,359 --> 01:09:33,060 of either a linear or a quadratic response surface. 1238 01:09:33,060 --> 01:09:35,689 And then, we didn't talk about this in too much detail, 1239 01:09:35,689 --> 01:09:37,930 but I know you've seen the R2-metric before, 1240 01:09:37,930 --> 01:09:40,160 and you understand that that measures 1241 01:09:40,160 --> 01:09:42,759 the quality of the [? search, ?] of the Response 1242 01:09:42,759 --> 01:09:45,500 Surface to the data points. 1243 01:09:45,500 --> 01:09:48,109 Then lastly, on the Introduction to Design Optimization, 1244 01:09:48,109 --> 01:09:50,650 be able to describe the steepest descent, conjugate gradient, 1245 01:09:50,650 --> 01:09:52,910 and the Newton method, and to apply it 1246 01:09:52,910 --> 01:09:56,190 to simple unconstrained design problems. 1247 01:09:56,190 --> 01:09:58,750 Describe the different methods to estimate the gradients, 1248 01:09:58,750 --> 01:10:01,240 and be able to use finite difference approximations 1249 01:10:01,240 --> 01:10:03,290 to actually estimate them. 1250 01:10:03,290 --> 01:10:05,150 And then, interpret sensitivity information, 1251 01:10:05,150 --> 01:10:07,030 so things like the main effect sensitivities 1252 01:10:07,030 --> 01:10:08,690 that we talk about, and explain why 1253 01:10:08,690 --> 01:10:11,320 those are relevant to aerospace design examples. 1254 01:10:11,320 --> 01:10:13,780 Remember, we talked about how you could use sensitivity 1255 01:10:13,780 --> 01:10:16,900 information to decide where to reduce uncertainty 1256 01:10:16,900 --> 01:10:19,350 in the system, or where-- there was called 1257 01:10:19,350 --> 01:10:23,250 factor prioritization, or factor fixing, where there are factors 1258 01:10:23,250 --> 01:10:25,880 that don't really matter, and you could fix them at a value 1259 01:10:25,880 --> 01:10:28,550 and not worry about their uncertainty.