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:25,855 --> 00:00:26,730 PROFESSOR: All right. 9 00:00:26,730 --> 00:00:29,890 So you guys have read all about method of weighted residuals. 10 00:00:29,890 --> 00:00:30,920 Yes? 11 00:00:30,920 --> 00:00:33,970 Makes perfect sense. 12 00:00:33,970 --> 00:00:35,800 Yes? 13 00:00:35,800 --> 00:00:38,230 We need to go through things today? 14 00:00:38,230 --> 00:00:38,861 A little bit. 15 00:00:38,861 --> 00:00:39,360 OK. 16 00:00:39,360 --> 00:00:40,710 Just a little bit. 17 00:00:40,710 --> 00:00:41,540 All right. 18 00:00:41,540 --> 00:01:01,450 So-- actually, but before we do that, I want to-- 19 00:01:01,450 --> 00:01:05,430 [INAUDIBLE] [? Let's ?] put up a list of topics 20 00:01:05,430 --> 00:01:07,710 that we're going to talk about today. 21 00:01:07,710 --> 00:01:14,535 So I want to start by just talking 22 00:01:14,535 --> 00:01:16,410 about the measurable outcomes for the module. 23 00:01:16,410 --> 00:01:18,531 Remind you of what it is we're going to do. 24 00:01:18,531 --> 00:01:20,530 Then we're going to introduce the model problem. 25 00:01:20,530 --> 00:01:25,870 You read this in the pre-class reading. 26 00:01:25,870 --> 00:01:28,510 But it's the steady 1D diffusion. 27 00:01:28,510 --> 00:01:31,820 And we'll do a few things in general, 28 00:01:31,820 --> 00:01:35,820 but more or less we're going to develop the [INAUDIBLE] 29 00:01:35,820 --> 00:01:38,510 by thinking about this specific example. 30 00:01:38,510 --> 00:01:41,020 We're going to talk about the idea of approximating 31 00:01:41,020 --> 00:01:44,500 the solution with basis functions, which 32 00:01:44,500 --> 00:01:48,149 is a fundamentally different way of doing 33 00:01:48,149 --> 00:01:50,190 the approximation compared to what you've already 34 00:01:50,190 --> 00:01:52,940 seen in finite difference and finite volume. 35 00:01:52,940 --> 00:01:55,695 Then we'll look at the collocation method. 36 00:01:58,610 --> 00:02:00,419 And then finally, we'll get to the method 37 00:02:00,419 --> 00:02:01,335 of weighted residuals. 38 00:02:06,230 --> 00:02:06,730 OK. 39 00:02:06,730 --> 00:02:11,039 So what I'm going to do on the board 40 00:02:11,039 --> 00:02:15,715 is more or less paralleling what's in the notes. 41 00:02:15,715 --> 00:02:19,250 And so I can go quickly on the thoughts that are already 42 00:02:19,250 --> 00:02:23,230 clear, and we can spend more time on the parts 43 00:02:23,230 --> 00:02:25,151 that you have found to be confusing. 44 00:02:27,881 --> 00:02:28,380 OK. 45 00:02:28,380 --> 00:02:30,030 So I'm not going to put the screen down because it'll 46 00:02:30,030 --> 00:02:31,571 take a while to get the projector on, 47 00:02:31,571 --> 00:02:34,240 but I just want to remind you that there's 48 00:02:34,240 --> 00:02:38,129 the measurable outcome list embedded on the MIT site. 49 00:02:38,129 --> 00:02:39,920 It's also on the mitosis.mitx.mit.edu site. 50 00:02:42,760 --> 00:02:45,171 And so we're into a new module now. 51 00:02:45,171 --> 00:02:46,670 There are four modules in the class. 52 00:02:46,670 --> 00:02:49,430 The first one was integration methods for ODEs. 53 00:02:49,430 --> 00:02:52,090 The second one was finite difference and finite volume 54 00:02:52,090 --> 00:02:53,020 methods. 55 00:02:53,020 --> 00:02:57,350 And the third one now, which is finite element methods for PDE. 56 00:02:57,350 --> 00:02:59,100 And so I think it's really helpful for you 57 00:02:59,100 --> 00:03:02,060 to go back and-- well to go forward at this point-- 58 00:03:02,060 --> 00:03:04,310 and look at the outcomes, and think about specifically 59 00:03:04,310 --> 00:03:06,330 what it is you're going to have to be able to do. 60 00:03:06,330 --> 00:03:08,100 Because as you are going through all the notes, 61 00:03:08,100 --> 00:03:10,360 and I know there are a lot of notes for this section, 62 00:03:10,360 --> 00:03:11,734 it will help you think about what 63 00:03:11,734 --> 00:03:13,760 are the specific skills that need to take away. 64 00:03:13,760 --> 00:03:16,290 There'll be homework problems and a project that 65 00:03:16,290 --> 00:03:17,930 will help you do that, too. 66 00:03:17,930 --> 00:03:19,980 But for example, describe how the method 67 00:03:19,980 --> 00:03:21,370 of weighted residuals can be used 68 00:03:21,370 --> 00:03:23,720 to calculate an approximate solution to the PDE, 69 00:03:23,720 --> 00:03:25,540 we're going to cover that today. 70 00:03:25,540 --> 00:03:27,550 Then to be able to describe the differences 71 00:03:27,550 --> 00:03:30,060 between the method of weighted residuals and the collocation 72 00:03:30,060 --> 00:03:33,900 method, and the least squares method for approximating a PDE. 73 00:03:33,900 --> 00:03:37,467 So there's a lot of really specific outcomes. 74 00:03:37,467 --> 00:03:40,050 I think there's probably about 12 outcomes that are associated 75 00:03:40,050 --> 00:03:40,580 with this module. 76 00:03:40,580 --> 00:03:41,954 Go and take a look at them, and I 77 00:03:41,954 --> 00:03:45,760 think that will hopefully help you divide up the material, 78 00:03:45,760 --> 00:03:50,830 and think about what it is that you need to be able to do. 79 00:03:50,830 --> 00:03:57,250 But let's start off by thinking about our model problem. 80 00:03:57,250 --> 00:04:01,690 So a model problem just means a simple problem that' 81 00:04:01,690 --> 00:04:05,450 we're going to use to develop things on. 82 00:04:05,450 --> 00:04:10,060 And so the model problem again is steady 83 00:04:10,060 --> 00:04:12,126 1D heat diffusion in a rod. 84 00:04:17,730 --> 00:04:21,430 And the PDE should be pretty familiar [INAUDIBLE] 85 00:04:21,430 --> 00:04:22,665 you by now. 86 00:04:22,665 --> 00:04:31,830 It's d by dx of k [? ct dx ?] equal to minus 2. 87 00:04:31,830 --> 00:04:35,074 We're thinking about a 1D domain. 88 00:04:35,074 --> 00:04:37,100 So here's our domain. 89 00:04:37,100 --> 00:04:39,700 That's the x direction. 90 00:04:39,700 --> 00:04:42,070 The domain is going to have links l. 91 00:04:42,070 --> 00:04:44,950 So we'll have x in general going from minus l 92 00:04:44,950 --> 00:04:49,140 over to plus l over 2. 93 00:04:49,140 --> 00:04:52,004 The k sitting in here in general is 94 00:04:52,004 --> 00:04:54,420 going to be a function of x, although you'll see that just 95 00:04:54,420 --> 00:04:57,500 to make things simple in the beginning we'll at some point 96 00:04:57,500 --> 00:04:58,540 make k constant. 97 00:04:58,540 --> 00:05:00,760 That's the thermal conductivity of the material 98 00:05:00,760 --> 00:05:02,010 that the rod is made out of. 99 00:05:07,370 --> 00:05:10,720 And this q on the right hand side 100 00:05:10,720 --> 00:05:15,010 also can be a function of x, is the heat source. 101 00:05:15,010 --> 00:05:18,296 And it's actually heat source per unit [INAUDIBLE] 102 00:05:18,296 --> 00:05:19,284 to get units right. 103 00:05:24,718 --> 00:05:27,890 OK, so simple problem set up. 104 00:05:30,930 --> 00:05:33,574 PDE specify heat source. 105 00:05:33,574 --> 00:05:35,990 We're also going to need to apply boundary conditions when 106 00:05:35,990 --> 00:05:40,110 we actually get to specifying a particular problem. 107 00:05:40,110 --> 00:05:44,549 So there's one particular problem that we will use. 108 00:05:44,549 --> 00:05:46,840 One that we can compute the analytical solution for it. 109 00:05:46,840 --> 00:05:49,420 Because if we can compute an analytical solution, 110 00:05:49,420 --> 00:05:51,170 we'll be able to look at errors and things 111 00:05:51,170 --> 00:05:54,450 when we look at the numerical approximation. 112 00:05:54,450 --> 00:05:59,390 So for the particular case where k is a constant and equal to 1, 113 00:05:59,390 --> 00:06:02,120 the length of the rod is 2, so that x 114 00:06:02,120 --> 00:06:08,607 goes from minus 1 to plus 1, and the heat source is 115 00:06:08,607 --> 00:06:11,190 q of x being 50 e to the x. 116 00:06:11,190 --> 00:06:14,810 And again, this is the same example that's in the notes. 117 00:06:14,810 --> 00:06:19,030 And boundary conditions, the temperature 118 00:06:19,030 --> 00:06:23,950 at the right end of the rod is set to be 100, 119 00:06:23,950 --> 00:06:27,185 and the temperature at the left end of the rod 120 00:06:27,185 --> 00:06:29,340 is set to be 100. 121 00:06:29,340 --> 00:06:32,950 OK, so for that particular case we 122 00:06:32,950 --> 00:06:40,550 have an analytical solution you can get by integrating the PDE. 123 00:06:40,550 --> 00:06:47,905 And that turns out to be t of x is minus 50x to the x, 124 00:06:47,905 --> 00:06:56,370 plus 50x the hyperbolic sign of 1, 125 00:06:56,370 --> 00:07:05,060 plus 100, plus 50 times the hyperbolic cosign of 1. 126 00:07:05,060 --> 00:07:09,340 OK, so that's just what comes out of this analytic. 127 00:07:09,340 --> 00:07:12,500 [INAUDIBLE] and that's maybe a little bit hard to think about, 128 00:07:12,500 --> 00:07:16,620 so let's just sketch what t of x looks like as a function of x. 129 00:07:16,620 --> 00:07:23,270 So there's x going from minus 1 to 1. 130 00:07:23,270 --> 00:07:27,900 We've taken x equal to 0-- I mean x equal to minus 1. 131 00:07:27,900 --> 00:07:30,150 Then we should be getting the boundary condition back, 132 00:07:30,150 --> 00:07:31,450 t is 100. 133 00:07:31,450 --> 00:07:38,570 So if we make this 100 on my t-axis, 134 00:07:38,570 --> 00:07:41,350 then the solution looks something like this. 135 00:07:41,350 --> 00:07:43,560 And it comes back to 100 at the other end. 136 00:07:48,081 --> 00:07:48,580 OK. 137 00:07:48,580 --> 00:07:50,966 So that's an analytic solution that we can compute. 138 00:07:50,966 --> 00:07:52,840 And again, we're just doing that because when 139 00:07:52,840 --> 00:07:54,720 we start looking at the [? miracle ?] approximations, 140 00:07:54,720 --> 00:07:56,553 we're going to want something to compare to. 141 00:07:56,553 --> 00:08:00,317 So a simple problem where we can actually and integrate things 142 00:08:00,317 --> 00:08:00,858 analytically. 143 00:08:04,690 --> 00:08:06,210 OK? 144 00:08:06,210 --> 00:08:07,920 Yep. 145 00:08:07,920 --> 00:08:09,170 Think I've told you anything. 146 00:08:09,170 --> 00:08:10,296 All right. 147 00:08:10,296 --> 00:08:13,400 So let's now start thinking about the solution 148 00:08:13,400 --> 00:08:15,620 approximation. 149 00:08:15,620 --> 00:08:21,858 Can I-- again, everything I'm writing is scanned in online, 150 00:08:21,858 --> 00:08:25,298 so-- I know it's good to copy stuff down and help 151 00:08:25,298 --> 00:08:29,720 follow along, but also you will have copies of the full notes. 152 00:08:29,720 --> 00:08:31,510 So now let's start thinking up this idea 153 00:08:31,510 --> 00:08:33,940 of approximating the solution. 154 00:08:33,940 --> 00:08:41,679 So first let me ask, if we were going 155 00:08:41,679 --> 00:08:45,092 to solve this problem using finite differences, 156 00:08:45,092 --> 00:08:45,800 what would we do? 157 00:08:53,880 --> 00:08:56,175 We'd run to Alex and ask him to help us? 158 00:08:56,175 --> 00:08:58,550 What would we do if we wanted to solve this problem using 159 00:08:58,550 --> 00:08:59,341 finite differences? 160 00:09:03,540 --> 00:09:07,357 We'd break up the domain into a bunch of cells, and then what? 161 00:09:07,357 --> 00:09:08,690 How would we approximate things? 162 00:09:13,304 --> 00:09:14,179 AUDIENCE: [INAUDIBLE] 163 00:09:24,990 --> 00:09:25,656 PROFESSOR: Yeah. 164 00:09:25,656 --> 00:09:26,160 Good. 165 00:09:26,160 --> 00:09:29,280 So we would decide what kind of a scheme we wanted to use, 166 00:09:29,280 --> 00:09:31,010 and we would approximate the derivatives. 167 00:09:31,010 --> 00:09:34,190 And that's kind of the key part of [INAUDIBLE], 168 00:09:34,190 --> 00:09:37,177 is that we would take this-- we'd take k equal 1 constant. 169 00:09:37,177 --> 00:09:39,760 So basically we've got a second derivative the t sitting here. 170 00:09:39,760 --> 00:09:42,260 We would approximate it using our favorite finite difference 171 00:09:42,260 --> 00:09:42,760 [INAUDIBLE]. 172 00:09:42,760 --> 00:09:47,250 So maybe the central difference for the second derivative. 173 00:09:47,250 --> 00:09:49,350 So I think it's really key to keep in mind 174 00:09:49,350 --> 00:09:52,530 that finite element departs from that mentality right 175 00:09:52,530 --> 00:09:53,410 from the beginning. 176 00:09:53,410 --> 00:09:55,860 That with finite elements, we're not 177 00:09:55,860 --> 00:10:00,260 going to approximate the derivative here. 178 00:10:00,260 --> 00:10:03,790 We're not going to approximate this operator, this d squared 179 00:10:03,790 --> 00:10:06,025 by dx squared that's acting on t. 180 00:10:06,025 --> 00:10:07,400 With finite elements, we're going 181 00:10:07,400 --> 00:10:10,722 to assume a form for the solution t, 182 00:10:10,722 --> 00:10:11,930 and approximate the solution. 183 00:10:11,930 --> 00:10:14,030 We're going to assume a form for the solution t, 184 00:10:14,030 --> 00:10:15,946 and we're going to substitute in and do 185 00:10:15,946 --> 00:10:18,910 a bit of mathematical magic, and then solve 186 00:10:18,910 --> 00:10:24,140 to find an attribute solution. 187 00:10:24,140 --> 00:10:29,738 So it's already quite different to finite differences. 188 00:10:29,738 --> 00:10:32,390 So how do we get started? 189 00:10:32,390 --> 00:10:36,960 We start off by-- and let's call this 2a-- we're going to say, 190 00:10:36,960 --> 00:10:39,890 to approximate the solution [INAUDIBLE] used 191 00:10:39,890 --> 00:10:42,715 a sum of weighted functions. 192 00:10:46,179 --> 00:10:46,980 OK. 193 00:10:46,980 --> 00:10:51,480 We know that t is a function of x. 194 00:10:51,480 --> 00:10:55,055 t varies continuously along the domain here. 195 00:10:55,055 --> 00:10:56,020 A function of x. 196 00:10:56,020 --> 00:10:58,630 That's an infinite dimensional problem, right? 197 00:10:58,630 --> 00:11:00,470 t is a continuous function. 198 00:11:00,470 --> 00:11:04,000 Best rather write our approximate solution, 199 00:11:04,000 --> 00:11:06,740 which I'm going to call t tilde of x. 200 00:11:06,740 --> 00:11:11,130 So this guy here is the approximation 201 00:11:11,130 --> 00:11:15,570 of my exact solution, t of x. 202 00:11:15,570 --> 00:11:18,516 And I'm going to write it as-- I'm just 203 00:11:18,516 --> 00:11:21,800 going to leave a bit of space here-- the sum from i 204 00:11:21,800 --> 00:11:27,830 equals 1 to capital N of some ai's times 205 00:11:27,830 --> 00:11:30,632 some ci's that are a function of a. 206 00:11:34,250 --> 00:11:37,200 What are these guys here? 207 00:11:37,200 --> 00:11:39,290 These things here are no-end functions, 208 00:11:39,290 --> 00:11:41,040 they are things that I'm going to specify. 209 00:11:44,870 --> 00:11:46,630 And what you'll see is that these things 210 00:11:46,630 --> 00:11:50,404 are going to be referred to later on as basis functions. 211 00:11:54,580 --> 00:11:56,579 These things are no-end functions of x. 212 00:11:56,579 --> 00:11:57,870 So we're going to specify them. 213 00:11:57,870 --> 00:12:01,150 The ci's, there's N of them-- capital N of them. 214 00:12:01,150 --> 00:12:04,540 And the ai's here, these are unknown [INAUDIBLE]. 215 00:12:08,970 --> 00:12:13,590 OK, so what I've said is that t of x, 216 00:12:13,590 --> 00:12:16,140 an infinite dimensional problem, t 217 00:12:16,140 --> 00:12:18,230 is some continuous, or some function, 218 00:12:18,230 --> 00:12:21,770 whether it be continuous, some function of x on the domain. 219 00:12:21,770 --> 00:12:27,880 Let's approximate it as a finite sum from i equals 1 to n 220 00:12:27,880 --> 00:12:29,890 of some weight, so some coefficient-- 221 00:12:29,890 --> 00:12:32,740 ai's-- just constant, times some functions that we're going 222 00:12:32,740 --> 00:12:34,282 to specify. 223 00:12:34,282 --> 00:12:36,560 So with-- can you see that we've discretized 224 00:12:36,560 --> 00:12:38,160 the problem in a different way than we 225 00:12:38,160 --> 00:12:39,243 did in finite differences. 226 00:12:39,243 --> 00:12:41,200 We have discretized the problem because now we 227 00:12:41,200 --> 00:12:44,210 have how many unknowns? 228 00:12:44,210 --> 00:12:44,780 n. 229 00:12:44,780 --> 00:12:48,420 We have n degrees of freedom. n [INAUDIBLE] ai's 230 00:12:48,420 --> 00:12:53,350 that we can use to create our approximate solution. 231 00:12:53,350 --> 00:12:55,580 And I've left a bit a space here because I'm 232 00:12:55,580 --> 00:12:56,870 going to write this in. 233 00:12:56,870 --> 00:13:00,210 I'm going to write in 100 plus that extension. 234 00:13:00,210 --> 00:13:01,630 Why do you think I wrote the 100? 235 00:13:05,530 --> 00:13:06,415 I heard the b word. 236 00:13:06,415 --> 00:13:06,750 AUDIENCE: [INAUDIBLE] 237 00:13:06,750 --> 00:13:07,575 PROFESSOR: The boundary conditions. 238 00:13:07,575 --> 00:13:08,075 Yeah. 239 00:13:08,075 --> 00:13:11,630 In this particular example that we're considering, 240 00:13:11,630 --> 00:13:14,550 the boundary conditions [INAUDIBLE] conditions that 241 00:13:14,550 --> 00:13:17,810 specified to be t equal 100 at either end. 242 00:13:17,810 --> 00:13:20,840 So let's put the 100 out in front, and then the rest 243 00:13:20,840 --> 00:13:24,840 it there, the some of the ai times the ci's is 244 00:13:24,840 --> 00:13:27,400 going to satisy 0-- 0 temperature at either end. 245 00:13:27,400 --> 00:13:29,540 Right? 246 00:13:29,540 --> 00:13:31,940 OK so in this particular example, this guy-- 247 00:13:31,940 --> 00:13:36,530 this 100 is chosen to satisfy a outbound [? preconditions ?] 248 00:13:36,530 --> 00:13:40,617 here for our model problem. 249 00:13:43,350 --> 00:13:43,850 OK. 250 00:13:43,850 --> 00:13:47,000 So by writing this-- and this sort of approximation 251 00:13:47,000 --> 00:13:49,039 of the temperature-- it's a simple equation, 252 00:13:49,039 --> 00:13:50,580 but I'm spending a little bit of time 253 00:13:50,580 --> 00:13:52,220 because it's really important it's clear in your mind, 254 00:13:52,220 --> 00:13:54,011 because this is really kind of one of the-- 255 00:13:54,011 --> 00:13:58,390 what's the first key step of making this approximation. 256 00:13:58,390 --> 00:14:04,085 We've turned the problem of determining 257 00:14:04,085 --> 00:14:09,240 t tilde of x, the approximation, which again is really 258 00:14:09,240 --> 00:14:15,270 an infinite dimensional problem, into the problem of determining 259 00:14:15,270 --> 00:14:25,700 the coefficients, the a1, a2, up to a n where we have now just 260 00:14:25,700 --> 00:14:29,120 capital N unknown. 261 00:14:29,120 --> 00:14:30,695 Kevin, yeah? 262 00:14:30,695 --> 00:14:31,570 AUDIENCE: [INAUDIBLE] 263 00:14:40,390 --> 00:14:44,410 PROFESSOR: Yeah, so if you had like 100 here and 200 somewhere 264 00:14:44,410 --> 00:14:46,130 else or something? 265 00:14:46,130 --> 00:14:47,980 There's various ways that you can handle it. 266 00:14:47,980 --> 00:14:50,352 And we'll talk probably in two weeks 267 00:14:50,352 --> 00:14:55,060 of times about how to do boundary conditions 268 00:14:55,060 --> 00:14:56,960 and the finite element method. 269 00:14:56,960 --> 00:14:59,849 But one approach that we could use just with the simple idea 270 00:14:59,849 --> 00:15:01,390 here is, you could, for example, have 271 00:15:01,390 --> 00:15:05,340 a linear function that went from 100 to 200 272 00:15:05,340 --> 00:15:07,460 and then plus the rest. 273 00:15:07,460 --> 00:15:07,960 Right? 274 00:15:07,960 --> 00:15:10,300 So you could still get the boundary conditions back. 275 00:15:10,300 --> 00:15:14,139 But yeah, we'll talk once we've been through the theory 276 00:15:14,139 --> 00:15:16,430 about how to handle boundary conditions more generally. 277 00:15:16,430 --> 00:15:18,350 Yep. 278 00:15:18,350 --> 00:15:20,590 Generally speaking we will do something 279 00:15:20,590 --> 00:15:23,970 so that those ci's will satisfy 0. 280 00:15:23,970 --> 00:15:24,470 [INAUDIBLE] 281 00:15:28,440 --> 00:15:28,940 OK. 282 00:15:28,940 --> 00:15:31,250 So now the question that you should be asking 283 00:15:31,250 --> 00:15:32,840 yourself is, what are these? 284 00:15:32,840 --> 00:15:35,690 I said they were no-end basis functions. 285 00:15:35,690 --> 00:15:37,040 They are things that we specify. 286 00:15:37,040 --> 00:15:39,240 So you guys have seen this kind of idea, 287 00:15:39,240 --> 00:15:44,260 this expanding a solution as a sum of weighted functions. 288 00:15:44,260 --> 00:15:47,270 You've seen that before, right? 289 00:15:47,270 --> 00:15:49,510 When have you seen? 290 00:15:49,510 --> 00:15:50,280 Fourier series. 291 00:15:50,280 --> 00:15:51,864 Good, yes. 292 00:15:51,864 --> 00:15:54,280 So-- I mean this is no different really to Fourier series, 293 00:15:54,280 --> 00:15:54,910 right? 294 00:15:54,910 --> 00:15:59,470 What are the ci's in Fourier series? 295 00:15:59,470 --> 00:16:01,410 Sines and cosines of different frequencies. 296 00:16:01,410 --> 00:16:04,030 So the idea of decomposing a signal 297 00:16:04,030 --> 00:16:07,060 into a sum of harmonic components-- I mean, 298 00:16:07,060 --> 00:16:10,980 signal processing-- the entire field of signal processing 299 00:16:10,980 --> 00:16:13,090 kind of hinges on that idea. 300 00:16:13,090 --> 00:16:16,270 Here we're not going to use sines and cosines. 301 00:16:16,270 --> 00:16:19,427 We're going to use polynomials. 302 00:16:19,427 --> 00:16:21,510 So ci of x are going to be polynomials [? in x. ?] 303 00:16:21,510 --> 00:16:23,510 In other words, c are going to be constant 304 00:16:23,510 --> 00:16:26,140 plus maybe a linear term in x plus maybe 305 00:16:26,140 --> 00:16:28,560 a quadratic term in x, and so on. 306 00:16:28,560 --> 00:16:30,890 And the reason that we're going to use polynomials 307 00:16:30,890 --> 00:16:32,620 is because that sets the groundwork 308 00:16:32,620 --> 00:16:34,730 for the finite element method. 309 00:16:34,730 --> 00:16:37,700 Finite element method works with polynomials, basic functions. 310 00:16:37,700 --> 00:16:41,120 So we're going to start off by thinking about polynomials. 311 00:16:41,120 --> 00:16:42,040 OK? 312 00:16:42,040 --> 00:16:42,692 Good? 313 00:16:42,692 --> 00:16:43,650 Straightforward, right? 314 00:16:43,650 --> 00:16:44,150 Easy. 315 00:16:48,110 --> 00:16:48,991 OK. 316 00:16:48,991 --> 00:16:57,530 So let's just be more specific for our particular example 317 00:16:57,530 --> 00:17:01,750 of what we want to choose for the ci's. 318 00:17:01,750 --> 00:17:07,430 And again, I want to be clear, there are many choices for ci, 319 00:17:07,430 --> 00:17:14,755 and this is a decision that you make. 320 00:17:14,755 --> 00:17:18,180 So this is [INAUDIBLE] choosing the ci's. 321 00:17:22,770 --> 00:17:29,060 So again, here we're go to use polynomials, 322 00:17:29,060 --> 00:17:30,650 and that's because we're interested 323 00:17:30,650 --> 00:17:33,670 in the finite element method. 324 00:17:33,670 --> 00:17:39,270 And you will see on Wednesday exactly what 325 00:17:39,270 --> 00:17:42,530 the basis functions look like in finite element. 326 00:17:42,530 --> 00:17:46,670 But for now, not yet the finite element, 327 00:17:46,670 --> 00:17:53,650 we need basis functions that satisfy the boundary 328 00:17:53,650 --> 00:17:54,250 conditions. 329 00:17:54,250 --> 00:17:55,720 But because we subtracted it off, 330 00:17:55,720 --> 00:17:59,000 or because we added in the 100 here, 331 00:17:59,000 --> 00:18:00,980 you can see it's what I was saying earlier, 332 00:18:00,980 --> 00:18:06,810 we're going to set these guys now to be 0. 333 00:18:06,810 --> 00:18:11,250 So they're going to be 0 at the end of the domain, right? 334 00:18:11,250 --> 00:18:13,790 So if we-- I think we're going to choose polynomials, 335 00:18:13,790 --> 00:18:16,119 so what's the simplest polynomial we could choose? 336 00:18:16,119 --> 00:18:17,910 We could choose [INAUDIBLE] equal constant. 337 00:18:17,910 --> 00:18:18,910 That's not very useful. 338 00:18:18,910 --> 00:18:21,680 What's the next one? 339 00:18:21,680 --> 00:18:22,180 x plus b. 340 00:18:22,180 --> 00:18:25,130 You could use a linear function, but what's the linear function 341 00:18:25,130 --> 00:18:26,994 that satisfies this condition? 342 00:18:26,994 --> 00:18:27,950 AUDIENCE: [INAUDIBLE]. 343 00:18:27,950 --> 00:18:29,075 PROFESSOR: Zero everywhere. 344 00:18:29,075 --> 00:18:30,380 So that's not very useful. 345 00:18:30,380 --> 00:18:32,640 So it turns out that the first one that would give us 346 00:18:32,640 --> 00:18:34,718 anything-- what's that? 347 00:18:34,718 --> 00:18:35,834 AUDIENCE: [INAUDIBLE]. 348 00:18:35,834 --> 00:18:36,500 PROFESSOR: Yeah. 349 00:18:36,500 --> 00:18:38,708 The first one that would give us anything interesting 350 00:18:38,708 --> 00:18:40,880 would be quadratic, or a parabolic function. 351 00:18:40,880 --> 00:18:46,140 So we'll choose a quadratic function 352 00:18:46,140 --> 00:18:50,710 and-- again there is a variety of things 353 00:18:50,710 --> 00:18:52,790 we could do-- but here's one-- here's 354 00:18:52,790 --> 00:18:56,099 a quadratic function, which may be [INAUDIBLE] well 355 00:18:56,099 --> 00:18:56,890 it could be scaled. 356 00:18:56,890 --> 00:18:59,990 1 plus x, 1 minus x, that's a quadratic. 357 00:18:59,990 --> 00:19:04,500 So c1, the first basis function in our extension, 358 00:19:04,500 --> 00:19:06,560 the function of x, and [INAUDIBLE] 359 00:19:06,560 --> 00:19:07,890 is 1 plus x, 1 minus x. 360 00:19:07,890 --> 00:19:10,540 That clearly satisfies the boundary conditions, 361 00:19:10,540 --> 00:19:12,290 the 0 boundary conditions at either end. 362 00:19:12,290 --> 00:19:13,590 Yep. 363 00:19:13,590 --> 00:19:19,330 And then let's also look at cubic. 364 00:19:19,330 --> 00:19:22,170 So that's going to be our second one. 365 00:19:22,170 --> 00:19:24,100 And there are a variety of cubics 366 00:19:24,100 --> 00:19:26,770 we could choose, but let's choose the one that 367 00:19:26,770 --> 00:19:29,560 does x, 1 plus x, 1 minus x. 368 00:19:29,560 --> 00:19:33,390 And again, clearly if we satisfy [INAUDIBLE] x 369 00:19:33,390 --> 00:19:36,770 equal-- if we substitute x equal minus 1, or x equal 1 in there, 370 00:19:36,770 --> 00:19:38,800 we're going to get c2 equal to 0. 371 00:19:38,800 --> 00:19:44,210 So if we sketched out physically what these guys look like, 372 00:19:44,210 --> 00:19:48,060 we sketch c as a function of x, then the quadratic 373 00:19:48,060 --> 00:19:50,950 looks something like that, and the cubic 374 00:19:50,950 --> 00:19:53,660 looks something like that. 375 00:19:53,660 --> 00:19:59,880 So that's c1 of x, and this is c2 of x. 376 00:19:59,880 --> 00:20:01,050 Right, that's 0. 377 00:20:04,730 --> 00:20:05,673 OK. 378 00:20:05,673 --> 00:20:08,780 So those are the choices we make. 379 00:20:08,780 --> 00:20:13,000 And so in this simple example we're 380 00:20:13,000 --> 00:20:14,980 going to use only two degrees of freedom 381 00:20:14,980 --> 00:20:17,390 to describe the approximate solution. 382 00:20:17,390 --> 00:20:20,220 And with those two degrees of freedom, 383 00:20:20,220 --> 00:20:22,140 what is our approximation? 384 00:20:22,140 --> 00:20:31,390 Our approximation is t tilde of x being 100, plus that sum, 385 00:20:31,390 --> 00:20:36,030 which in this case is going to be a1 times c1 of x, where c1 386 00:20:36,030 --> 00:20:42,210 is 1 plus x, 1 minus x, plus a2 times c2 of x, where 387 00:20:42,210 --> 00:20:45,660 c2 is x, 1 plus x, 1 minus x. 388 00:20:45,660 --> 00:20:48,300 OK, so physically we're saying the solution 389 00:20:48,300 --> 00:20:51,700 is 100-- so first of all, just shift it up. 390 00:20:51,700 --> 00:20:52,880 100. 391 00:20:52,880 --> 00:20:56,330 Then take some amount of a function that 392 00:20:56,330 --> 00:21:00,130 looks like this, plus some amount-- 393 00:21:00,130 --> 00:21:02,880 some other amount-- of a function that looks like this. 394 00:21:02,880 --> 00:21:04,334 Add them together. 395 00:21:04,334 --> 00:21:05,750 And now we're going to say, what's 396 00:21:05,750 --> 00:21:08,100 the right-- what are the right weightings? 397 00:21:08,100 --> 00:21:09,780 What are the a1's and a2's that we 398 00:21:09,780 --> 00:21:13,570 should choose so that the function that we get 399 00:21:13,570 --> 00:21:17,740 is somehow reasonably a solution of that model problem 400 00:21:17,740 --> 00:21:21,300 that looks something like this. 401 00:21:21,300 --> 00:21:22,755 Yep. 402 00:21:22,755 --> 00:21:24,630 And that's now what we're going to talk about 403 00:21:24,630 --> 00:21:25,840 with numbers 3 and 4. 404 00:21:25,840 --> 00:21:28,720 The collocation method and the method of weighted residuals 405 00:21:28,720 --> 00:21:32,710 are two different ways that we can come up with the conditions 406 00:21:32,710 --> 00:21:37,090 to help us choose a1 and a2 so that in different ways 407 00:21:37,090 --> 00:21:41,480 we get a solution that is a good, 408 00:21:41,480 --> 00:21:44,400 or just a different kind of an approximation, of the problem 409 00:21:44,400 --> 00:21:46,920 we're actually trying to solve. 410 00:21:46,920 --> 00:21:48,222 OK? 411 00:21:48,222 --> 00:21:50,130 Yep. 412 00:21:50,130 --> 00:21:50,740 All right. 413 00:21:50,740 --> 00:21:52,530 Any questions so far, questions based 414 00:21:52,530 --> 00:21:54,655 on things that are in the notes that weren't clear? 415 00:21:58,607 --> 00:22:00,550 No? 416 00:22:00,550 --> 00:22:02,250 All right. 417 00:22:02,250 --> 00:22:05,075 So that's kind of the easy part. 418 00:22:05,075 --> 00:22:10,560 So now let's talk about the two different ways 419 00:22:10,560 --> 00:22:15,380 that we can come up with conditions that will 420 00:22:15,380 --> 00:22:18,640 let us solve for a1 and a2. 421 00:22:18,640 --> 00:22:24,854 And the first one is going to be the collocation method. 422 00:22:24,854 --> 00:22:29,530 So number three, collocation. 423 00:22:29,530 --> 00:22:30,030 Collocation. 424 00:22:42,090 --> 00:22:42,590 OK. 425 00:22:42,590 --> 00:22:44,480 So again, what are we doing here? 426 00:22:44,480 --> 00:22:53,823 We're saying for the approximate solution t tilde of x being 100 427 00:22:53,823 --> 00:22:59,250 plus the [? extension ?] [INAUDIBLE] in of ai times 428 00:22:59,250 --> 00:23:02,160 the ci of x, where we're, in our simple example, 429 00:23:02,160 --> 00:23:05,890 choosing [? n equal 2 ?] and the ci's to be these two guys here, 430 00:23:05,890 --> 00:23:08,070 quadratic and the cubic. 431 00:23:08,070 --> 00:23:15,774 We need now to determine the ai's. 432 00:23:15,774 --> 00:23:18,642 a1, a2, up to an. 433 00:23:18,642 --> 00:23:22,680 In this case, just a1 and a2. 434 00:23:22,680 --> 00:23:23,180 OK. 435 00:23:23,180 --> 00:23:25,895 So first question, how many conditions 436 00:23:25,895 --> 00:23:27,020 do we need to come up with? 437 00:23:29,870 --> 00:23:30,770 Two. 438 00:23:30,770 --> 00:23:32,050 In general, n conditions. 439 00:23:32,050 --> 00:23:32,550 Right? 440 00:23:32,550 --> 00:23:33,430 We have n unknowns. 441 00:23:33,430 --> 00:23:34,890 We said that over here. 442 00:23:34,890 --> 00:23:36,736 We turned our infinite dimensional problem 443 00:23:36,736 --> 00:23:38,110 of solving the PDE into a problem 444 00:23:38,110 --> 00:23:39,890 with n degrees of freedom. 445 00:23:39,890 --> 00:23:42,810 So now we somehow need n conditions. 446 00:23:42,810 --> 00:23:44,596 And in this example here where we 447 00:23:44,596 --> 00:23:45,970 have just two basic functions, we 448 00:23:45,970 --> 00:23:50,230 need two conditions that will let us solve for a1 and a2. 449 00:23:50,230 --> 00:23:52,590 So what is collocation say? 450 00:23:52,590 --> 00:24:00,820 Collocation says let's pick n points. 451 00:24:00,820 --> 00:24:08,260 We draw my rod back up here from l over 2, minus l over 2, 452 00:24:08,260 --> 00:24:11,070 to l over 2. 453 00:24:11,070 --> 00:24:13,120 Let's pick some points. 454 00:24:13,120 --> 00:24:15,190 In particular, let's take n points, 455 00:24:15,190 --> 00:24:18,790 so let's pick two points in the domain, this point 456 00:24:18,790 --> 00:24:20,360 and this point. 457 00:24:20,360 --> 00:24:23,170 And let's enforce the PDE at those points. 458 00:24:23,170 --> 00:24:26,880 Let's make sure that the PDE is satisfied. 459 00:24:26,880 --> 00:24:30,710 Everyone know what the PDE is? d by dx of kdtdx equals minus 2. 460 00:24:30,710 --> 00:24:36,035 Let's have the solution satisfy the PDE at those points. 461 00:24:36,035 --> 00:24:37,820 OK? 462 00:24:37,820 --> 00:24:40,967 And by forcing that-- forcing the PDE to be satisfied 463 00:24:40,967 --> 00:24:43,050 with the approximate solution at those two points, 464 00:24:43,050 --> 00:24:45,100 we're going to two conditions. 465 00:24:45,100 --> 00:24:45,924 Right? 466 00:24:45,924 --> 00:24:47,090 Two mathematical conditions. 467 00:24:47,090 --> 00:24:50,756 Two equations, two unknowns, we should be able to solve. 468 00:24:50,756 --> 00:24:52,400 So that's the idea with collocation. 469 00:24:52,400 --> 00:24:53,941 You guys have seen-- did you guys see 470 00:24:53,941 --> 00:24:56,670 collocation in aerodynamics? 471 00:24:56,670 --> 00:24:57,526 [INAUDIBLE], yeah. 472 00:24:57,526 --> 00:24:58,150 What do you do? 473 00:24:58,150 --> 00:25:01,113 You have the collocation point at-- which-- I always 474 00:25:01,113 --> 00:25:03,488 forget which way it is-- you have c over 4 and 3c over 4, 475 00:25:03,488 --> 00:25:04,336 right? 476 00:25:04,336 --> 00:25:05,315 [INAUDIBLE] 477 00:25:05,315 --> 00:25:06,190 AUDIENCE: [INAUDIBLE] 478 00:25:11,680 --> 00:25:13,630 PROFESSOR: At 3, [INAUDIBLE]. 479 00:25:13,630 --> 00:25:14,600 So it's the same idea. 480 00:25:14,600 --> 00:25:16,500 The collocation point is the point at which 481 00:25:16,500 --> 00:25:18,820 you enforce the condition. 482 00:25:18,820 --> 00:25:22,010 So it's exactly the same idea. 483 00:25:22,010 --> 00:25:26,590 OK, so how does that work out mathematically? 484 00:25:26,590 --> 00:25:30,020 So that's what collcation-- that's what collocation means. 485 00:25:30,020 --> 00:25:35,080 We're going to enforce the PDE at n point. 486 00:25:35,080 --> 00:25:35,829 OK. 487 00:25:35,829 --> 00:25:37,120 How are we going to write that? 488 00:25:37,120 --> 00:25:41,035 So let's again write down the example 489 00:25:41,035 --> 00:25:47,130 that we're considering, which is the 1d heat equation. 490 00:25:47,130 --> 00:25:49,010 And I'll write it in the general form 491 00:25:49,010 --> 00:25:53,840 here with the k still in there. 492 00:25:53,840 --> 00:26:01,110 d by dx of k dt dx equals to minus q. 493 00:26:03,660 --> 00:26:12,990 OK, so now we're going to define something very important, which 494 00:26:12,990 --> 00:26:15,730 is the residual. 495 00:26:15,730 --> 00:26:19,220 And this is a really important concept 496 00:26:19,220 --> 00:26:21,470 that we're going to use repeatedly 497 00:26:21,470 --> 00:26:25,660 all the way through this finite element module. 498 00:26:25,660 --> 00:26:27,790 So what is the residual? 499 00:26:27,790 --> 00:26:31,390 We're going to call it capital R. It's 500 00:26:31,390 --> 00:26:35,100 going to be a function of our approximate solution, 501 00:26:35,100 --> 00:26:36,478 and it's a function of x. 502 00:26:39,620 --> 00:26:43,370 And for this 1D heat equation, what's the residual? 503 00:26:43,370 --> 00:26:50,880 It's d by dx of [? kdtdx ?] tilde dx plus [? q. ?] 504 00:26:57,530 --> 00:27:05,530 OK, so 1D heat equation, d by dx of of kdtdx equals minus 2. 505 00:27:05,530 --> 00:27:08,100 The residual for that equation, which 506 00:27:08,100 --> 00:27:10,490 is a function of the approximate solution, 507 00:27:10,490 --> 00:27:13,014 t tilde-- so you want to mark that this 508 00:27:13,014 --> 00:27:19,458 is your approximate solution to remind yourself-- 509 00:27:19,458 --> 00:27:21,540 function of the approximate solution n 510 00:27:21,540 --> 00:27:27,780 of x is d by dx of kd t tilde dx plus q. 511 00:27:27,780 --> 00:27:31,780 So does someone want to give me in words, what is the residual? 512 00:27:31,780 --> 00:27:34,827 Use some words to describe it. 513 00:27:37,264 --> 00:27:38,180 AUDIENCE: [INAUDIBLE]. 514 00:27:42,012 --> 00:27:43,710 PROFESSOR: Yeah, good. 515 00:27:43,710 --> 00:27:47,350 So the residual is the amount that the approximate solution 516 00:27:47,350 --> 00:27:49,694 doesn't satisfy the PDE. 517 00:27:49,694 --> 00:27:51,860 In other words, if we come back to our original PDE, 518 00:27:51,860 --> 00:27:53,693 we brought everything to the left hand side. 519 00:27:53,693 --> 00:27:59,554 So it would read d by dx of kdtdx plus q equals 0. 520 00:27:59,554 --> 00:28:03,010 Then if we take, instead of t, the actual solution, 521 00:28:03,010 --> 00:28:05,810 if we take an approximate solution, t tilde, 522 00:28:05,810 --> 00:28:08,170 we substituted it in, the residual 523 00:28:08,170 --> 00:28:11,280 is how much we get that's different from 0. 524 00:28:11,280 --> 00:28:15,950 So it tells us by how much the approximate solution, t tilde, 525 00:28:15,950 --> 00:28:19,980 does not satisfy the [INAUDIBLE] equation. 526 00:28:19,980 --> 00:28:21,140 Yes? 527 00:28:21,140 --> 00:28:23,410 So someone tell me, how is the residual-- 528 00:28:23,410 --> 00:28:26,280 is the residual the same thing as the error? 529 00:28:26,280 --> 00:28:28,900 If I define the error to be the difference 530 00:28:28,900 --> 00:28:33,520 between the exact solution, t, and the approximate solution t 531 00:28:33,520 --> 00:28:36,314 tilde, is the residual the same thing as the error? 532 00:28:40,130 --> 00:28:40,955 Not the same thing. 533 00:28:40,955 --> 00:28:44,214 So how is it different? 534 00:28:44,214 --> 00:28:45,130 AUDIENCE: [INAUDIBLE]. 535 00:28:51,725 --> 00:28:52,350 PROFESSOR: Yes. 536 00:28:52,350 --> 00:28:53,570 So let's think about that. 537 00:28:53,570 --> 00:29:04,716 So if we define the error to be t minus t tilde, 538 00:29:04,716 --> 00:29:07,489 this will be our-- is this thing a function 539 00:29:07,489 --> 00:29:08,405 over the whole domain? 540 00:29:13,190 --> 00:29:15,820 Is e a function of x? 541 00:29:15,820 --> 00:29:16,540 Yeah. 542 00:29:16,540 --> 00:29:18,010 Right. 543 00:29:18,010 --> 00:29:21,840 So e is a function of x if it's t of x minus t tilde of x. 544 00:29:21,840 --> 00:29:22,902 Yeah? 545 00:29:22,902 --> 00:29:23,860 How about the residual? 546 00:29:23,860 --> 00:29:26,840 Is the residual a function of x? 547 00:29:26,840 --> 00:29:27,340 Yeah. 548 00:29:27,340 --> 00:29:29,740 So they're actually both-- they're both functions 549 00:29:29,740 --> 00:29:32,692 that we could plot-- we could plot over 550 00:29:32,692 --> 00:29:33,650 the whole the domain x. 551 00:29:33,650 --> 00:29:38,744 We could plot e of x and we could plot r of t tilde, x. 552 00:29:38,744 --> 00:29:40,160 So they're both functions that are 553 00:29:40,160 --> 00:29:42,960 defined over the whole domain. 554 00:29:42,960 --> 00:29:45,073 But they're measuring different things, right? 555 00:29:48,504 --> 00:29:49,420 AUDIENCE: [INAUDIBLE]. 556 00:29:57,160 --> 00:29:58,280 PROFESSOR: Yeah. 557 00:29:58,280 --> 00:29:59,230 That's exactly right. 558 00:29:59,230 --> 00:30:03,810 The error is measuring how wrong is t-- t of x. 559 00:30:03,810 --> 00:30:05,700 What's the error in t. 560 00:30:05,700 --> 00:30:08,080 But the residual is measuring how far 561 00:30:08,080 --> 00:30:10,350 is the equation from being satisfied. 562 00:30:10,350 --> 00:30:13,589 What's really amazing about the residual? 563 00:30:13,589 --> 00:30:14,088 Yeah? 564 00:30:14,088 --> 00:30:14,980 AUDIENCE: [INAUDIBLE]. 565 00:30:14,980 --> 00:30:16,040 PROFESSOR: Exactly right. 566 00:30:16,040 --> 00:30:18,920 Which is real-- isn't that cool? 567 00:30:18,920 --> 00:30:21,550 And that's kind of-- I mean, I think in a way that's 568 00:30:21,550 --> 00:30:23,410 kind of like the amazing breakthrough here, 569 00:30:23,410 --> 00:30:26,145 is that yeah we'd love to know the error, 570 00:30:26,145 --> 00:30:27,520 but if we knew the error we would 571 00:30:27,520 --> 00:30:30,500 know the true solution, so then why would we 572 00:30:30,500 --> 00:30:31,474 be doing all of this? 573 00:30:31,474 --> 00:30:33,140 The really cool thing about the residual 574 00:30:33,140 --> 00:30:36,540 is that we don't need to know the true solution. 575 00:30:36,540 --> 00:30:38,640 We can take our approximate solution. 576 00:30:38,640 --> 00:30:42,300 We know the equation that should satisfy. 577 00:30:42,300 --> 00:30:45,210 And we can measure how far off it is. 578 00:30:45,210 --> 00:30:48,100 Now just because the residual is small, 579 00:30:48,100 --> 00:30:50,260 doesn't mean the error is going to be small. 580 00:30:50,260 --> 00:30:52,010 And that's a whole kind of field of study. 581 00:30:52,010 --> 00:30:56,537 Depending on the PDE that you're studying, 582 00:30:56,537 --> 00:30:58,620 for this particular PDE, it turns out the residual 583 00:30:58,620 --> 00:31:01,210 and the error will be nicely related. 584 00:31:01,210 --> 00:31:03,870 But if you have a nasty PDE, the residual 585 00:31:03,870 --> 00:31:06,030 might not be a good indication of what's going on. 586 00:31:06,030 --> 00:31:08,220 But it's still a very powerful thing 587 00:31:08,220 --> 00:31:10,087 that can give you a sense of how good is 588 00:31:10,087 --> 00:31:12,170 your approximate solution without actually knowing 589 00:31:12,170 --> 00:31:12,670 the truth. 590 00:31:12,670 --> 00:31:15,720 And we're going to use this idea of a residual 591 00:31:15,720 --> 00:31:18,270 over and over and over again, because we don't need 592 00:31:18,270 --> 00:31:19,860 to know the actual solution. 593 00:31:23,605 --> 00:31:24,980 Sometimes I know the residual can 594 00:31:24,980 --> 00:31:26,688 be something that gets people tripped up, 595 00:31:26,688 --> 00:31:28,820 because they're kind of-- it's pretty neat, right? 596 00:31:28,820 --> 00:31:31,400 Take the approximation, substitute it into the PDE, 597 00:31:31,400 --> 00:31:33,650 and see how well you're doing. 598 00:31:33,650 --> 00:31:35,177 Not the same thing as the error. 599 00:31:38,586 --> 00:31:42,969 So one thing-- so, no it's not the same as the error, 600 00:31:42,969 --> 00:31:44,510 but one thing we do know is that what 601 00:31:44,510 --> 00:31:48,490 happens if I substitute an exact solution here, 602 00:31:48,490 --> 00:31:50,629 residual is 0 everywhere. 603 00:31:50,629 --> 00:31:51,129 Yeah. 604 00:31:51,129 --> 00:31:53,370 OK. 605 00:31:53,370 --> 00:31:53,880 All right. 606 00:31:53,880 --> 00:32:04,550 So how is that going to help us with our collocation method? 607 00:32:04,550 --> 00:32:09,420 So we defined the residual. 608 00:32:09,420 --> 00:32:14,896 And what we're going to do-- you can see now 609 00:32:14,896 --> 00:32:17,020 what we're going to do with the collocation method, 610 00:32:17,020 --> 00:32:19,850 is when I said that we enforce the PDE, in point what we're 611 00:32:19,850 --> 00:32:22,450 going to do is we're going to set the residual to be 612 00:32:22,450 --> 00:32:24,284 0 at n point. 613 00:32:24,284 --> 00:32:25,950 So in other words we're going to pick n. 614 00:32:25,950 --> 00:32:28,451 In our case 2 values of x. 615 00:32:28,451 --> 00:32:28,950 Right? 616 00:32:28,950 --> 00:32:30,658 So remember we said that the residual was 617 00:32:30,658 --> 00:32:32,700 a function of x, something? 618 00:32:32,700 --> 00:32:35,060 We're going to pick two values of x. 619 00:32:35,060 --> 00:32:36,730 We're going to set the residual to be 620 00:32:36,730 --> 00:32:38,220 0 at those particular points. 621 00:32:38,220 --> 00:32:39,660 Pin them down. 622 00:32:39,660 --> 00:32:42,570 And that's going to give us the two conditions that we need 623 00:32:42,570 --> 00:32:45,640 to solve for the two coefficients, a1 and a2, that 624 00:32:45,640 --> 00:32:49,070 are multiplying our basic function. 625 00:32:49,070 --> 00:32:49,690 OK? 626 00:32:49,690 --> 00:32:51,760 That logic is clear? 627 00:32:51,760 --> 00:32:52,260 Yep. 628 00:32:52,260 --> 00:32:55,820 So we can just work through the math that actually does this. 629 00:32:55,820 --> 00:33:00,300 And I won't go in too much detail, 630 00:33:00,300 --> 00:33:03,810 but if you want me to back up and do any more of the detail, 631 00:33:03,810 --> 00:33:04,310 can do. 632 00:33:04,310 --> 00:33:09,793 So in our example, remember we set k to be 1 633 00:33:09,793 --> 00:33:12,942 and q was 50e to the x. 634 00:33:12,942 --> 00:33:15,490 So this is a situation where we do have the exact solution 635 00:33:15,490 --> 00:33:17,080 but we don't want to use it. 636 00:33:17,080 --> 00:33:20,063 And again, just to remind you that our approximate solution 637 00:33:20,063 --> 00:33:23,510 is this expansion that looks like 100 638 00:33:23,510 --> 00:33:28,160 plus some amount, a1 times our quadratic basic function, 639 00:33:28,160 --> 00:33:38,080 c1, plus some amount a2, times our cubic basis function, c2. 640 00:33:38,080 --> 00:33:40,350 And actually let me write that out. 641 00:33:40,350 --> 00:33:51,420 It's 100 plus a1, 1 plus x, 1 minus x, plus a to x, 1 plus x, 642 00:33:51,420 --> 00:33:52,536 1 minus x. 643 00:33:56,631 --> 00:33:57,130 OK. 644 00:33:57,130 --> 00:33:58,470 So here's our residual. 645 00:33:58,470 --> 00:34:01,490 It's d by dx-- the k is just 1, so it's actually 646 00:34:01,490 --> 00:34:05,380 second derivative of the approximate solution plus q. 647 00:34:05,380 --> 00:34:10,040 So we're going to need a second derivative 648 00:34:10,040 --> 00:34:15,535 of our approximate solution with respect to x. 649 00:34:15,535 --> 00:34:21,132 So the 100 is going to go away from this guy. 650 00:34:21,132 --> 00:34:22,090 What am I going to get? 651 00:34:22,090 --> 00:34:24,506 Only the quadratic terms are going to stick around, right? 652 00:34:24,506 --> 00:34:28,823 I'm going to get a minus x squared multiplying a1. 653 00:34:28,823 --> 00:34:30,989 So when I differentiate that-- where I differentiate 654 00:34:30,989 --> 00:34:34,570 that twice, I'm going to get minus [? 2a1. ?] 655 00:34:34,570 --> 00:34:40,048 And then from this guy here I'm going to have the cubic term-- 656 00:34:40,048 --> 00:34:42,070 is that me beeping? 657 00:34:42,070 --> 00:34:43,489 Oh that's you. 658 00:34:43,489 --> 00:34:43,989 OK. 659 00:34:43,989 --> 00:34:45,319 It's your shoe beeping? 660 00:34:45,319 --> 00:34:47,184 AUDIENCE: [INAUDIBLE]. 661 00:34:47,184 --> 00:34:48,525 PROFESSOR: OK. 662 00:34:48,525 --> 00:34:49,870 All right. 663 00:34:49,870 --> 00:34:50,680 Cubic term. 664 00:34:50,680 --> 00:34:55,199 We're going to have minus x cubed times a a2. 665 00:34:55,199 --> 00:35:00,709 So we're going to get minus [? 6a2 ?] times x coming out, 666 00:35:00,709 --> 00:35:02,250 and then the quadratic terms actually 667 00:35:02,250 --> 00:35:07,701 drop away in that last one. 668 00:35:07,701 --> 00:35:08,200 OK. 669 00:35:08,200 --> 00:35:13,370 So there's the second derivative of the approximate solution. 670 00:35:13,370 --> 00:35:15,880 And you know, again, we've still got these constants hanging 671 00:35:15,880 --> 00:35:19,316 around, because we don't know what they are yet. 672 00:35:19,316 --> 00:35:21,840 So we can substitute that in to our expression 673 00:35:21,840 --> 00:35:24,570 for the residual, which again is a function 674 00:35:24,570 --> 00:35:27,680 of our approximate solution and x. 675 00:35:27,680 --> 00:35:33,460 And it's just-- that second derivative is 1 plus q. 676 00:35:33,460 --> 00:35:38,920 So it's going to be minus 2a 1, minus 6a2 times x, 677 00:35:38,920 --> 00:35:40,986 plus q, which is 50e to the x. 678 00:35:44,541 --> 00:35:45,040 OK. 679 00:35:45,040 --> 00:35:49,226 So there's the expression for the residual for this problem. 680 00:35:49,226 --> 00:35:50,850 So you look at this and you immediately 681 00:35:50,850 --> 00:35:55,410 see, well, there's no way the residual can be 0 everywhere, 682 00:35:55,410 --> 00:35:55,980 right? 683 00:35:55,980 --> 00:35:58,090 There's no way that this linear term-- 684 00:35:58,090 --> 00:35:59,770 no matter what we choose for a1 and a2, 685 00:35:59,770 --> 00:36:01,520 there's no way we can make it equal to 50x 686 00:36:01,520 --> 00:36:05,120 to the x for all values of x between minus 1 and 1. 687 00:36:05,120 --> 00:36:07,620 So that immediately tells you that those two basis functions 688 00:36:07,620 --> 00:36:11,870 we used are not rich enough to describe the solution exactly, 689 00:36:11,870 --> 00:36:14,015 which is not really a surprise, right? 690 00:36:14,015 --> 00:36:15,390 But now the question is, what are 691 00:36:15,390 --> 00:36:18,820 good choices that we can make for a1 and a2 692 00:36:18,820 --> 00:36:22,040 so that we get a decent solution? 693 00:36:22,040 --> 00:36:25,050 And again, what are we going to do? 694 00:36:25,050 --> 00:36:26,470 With the collocation method we're 695 00:36:26,470 --> 00:36:31,790 going to pick a couple of points for x. 696 00:36:31,790 --> 00:36:35,120 And we're going to set the residual to 0 at those points. 697 00:36:35,120 --> 00:36:37,190 That's going to give us the condition. 698 00:36:37,190 --> 00:36:39,420 And then we'll solve for a1 and a2. 699 00:36:43,121 --> 00:36:50,627 So-- yep? 700 00:36:50,627 --> 00:36:51,502 AUDIENCE: [INAUDIBLE] 701 00:36:54,980 --> 00:36:59,520 PROFESSOR: So if the source was 0-- if q were equal to 0, 702 00:36:59,520 --> 00:37:04,394 and this were the residual, what would you choose for a1 and a2? 703 00:37:08,870 --> 00:37:10,360 You could put them to be 0. 704 00:37:10,360 --> 00:37:13,482 So you could make the residual 0 everywhere. 705 00:37:13,482 --> 00:37:16,065 What would then-- what would our approximate solution be then? 706 00:37:16,065 --> 00:37:18,182 AUDIENCE: [INAUDIBLE]. 707 00:37:18,182 --> 00:37:19,390 PROFESSOR: Yeah, t equal 100. 708 00:37:19,390 --> 00:37:20,760 So if you think about the physical problem, 709 00:37:20,760 --> 00:37:23,240 if you had 0 heat source and you pin the temperature 710 00:37:23,240 --> 00:37:26,210 to be 100 and 100 on either end, that would be the solution. 711 00:37:26,210 --> 00:37:28,865 So there's an example of a source where-- 712 00:37:28,865 --> 00:37:31,240 I mean, it's kind of a trivial solution but-- of a source 713 00:37:31,240 --> 00:37:32,865 where you could get the exact solution. 714 00:37:32,865 --> 00:37:34,704 Yeah? 715 00:37:34,704 --> 00:37:35,620 AUDIENCE: [INAUDIBLE]. 716 00:37:45,440 --> 00:37:47,310 PROFESSOR: Yeah. 717 00:37:47,310 --> 00:37:49,054 AUDIENCE: [INAUDIBLE]. 718 00:37:49,054 --> 00:37:49,720 PROFESSOR: Yeah. 719 00:37:49,720 --> 00:37:53,240 So the question is, if we have a q that basically we 720 00:37:53,240 --> 00:37:57,350 can't do the integration by hand, what would we do? 721 00:37:57,350 --> 00:37:58,990 That's a very good question, and we're 722 00:37:58,990 --> 00:38:00,497 going to talk about that, too. 723 00:38:03,300 --> 00:38:04,919 You're going to see some-- in fact 724 00:38:04,919 --> 00:38:06,960 you've already seen, probably in the pre-reading, 725 00:38:06,960 --> 00:38:08,912 some of the integrals that show up with two. 726 00:38:08,912 --> 00:38:10,370 If you can't integrate analytically 727 00:38:10,370 --> 00:38:12,244 there's something called Gaussian quadrature. 728 00:38:12,244 --> 00:38:14,050 So quadrature is a way to numerically do 729 00:38:14,050 --> 00:38:16,752 integrals that are basically too hard to do analytically. 730 00:38:16,752 --> 00:38:18,710 So that's going to be in the pre-reading that's 731 00:38:18,710 --> 00:38:21,233 due next Monday, and probably [INAUDIBLE] will 732 00:38:21,233 --> 00:38:24,470 be covering it in class I would say probably on Monday. 733 00:38:24,470 --> 00:38:25,950 So there are ways that basically we 734 00:38:25,950 --> 00:38:28,806 can numerically integrate things that we can't do by hand. 735 00:38:28,806 --> 00:38:29,732 PROFESSOR: Yep?. 736 00:38:29,732 --> 00:38:32,194 AUDIENCE: [INAUDIBLE]. 737 00:38:32,194 --> 00:38:32,860 PROFESSOR: Yeah. 738 00:38:32,860 --> 00:38:33,845 So in that case, is there's going 739 00:38:33,845 --> 00:38:35,980 to be-- what you'll see is, when we actually 740 00:38:35,980 --> 00:38:37,400 get to talking about the finite element method, 741 00:38:37,400 --> 00:38:39,490 that there's a bunch of integrals we have to do. 742 00:38:39,490 --> 00:38:41,680 By using quadrature you're going to actually end up 743 00:38:41,680 --> 00:38:43,179 having to approximate the integrals, 744 00:38:43,179 --> 00:38:45,684 but be doing integrals over sort of small elements. 745 00:38:45,684 --> 00:38:48,100 But yes, the quadrature is going to introduce a little bit 746 00:38:48,100 --> 00:38:50,008 of additional error. 747 00:38:50,008 --> 00:38:51,381 Yeah. 748 00:38:51,381 --> 00:38:51,880 Yeah. 749 00:38:56,570 --> 00:38:57,070 OK. 750 00:38:57,070 --> 00:38:59,520 So we have the expression for the residual. 751 00:38:59,520 --> 00:39:03,190 And so now what we're going to do is pick n equal [? two ?] 752 00:39:03,190 --> 00:39:05,422 collocation points. 753 00:39:05,422 --> 00:39:13,210 So again, just to remind you, collocation method 754 00:39:13,210 --> 00:39:22,070 says enforce the PDE at n equals two points. 755 00:39:22,070 --> 00:39:24,450 And enforcing the PDE, what does that mean? 756 00:39:24,450 --> 00:39:28,010 Enforce the PDE means i.e. 757 00:39:28,010 --> 00:39:38,180 set the residual equal to 0 at two-- and by points 758 00:39:38,180 --> 00:39:43,060 we mean two values of x-- two points in the domain. 759 00:39:43,060 --> 00:39:46,180 And here's our domain. 760 00:39:46,180 --> 00:39:48,330 There's x. 761 00:39:48,330 --> 00:39:51,220 Remember, we're going from-- we've got [INAUDIBLE] 762 00:39:51,220 --> 00:39:52,860 so it goes from minus 1 to 1. 763 00:39:52,860 --> 00:39:56,400 So there's 0 in the middle. 764 00:39:56,400 --> 00:39:58,090 And the collocation points we're going 765 00:39:58,090 --> 00:40:02,290 to choose there and there. 766 00:40:02,290 --> 00:40:06,050 That's minus one third and plus on third. 767 00:40:06,050 --> 00:40:07,570 And those are the collocation points 768 00:40:07,570 --> 00:40:09,950 that spread things out the most, kind of away from putting up 769 00:40:09,950 --> 00:40:11,970 the boundary conditions here at minus 1 and 1. 770 00:40:15,352 --> 00:40:16,810 So [INAUDIBLE] that we don't really 771 00:40:16,810 --> 00:40:18,400 use the collocation method. 772 00:40:18,400 --> 00:40:19,410 It's not a good idea. 773 00:40:19,410 --> 00:40:20,785 One of the reasons we're doing it 774 00:40:20,785 --> 00:40:22,570 is because it's a good stepping stone 775 00:40:22,570 --> 00:40:26,100 to see how the weighted residual works. 776 00:40:26,100 --> 00:40:28,700 But that's a good question, because in some cases 777 00:40:28,700 --> 00:40:32,070 people do use collocation, and aerodynamics is a good example. 778 00:40:32,070 --> 00:40:34,410 And the reason you use the 3/4 quad point 779 00:40:34,410 --> 00:40:38,450 is because for a particular kind of left distribution, that 780 00:40:38,450 --> 00:40:40,540 integrates you exactly. 781 00:40:40,540 --> 00:40:43,060 And in fact, your question is somewhat related 782 00:40:43,060 --> 00:40:44,904 to the question about numerical integration. 783 00:40:44,904 --> 00:40:46,404 When we see quadrature, you're going 784 00:40:46,404 --> 00:40:48,960 to see it's the same-- it's going to be different settings, 785 00:40:48,960 --> 00:40:51,085 I don't want to confuse you about quadrature-- when 786 00:40:51,085 --> 00:40:53,300 you do numerical integration, we're 787 00:40:53,300 --> 00:40:57,000 going to put points in the integration domain. 788 00:40:57,000 --> 00:40:59,660 And those points are chosen in a particular way 789 00:40:59,660 --> 00:41:03,370 so that we can integrate certain functions exactly. 790 00:41:03,370 --> 00:41:05,835 So it's-- here they've chosen to be spaced out-- 791 00:41:05,835 --> 00:41:07,210 there's actually all these rules, 792 00:41:07,210 --> 00:41:10,880 they're called quadrature rules, and they're all these different 793 00:41:10,880 --> 00:41:14,080 kinds of points, and they actually tend to be named after 794 00:41:14,080 --> 00:41:15,580 mathematicians who discovered them-- 795 00:41:15,580 --> 00:41:18,980 different patterns of points where it says, 796 00:41:18,980 --> 00:41:23,640 space things evenly, or distribute them out. 797 00:41:23,640 --> 00:41:25,839 That's actually a pretty interesting area of study. 798 00:41:25,839 --> 00:41:28,380 In fact, Alex I would say knows a lot more about these things 799 00:41:28,380 --> 00:41:29,380 than I do. 800 00:41:29,380 --> 00:41:31,330 Is that true, Alex? 801 00:41:31,330 --> 00:41:34,440 What's your favorite set of points? 802 00:41:34,440 --> 00:41:36,080 AUDIENCE: [INAUDIBLE]. 803 00:41:36,080 --> 00:41:37,076 PROFESSOR: [INAUDIBLE]? 804 00:41:37,076 --> 00:41:39,060 So depending on the function you're trying to integrate, 805 00:41:39,060 --> 00:41:40,810 there are sort of optimal choices of where 806 00:41:40,810 --> 00:41:42,659 you might put the point. 807 00:41:42,659 --> 00:41:43,575 AUDIENCE: [INAUDIBLE]. 808 00:41:46,574 --> 00:41:48,990 PROFESSOR: Yeah, something about the solution or something 809 00:41:48,990 --> 00:41:52,190 about the basis function that you're using 810 00:41:52,190 --> 00:41:53,480 to represent the solution. 811 00:41:56,064 --> 00:41:56,980 AUDIENCE: [INAUDIBLE]. 812 00:42:05,864 --> 00:42:06,530 PROFESSOR: Yeah. 813 00:42:06,530 --> 00:42:07,571 So that's a really good-- 814 00:42:07,571 --> 00:42:08,720 AUDIENCE: [INAUDIBLE]. 815 00:42:08,720 --> 00:42:09,520 PROFESSOR: --that's a really good question. 816 00:42:09,520 --> 00:42:11,160 So if you're trying to approximate things, 817 00:42:11,160 --> 00:42:12,410 but you know there's something in the middle 818 00:42:12,410 --> 00:42:14,170 that you would really care about-- 819 00:42:14,170 --> 00:42:17,180 so now what you're talking about is an adaptive strategy. 820 00:42:17,180 --> 00:42:19,910 And again, this is a very current area of research. 821 00:42:19,910 --> 00:42:21,980 In fact, a lot of [? professor ?] [INAUDIBLE] 822 00:42:21,980 --> 00:42:23,938 research [? facilities ?] I think mention there 823 00:42:23,938 --> 00:42:26,630 at the beginning that uses adjoint methods. 824 00:42:26,630 --> 00:42:29,710 So that would be bringing in information that tells you 825 00:42:29,710 --> 00:42:32,660 where the regions in the domain that are most sensitive to what 826 00:42:32,660 --> 00:42:37,010 it is you care about, where might you put more points. 827 00:42:37,010 --> 00:42:39,960 People who choose points to do this quadrature, 828 00:42:39,960 --> 00:42:42,474 or this numerical integration, sometimes 829 00:42:42,474 --> 00:42:44,210 will choose to adapt in these ways. 830 00:42:44,210 --> 00:42:46,240 And what you would like is, you would 831 00:42:46,240 --> 00:42:48,390 like kind of general rules that work well, 832 00:42:48,390 --> 00:42:51,110 but then you would like to be able to adapt depending 833 00:42:51,110 --> 00:42:53,412 on your particular problem of interest. 834 00:42:53,412 --> 00:42:55,620 And there are definitely a lot of adaptive strategies 835 00:42:55,620 --> 00:42:57,850 out there, but it's also an area that a lot of people 836 00:42:57,850 --> 00:43:00,347 are working on. 837 00:43:00,347 --> 00:43:00,930 Good question. 838 00:43:03,460 --> 00:43:06,320 So you guys are all ready for the lecture on quadrature. 839 00:43:06,320 --> 00:43:09,390 In fact, when we come to talk about Monte Carlo integration-- 840 00:43:09,390 --> 00:43:12,537 Monte Carlo methods-- I mean, evaluating means and variances. 841 00:43:12,537 --> 00:43:13,870 That's just integration as well. 842 00:43:13,870 --> 00:43:15,959 That's all just about putting points in a domain. 843 00:43:15,959 --> 00:43:18,500 And what you're going to see is Monte Carlo does it randomly, 844 00:43:18,500 --> 00:43:21,120 but in some cases you can do better 845 00:43:21,120 --> 00:43:23,800 by putting them in a very spec-- putting the points in a very 846 00:43:23,800 --> 00:43:24,714 specific way. 847 00:43:28,350 --> 00:43:29,010 OK. 848 00:43:29,010 --> 00:43:31,510 But here we're going to do just [INAUDIBLE] we're in 1D, so, 849 00:43:31,510 --> 00:43:34,880 in 1D you can usually get away with pretty much anything. 850 00:43:34,880 --> 00:43:39,740 We're going to just put them at minus a third and a third. 851 00:43:39,740 --> 00:43:42,670 So what that is, again, [? sit ?] the residual. 852 00:43:42,670 --> 00:43:46,390 And I'm purposely writing out all 853 00:43:46,390 --> 00:43:48,340 the functional dependencies. 854 00:43:48,340 --> 00:43:51,230 I keep writing r of t tilde comma 855 00:43:51,230 --> 00:43:53,750 x because it helps me remember that residual 856 00:43:53,750 --> 00:43:55,286 is a function of x. 857 00:43:55,286 --> 00:43:56,950 And so what I'm doing here is I'm 858 00:43:56,950 --> 00:43:59,560 evaluating the residual at the point 859 00:43:59,560 --> 00:44:03,400 x equal to minus one third, that's a point on my domain. 860 00:44:03,400 --> 00:44:06,380 So that means substitute x equal minus one third 861 00:44:06,380 --> 00:44:09,270 into my expression for the residual, which 862 00:44:09,270 --> 00:44:17,190 gives this 50e to the minus one third, and put that equal to 0. 863 00:44:17,190 --> 00:44:17,690 Right? 864 00:44:17,690 --> 00:44:19,500 So there's the first condition. 865 00:44:19,500 --> 00:44:23,750 And then the second condition is original evaluated 866 00:44:23,750 --> 00:44:24,850 plus one third. 867 00:44:24,850 --> 00:44:29,659 Again, substitute that in to the expression. 868 00:44:29,659 --> 00:44:31,200 So we're just changing the sign here. 869 00:44:31,200 --> 00:44:35,670 And then this is going to be 50e to the plus one third. 870 00:44:35,670 --> 00:44:37,300 And that's been set equal to 0. 871 00:44:40,060 --> 00:44:43,310 So now you can see we reduced-- we keep 872 00:44:43,310 --> 00:44:44,700 sort of reducing the problem. 873 00:44:44,700 --> 00:44:46,600 The first thing we did was assume 874 00:44:46,600 --> 00:44:50,750 the functions-- these guys-- that we want 875 00:44:50,750 --> 00:44:52,760 to approximate the solution in. 876 00:44:52,760 --> 00:44:56,560 Then we take-- we've got two degrees of freedom to unknown, 877 00:44:56,560 --> 00:44:58,140 so let's use a collocation method. 878 00:44:58,140 --> 00:45:01,180 We set the residual to be 0 at two points. 879 00:45:01,180 --> 00:45:02,872 We chose these two points. 880 00:45:02,872 --> 00:45:04,205 We've enforced these conditions. 881 00:45:04,205 --> 00:45:06,984 Now we have two equations, two unknowns. 882 00:45:06,984 --> 00:45:08,650 We could solve that-- you could probably 883 00:45:08,650 --> 00:45:12,920 solve that analytically, or using mathematical, 884 00:45:12,920 --> 00:45:13,970 or whatever you like. 885 00:45:13,970 --> 00:45:21,320 And what you find is that a1 and a2-- 26.4 and 8.5. 886 00:45:21,320 --> 00:45:24,338 So those numbers don't mean a whole lot to us, 887 00:45:24,338 --> 00:45:27,290 but again, what's the key? 888 00:45:27,290 --> 00:45:31,330 The key is that this is our approximation of the solution. 889 00:45:31,330 --> 00:45:34,920 So we're saying that by the collocation method, 890 00:45:34,920 --> 00:45:36,740 the approximate solution of t tilde 891 00:45:36,740 --> 00:45:41,760 is 100 plus 26.4 times something that 892 00:45:41,760 --> 00:45:47,610 looks like that-- a quadtratic-- minus plus 8.5 times something 893 00:45:47,610 --> 00:45:49,660 that looks like that [? cubed. ?] 894 00:45:49,660 --> 00:45:51,257 And when you add those together you 895 00:45:51,257 --> 00:45:57,080 get something that is at least an approximate solution 896 00:45:57,080 --> 00:45:59,920 to the PDE. 897 00:45:59,920 --> 00:46:03,122 So I want to take a look at what that solution looks like. 898 00:46:03,122 --> 00:46:06,400 While I put the projector on, are there 899 00:46:06,400 --> 00:46:09,946 questions about the collocation method? 900 00:46:09,946 --> 00:46:11,820 If we were actually using collocation method, 901 00:46:11,820 --> 00:46:15,010 we would use more than two points typically. 902 00:46:17,750 --> 00:46:18,515 My simple example. 903 00:46:26,265 --> 00:46:33,603 So-- so I have a code here that actually implements-- I guess 904 00:46:33,603 --> 00:46:34,907 I should plug my laptop in. 905 00:46:50,310 --> 00:46:50,810 OK. 906 00:46:50,810 --> 00:46:53,470 So the code here that's going to implement it, 907 00:46:53,470 --> 00:46:55,100 there are the two basis functions, 908 00:46:55,100 --> 00:46:57,560 c1 is 1 minus x, 1 plus x. 909 00:46:57,560 --> 00:47:02,540 c2 is x times that-- the cubic. 910 00:47:02,540 --> 00:47:08,770 And the collocation method just gets implemented here. 911 00:47:08,770 --> 00:47:12,790 It's kind of hardwired because all the derivations have been 912 00:47:12,790 --> 00:47:16,480 done-- sort of done offline. 913 00:47:16,480 --> 00:47:17,960 But let's just run this. 914 00:47:20,960 --> 00:47:24,000 Won't run that yet. 915 00:47:24,000 --> 00:47:24,540 OK. 916 00:47:24,540 --> 00:47:27,485 So one of the parts that we're looking at here-- so here 917 00:47:27,485 --> 00:47:35,742 first, of all, is a plot of the temperature versus x. 918 00:47:35,742 --> 00:47:38,040 And the solid blue is the exact line, 919 00:47:38,040 --> 00:47:40,690 that's the one that we computed analytically for this problem, 920 00:47:40,690 --> 00:47:41,800 we can do that. 921 00:47:41,800 --> 00:47:44,462 And a dashed line is what we got with collocation. 922 00:47:44,462 --> 00:47:46,420 OK, so it actually doesn't do too badly, right? 923 00:47:46,420 --> 00:47:48,990 We sort of assumed this [INAUDIBLE] of the solution 924 00:47:48,990 --> 00:47:53,012 with the solution being 100 plus a quadratic plus a cubic. 925 00:47:53,012 --> 00:47:54,970 We figured out just with two degrees of freedom 926 00:47:54,970 --> 00:47:56,680 what good choices for a1 and a2 would be. 927 00:47:56,680 --> 00:47:58,444 It's actually not too bad. 928 00:47:58,444 --> 00:48:00,610 Right? 929 00:48:00,610 --> 00:48:08,370 So there's a plot of the actual compared to the collocation's 930 00:48:08,370 --> 00:48:10,280 approximate solution. 931 00:48:10,280 --> 00:48:12,323 Here's a plot of the error. 932 00:48:12,323 --> 00:48:14,286 So that's t minus t tilde. 933 00:48:14,286 --> 00:48:15,660 We can compute again in this case 934 00:48:15,660 --> 00:48:18,320 because we happen to have the exact solution. 935 00:48:18,320 --> 00:48:25,210 You can see that error is 0 on either end. 936 00:48:25,210 --> 00:48:27,820 And you could see from the previous part 937 00:48:27,820 --> 00:48:30,460 that the exact solution-- the approximate solution 938 00:48:30,460 --> 00:48:32,420 was always under-predicting in temperature 939 00:48:32,420 --> 00:48:33,420 [INAUDIBLE] to be exact. 940 00:48:33,420 --> 00:48:36,510 So you see that with the error being negative. 941 00:48:36,510 --> 00:48:37,732 OK? 942 00:48:37,732 --> 00:48:39,440 Now for this problem we can look at these 943 00:48:39,440 --> 00:48:41,570 because we do actually know what the exact solution is. 944 00:48:41,570 --> 00:48:43,611 We're not going to be able to do that in general. 945 00:48:43,611 --> 00:48:47,240 But what we could plot is the residual. 946 00:48:47,240 --> 00:48:48,800 So again, what is this? 947 00:48:48,800 --> 00:48:51,790 This is r of t tilde comma x. 948 00:48:51,790 --> 00:48:55,660 And now we're taking the t tilde that we determined. 949 00:48:55,660 --> 00:48:56,960 We specified the form of it. 950 00:48:56,960 --> 00:48:58,932 We chose a1 and a2. 951 00:48:58,932 --> 00:49:00,390 And remember, it's a function of x. 952 00:49:00,390 --> 00:49:02,710 So here's the residual plotted out as a function of x. 953 00:49:02,710 --> 00:49:03,600 And now you should be able to see, 954 00:49:03,600 --> 00:49:06,410 this is where you can make sure you did things correctly. 955 00:49:06,410 --> 00:49:08,320 This guy should be 0 where? 956 00:49:08,320 --> 00:49:11,000 Here at minus a third, and here at plus a third. 957 00:49:11,000 --> 00:49:15,380 The two points at which we asked the residual will be 0, 958 00:49:15,380 --> 00:49:18,641 and then everywhere else it ends up being non-zero. 959 00:49:18,641 --> 00:49:19,141 Yep. 960 00:49:23,290 --> 00:49:23,790 OK. 961 00:49:23,790 --> 00:49:30,680 So that is it for collocation method. 962 00:49:30,680 --> 00:49:35,400 Any questions? 963 00:49:35,400 --> 00:49:35,900 Good? 964 00:49:35,900 --> 00:49:36,430 It's clear? 965 00:49:39,981 --> 00:49:40,480 All right. 966 00:49:40,480 --> 00:49:44,302 So now we're going to talk about the weighted residuals method-- 967 00:49:44,302 --> 00:49:46,080 the method of weighted residuals. 968 00:49:46,080 --> 00:49:48,340 And this is really the method that we 969 00:49:48,340 --> 00:49:51,830 want to focus in on because this is going to be the launching 970 00:49:51,830 --> 00:49:53,579 point for finite elements. 971 00:49:53,579 --> 00:49:55,620 But again, we were talking about collocation just 972 00:49:55,620 --> 00:49:58,200 sort of as a way for you to start thinking about what 973 00:49:58,200 --> 00:50:02,240 it means to approximate a solution with a finite number 974 00:50:02,240 --> 00:50:05,520 of basis functions, and also to think about there being 975 00:50:05,520 --> 00:50:07,394 different ways for you to actually come up 976 00:50:07,394 --> 00:50:08,310 with the coefficients. 977 00:50:08,310 --> 00:50:11,411 Yeah, [? Libby? ?] 978 00:50:11,411 --> 00:50:12,286 AUDIENCE: [INAUDIBLE] 979 00:50:25,530 --> 00:50:27,255 PROFESSOR: Maybe start with the error. 980 00:50:27,255 --> 00:50:28,963 You have to deal with the fact that error 981 00:50:28,963 --> 00:50:32,645 is 0 at the end point. 982 00:50:32,645 --> 00:50:33,520 AUDIENCE: [INAUDIBLE] 983 00:50:38,990 --> 00:50:43,508 PROFESSOR: So let's try to put them side by side. 984 00:50:43,508 --> 00:50:46,480 AUDIENCE: [INAUDIBLE] 985 00:50:46,480 --> 00:50:48,250 PROFESSOR: Yeah. 986 00:50:48,250 --> 00:50:51,660 Yeah, that's exactly right. 987 00:50:51,660 --> 00:50:58,310 So if we start with the error, shold the error-- 988 00:50:58,310 --> 00:50:59,585 it's warming up-- yeah? 989 00:50:59,585 --> 00:50:59,980 AUDIENCE: [INAUDIBLE]. 990 00:50:59,980 --> 00:51:00,826 PROFESSOR: Yeah. 991 00:51:00,826 --> 00:51:02,980 By construction the error is 0, right? 992 00:51:02,980 --> 00:51:05,180 Because we constructed the basis functions 993 00:51:05,180 --> 00:51:07,327 to be 0 at either end. 994 00:51:07,327 --> 00:51:09,820 So no matter what value we choose for a1 and a2, 995 00:51:09,820 --> 00:51:12,620 the approximate solution will be exact at the boundary 996 00:51:12,620 --> 00:51:13,360 condition. 997 00:51:13,360 --> 00:51:15,687 What about the residual? 998 00:51:15,687 --> 00:51:16,562 AUDIENCE: [INAUDIBLE] 999 00:51:20,610 --> 00:51:21,297 PROFESSOR: Yeah. 1000 00:51:21,297 --> 00:51:22,130 Say it a bit louder. 1001 00:51:22,130 --> 00:51:24,234 AUDIENCE: [INAUDIBLE] 1002 00:51:24,234 --> 00:51:24,900 PROFESSOR: Yeah. 1003 00:51:24,900 --> 00:51:27,970 So it's specifically what do you think is not what 1004 00:51:27,970 --> 00:51:29,220 it should be at the end point. 1005 00:51:29,220 --> 00:51:30,585 So I'll put this up [INAUDIBLE]. 1006 00:51:30,585 --> 00:51:31,210 So derivatives. 1007 00:51:31,210 --> 00:51:32,930 Yeah, exactly right. 1008 00:51:32,930 --> 00:51:36,609 So it basically is telling you that-- and you can 1009 00:51:36,609 --> 00:51:38,650 kind of-- you can see it physically in the shape, 1010 00:51:38,650 --> 00:51:40,233 but you can also see it mathematically 1011 00:51:40,233 --> 00:51:42,750 because it has this form. 1012 00:51:42,750 --> 00:51:44,300 When you take a derivative, as soon 1013 00:51:44,300 --> 00:51:46,125 as you move away a little bit, things 1014 00:51:46,125 --> 00:51:48,250 are going to go astray because second derivative is 1015 00:51:48,250 --> 00:51:51,695 not right. and at the endpoint, the derivatives 1016 00:51:51,695 --> 00:51:54,472 are not what they should be. 1017 00:51:54,472 --> 00:51:57,298 AUDIENCE: [INAUDIBLE] 1018 00:51:57,298 --> 00:52:02,630 PROFESSOR: Yeah, it's not-- would only-- no, come on, 1019 00:52:02,630 --> 00:52:04,330 [INAUDIBLE] turn it off. 1020 00:52:04,330 --> 00:52:06,630 We've only got two degrees of freedom, right? 1021 00:52:06,630 --> 00:52:10,350 We see the solution is a constant plus a quadratic term 1022 00:52:10,350 --> 00:52:11,280 plus the cubic term. 1023 00:52:11,280 --> 00:52:12,863 We've only got two degrees of freedom. 1024 00:52:12,863 --> 00:52:16,360 So you only get to pick two things, right, 1025 00:52:16,360 --> 00:52:17,340 to put them down. 1026 00:52:17,340 --> 00:52:19,526 And we said, let's make a residual 1027 00:52:19,526 --> 00:52:21,930 be 0 at minus a third and plus a third. 1028 00:52:21,930 --> 00:52:25,289 I guess we could have chosen to make a residual 0 at the two 1029 00:52:25,289 --> 00:52:27,380 end points. 1030 00:52:27,380 --> 00:52:29,904 I don't know what solution-- maybe Alex can quickly 1031 00:52:29,904 --> 00:52:32,320 figure out in his head what solution that would have been. 1032 00:52:32,320 --> 00:52:35,280 That would be kind of a bizarre choice, 1033 00:52:35,280 --> 00:52:39,295 but I'm not-- I'm not sure is that-- I'm just 1034 00:52:39,295 --> 00:52:43,310 wondering if that might give a 0 solution everywhere. 1035 00:52:43,310 --> 00:52:45,415 But you can't you can't kind of have everything. 1036 00:52:45,415 --> 00:52:47,040 You only got-- we only got the residual 1037 00:52:47,040 --> 00:52:48,915 at the minus one third and the plus one third collocation 1038 00:52:48,915 --> 00:52:49,415 point. 1039 00:52:52,470 --> 00:52:55,380 There seems to be a lag, a big lag, in the projector-- there 1040 00:52:55,380 --> 00:52:56,570 we go, get it off. 1041 00:52:59,440 --> 00:52:59,940 OK. 1042 00:52:59,940 --> 00:53:06,385 So any other questions about collocation? 1043 00:53:06,385 --> 00:53:07,260 AUDIENCE: [INAUDIBLE] 1044 00:53:17,189 --> 00:53:18,980 PROFESSOR: Yeah, so that's a good question. 1045 00:53:18,980 --> 00:53:20,354 If you look at the residual could 1046 00:53:20,354 --> 00:53:22,900 you tell whether you're using too low of an approximation? 1047 00:53:22,900 --> 00:53:25,400 In other words, can you tell by looking at the residual 1048 00:53:25,400 --> 00:53:28,480 how bad the error might be in the solution? 1049 00:53:28,480 --> 00:53:29,870 And the answer is, yes. 1050 00:53:29,870 --> 00:53:32,170 And there's some beautiful theory-- again, 1051 00:53:32,170 --> 00:53:33,840 it's going to depend on PDE that you're 1052 00:53:33,840 --> 00:53:37,840 talking about-- this theory that basically says that it relates 1053 00:53:37,840 --> 00:53:39,840 the norm of the residual-- how big is 1054 00:53:39,840 --> 00:53:42,860 the residual integrated over the domain-- compared 1055 00:53:42,860 --> 00:53:45,600 to how big is the error integrated over the domain. 1056 00:53:45,600 --> 00:53:48,610 And they're related by a constant, 1057 00:53:48,610 --> 00:53:53,100 which depends on the properties of the PDE you're solving. 1058 00:53:53,100 --> 00:53:55,770 And that comes back to what I was talking 1059 00:53:55,770 --> 00:53:59,280 about earlier, that for a nice PDE like this 1D diffusion, 1060 00:53:59,280 --> 00:54:01,490 it actually turns out that looking at the residual 1061 00:54:01,490 --> 00:54:03,630 is a really good way to understand what would 1062 00:54:03,630 --> 00:54:06,380 be happening with the error. 1063 00:54:06,380 --> 00:54:08,340 For nastier PDEs, that's not so much. 1064 00:54:08,340 --> 00:54:10,330 But what you're sort of asking about 1065 00:54:10,330 --> 00:54:12,600 is to a lot of the theory of the error 1066 00:54:12,600 --> 00:54:15,240 analysis in the finite element method-- 1067 00:54:15,240 --> 00:54:19,040 that people do a lot of very rigorous analysis of error 1068 00:54:19,040 --> 00:54:22,040 based on being able to compute the residual. 1069 00:54:22,040 --> 00:54:24,652 And in fact, the residuals also can then 1070 00:54:24,652 --> 00:54:26,490 start being an indicator for figuring out 1071 00:54:26,490 --> 00:54:28,364 how to do things like [INAUDIBLE] refinement, 1072 00:54:28,364 --> 00:54:30,600 and all these things are kind of related. 1073 00:54:30,600 --> 00:54:33,400 And then the theory with adjoint methods. 1074 00:54:33,400 --> 00:54:35,650 So if you're interested in that stuff you have to take 1075 00:54:35,650 --> 00:54:37,983 [? 16920 ?], which Professor [? Wong ?] will be teaching 1076 00:54:37,983 --> 00:54:40,670 in the fall, which is the grad class on numerical methods 1077 00:54:40,670 --> 00:54:41,170 of PDEs. 1078 00:54:41,170 --> 00:54:43,086 I don't know how much you get into that stuff. 1079 00:54:43,086 --> 00:54:44,309 AUDIENCE: [INAUDIBLE]. 1080 00:54:44,309 --> 00:54:45,850 PROFESSOR: Little bit more than here. 1081 00:54:45,850 --> 00:54:47,850 But you have to take that class so that then you 1082 00:54:47,850 --> 00:54:50,840 can take [? 16930 ?] which really would get you into it. 1083 00:54:50,840 --> 00:54:51,340 Right? 1084 00:54:55,340 --> 00:54:58,160 Yeah. 1085 00:54:58,160 --> 00:54:58,820 OK. 1086 00:54:58,820 --> 00:54:59,390 That's good. 1087 00:54:59,390 --> 00:55:02,710 That's great questions. 1088 00:55:02,710 --> 00:55:04,770 So now, if you guys are ready, we 1089 00:55:04,770 --> 00:55:07,030 can talk about the method of weighted residuals, which 1090 00:55:07,030 --> 00:55:10,550 hopefully won't be too much of a jump from where we are, 1091 00:55:10,550 --> 00:55:15,410 but it is a different philosophy. 1092 00:55:15,410 --> 00:55:17,370 So everything is the same up until the point 1093 00:55:17,370 --> 00:55:21,020 that we define this residual. 1094 00:55:21,020 --> 00:55:24,910 But where we're going to kind of take a fork in the road 1095 00:55:24,910 --> 00:55:29,499 is, now we're going to use a different strategy for coming 1096 00:55:29,499 --> 00:55:31,790 up with the two conditions to figure out what those two 1097 00:55:31,790 --> 00:55:33,920 degrees of freedom are. 1098 00:55:33,920 --> 00:55:34,920 OK? 1099 00:55:34,920 --> 00:55:37,530 So same idea-- approximating the solution 1100 00:55:37,530 --> 00:55:40,220 with the basis functions and [? the extension ?]. 1101 00:55:40,220 --> 00:55:41,930 But now what's different is, how do we 1102 00:55:41,930 --> 00:55:44,560 come up with the conditions to determine 1103 00:55:44,560 --> 00:55:48,130 the functions a1 and a2. 1104 00:55:48,130 --> 00:55:54,250 And-- so-- method of weighted residuals. 1105 00:56:04,721 --> 00:56:05,220 OK. 1106 00:56:05,220 --> 00:56:10,376 So in order to move forward-- in other words, 1107 00:56:10,376 --> 00:56:12,000 in order to find these two conditions, 1108 00:56:12,000 --> 00:56:13,541 we're going to define something else. 1109 00:56:13,541 --> 00:56:16,780 We're going to define what's called a weighted residual. 1110 00:56:20,791 --> 00:56:21,290 OK? 1111 00:56:21,290 --> 00:56:25,690 So we defined the residual-- it still sits over here-- 1112 00:56:25,690 --> 00:56:27,400 which is the thing that we get when 1113 00:56:27,400 --> 00:56:34,270 we substitute the approximate solution into the PDE. 1114 00:56:34,270 --> 00:56:37,170 Now I'm going to define the weighted residual, 1115 00:56:37,170 --> 00:56:41,550 and I'm going to call it-- and actually, I 1116 00:56:41,550 --> 00:56:43,400 was realizing when I was going through 1117 00:56:43,400 --> 00:56:48,081 that the notation in the notes jumped around a little bit-- 1118 00:56:48,081 --> 00:56:51,610 so let's call this capital R sub i. 1119 00:56:51,610 --> 00:56:56,107 It's going to be a function of the approximate solution t 1120 00:56:56,107 --> 00:57:01,720 tilde, but not a function of x because we're going 1121 00:57:01,720 --> 00:57:03,570 to integrate things out of x. 1122 00:57:03,570 --> 00:57:07,479 So we're going to define it as the integral over the domain. 1123 00:57:07,479 --> 00:57:09,270 And again, the domain in our simple problem 1124 00:57:09,270 --> 00:57:11,962 is just x from minus 1 to 1. 1125 00:57:11,962 --> 00:57:14,170 We're going to take a [? weighting ?] function, which 1126 00:57:14,170 --> 00:57:18,276 we'll write as wi, it's a function of x. 1127 00:57:18,276 --> 00:57:22,975 And we're going to take our residual-- you know what, 1128 00:57:22,975 --> 00:57:28,282 I'm going to give this a little r just to make sure 1129 00:57:28,282 --> 00:57:29,240 that they're different. 1130 00:57:37,940 --> 00:57:42,010 And that's going to be integrated over ex. 1131 00:57:42,010 --> 00:57:46,705 So again, little r sub i is going to be our i'th weighted 1132 00:57:46,705 --> 00:57:47,205 residual. 1133 00:57:47,205 --> 00:57:49,204 And what you're going to see is that we're going 1134 00:57:49,204 --> 00:57:52,130 to need n of these things. 1135 00:57:52,130 --> 00:57:54,060 So again, we're looking for n conditions 1136 00:57:54,060 --> 00:57:58,290 to find out n, a non-coefficient, 1137 00:57:58,290 --> 00:58:03,000 and it's defined to be the integral of a weighting 1138 00:58:03,000 --> 00:58:13,350 function, which is our wi, times this guy 1139 00:58:13,350 --> 00:58:17,750 here, which is our residual. 1140 00:58:17,750 --> 00:58:19,750 And we're integrating over the domain. 1141 00:58:19,750 --> 00:58:23,280 Here's x going from minus 1 to 1. 1142 00:58:25,920 --> 00:58:26,420 OK. 1143 00:58:26,420 --> 00:58:29,430 So residual is a function of x, weighted residual is not 1144 00:58:29,430 --> 00:58:31,815 a function of x because I've integrated over, 1145 00:58:31,815 --> 00:58:36,020 and the integration is weighted by some weighting function wi. 1146 00:58:36,020 --> 00:58:37,510 But the weight of residual is still 1147 00:58:37,510 --> 00:58:41,790 a function of our approximate solution t tilde. 1148 00:58:41,790 --> 00:58:42,500 OK. 1149 00:58:42,500 --> 00:58:47,380 So now what does the method of weighted residuals do? 1150 00:58:47,380 --> 00:58:52,440 It says let's choose n different weighting functions, w1, w2, 1151 00:58:52,440 --> 00:58:55,200 up to wn. 1152 00:58:55,200 --> 00:59:00,036 Let's define the n corresponding weighted residuals, and let's 1153 00:59:00,036 --> 00:59:02,910 set each of those weighted residuals equal to 0. 1154 00:59:02,910 --> 00:59:05,060 Each time we set a weighted residual to 0 1155 00:59:05,060 --> 00:59:07,470 we're going to get one condition, right? 1156 00:59:07,470 --> 00:59:11,020 So we'll do that n times with n different weighting functions, 1157 00:59:11,020 --> 00:59:13,000 and that will give us the n conditions 1158 00:59:13,000 --> 00:59:18,450 we need to compute our n a coefficients. 1159 00:59:18,450 --> 00:59:18,950 Yes? 1160 00:59:21,890 --> 00:59:24,631 Seems like kind of a bizarre thing to them. 1161 00:59:24,631 --> 00:59:25,130 It's OK? 1162 00:59:27,534 --> 00:59:28,450 You guys are so quiet. 1163 00:59:28,450 --> 00:59:31,590 Does that mean that you think this 1164 00:59:31,590 --> 00:59:36,240 is very easy, or kind of weird? 1165 00:59:36,240 --> 00:59:37,030 We don't know. 1166 00:59:41,850 --> 00:59:45,390 So let's write it out a little bit and see. 1167 00:59:45,390 --> 00:59:47,690 So again, the method of weighted residuals-- 1168 00:59:47,690 --> 01:00:02,544 we're going to require n weighted residuals to be 0. 1169 01:00:02,544 --> 01:00:07,070 So that means we're going to have 1170 01:00:07,070 --> 01:00:12,620 to choose n weighting function. 1171 01:00:20,140 --> 01:00:29,695 Those are the w1, w2, up to wn. 1172 01:00:29,695 --> 01:00:30,820 They're all functions of x. 1173 01:00:33,380 --> 01:00:36,110 And we're going to then get, again, 1174 01:00:36,110 --> 01:00:49,012 n equations to determine these coefficients, a1, a2, to a n. 1175 01:01:00,340 --> 01:01:01,255 OK. 1176 01:01:01,255 --> 01:01:04,220 So first thing we need to do is choose n weighting function. 1177 01:01:04,220 --> 01:01:07,460 So this is the first question, is now what do we choose 1178 01:01:07,460 --> 01:01:08,167 for the wi's? 1179 01:01:11,810 --> 01:01:14,260 What do we choose here? 1180 01:01:14,260 --> 01:01:16,500 So the answer is that there is a variety of things 1181 01:01:16,500 --> 01:01:21,280 we can choose, but there's a very special choice 1182 01:01:21,280 --> 01:01:25,230 that results in what's called a Galerkin method. 1183 01:01:28,340 --> 01:01:30,240 What does the Galerkin method say 1184 01:01:30,240 --> 01:01:31,730 to do for the weighting functions? 1185 01:01:31,730 --> 01:01:35,230 You guys read about this. 1186 01:01:35,230 --> 01:01:38,030 AUDIENCE: [INAUDIBLE]. 1187 01:01:38,030 --> 01:01:38,720 PROFESSOR: Yeah. 1188 01:01:38,720 --> 01:01:39,770 Exactly right. 1189 01:01:39,770 --> 01:01:43,710 Let the weighting function be the same basis function 1190 01:01:43,710 --> 01:01:46,444 that you're using to approximate the solution. 1191 01:01:46,444 --> 01:01:47,250 OK? 1192 01:01:47,250 --> 01:01:52,400 So the same [INAUDIBLE], that we used-- we've erased it now-- 1193 01:01:52,400 --> 01:01:54,930 but that we used in our in our expansion of t tilde-- 1194 01:01:54,930 --> 01:01:58,320 choose the same basis function to be the weighting 1195 01:01:58,320 --> 01:02:03,087 functions that you use to define your weighted residuals. 1196 01:02:03,087 --> 01:02:04,420 Turns out don't have to do that. 1197 01:02:04,420 --> 01:02:06,862 There's a bunch of other methods. 1198 01:02:06,862 --> 01:02:08,320 If [INAUDIBLE] Galerkin methods, we 1199 01:02:08,320 --> 01:02:10,100 can choose different weighting functions. 1200 01:02:10,100 --> 01:02:11,516 But we're only in this class going 1201 01:02:11,516 --> 01:02:14,350 to consider Galerkin methods where you choose the weighting 1202 01:02:14,350 --> 01:02:17,420 functions to be the same basis functions that we're using 1203 01:02:17,420 --> 01:02:19,918 to approximate the solution. 1204 01:02:19,918 --> 01:02:22,390 So the Galerkin method is a very special choice 1205 01:02:22,390 --> 01:02:32,460 that says choose wj to be equal to [? cj. ?] 1206 01:02:32,460 --> 01:02:33,860 And it turns out that this choice 1207 01:02:33,860 --> 01:02:40,360 has really good properties for some PDEs. 1208 01:02:40,360 --> 01:02:42,510 And again, if you take [? 16920 ?] with Professor 1209 01:02:42,510 --> 01:02:45,650 [? Wong ?] in the fall, you would see how this plays out 1210 01:02:45,650 --> 01:02:48,360 from an energy perspective. 1211 01:02:48,360 --> 01:02:48,860 OK. 1212 01:02:48,860 --> 01:02:50,450 So this just means the same functions 1213 01:02:50,450 --> 01:02:52,380 that you use to approximate the solution, 1214 01:02:52,380 --> 01:02:56,830 they're going to be used to weight the residuals. 1215 01:02:56,830 --> 01:02:57,330 OK. 1216 01:02:57,330 --> 01:03:00,490 So for our example, what does that mean? 1217 01:03:00,490 --> 01:03:04,540 That means-- coming back to what we were doing before-- that 1218 01:03:04,540 --> 01:03:09,090 means that the first weighting function would be our c1, which 1219 01:03:09,090 --> 01:03:12,090 was 1 minus x, 1 plus x. 1220 01:03:12,090 --> 01:03:15,410 And the second weighting function 1221 01:03:15,410 --> 01:03:17,640 would be the cubic, which is x times all of that. 1222 01:03:21,630 --> 01:03:25,380 And then the first weighted residual, 1223 01:03:25,380 --> 01:03:28,600 1, which is a function of t tilde, 1224 01:03:28,600 --> 01:03:31,530 would be the integral from minus 1 to 1 1225 01:03:31,530 --> 01:03:38,451 of w1 of x times r of t, xdx. 1226 01:03:43,070 --> 01:03:50,550 And the second weighted residual would be the second weighting 1227 01:03:50,550 --> 01:03:58,070 function multiplied by the residual integrated over x 1228 01:03:58,070 --> 01:03:59,445 from minus 1 to 1. 1229 01:04:02,930 --> 01:04:03,430 OK. 1230 01:04:03,430 --> 01:04:05,520 I don't want to work through all the math on the board. 1231 01:04:05,520 --> 01:04:08,061 But basically you can see what's going to happen here, right? 1232 01:04:08,061 --> 01:04:11,810 We're going to substitute in w1 as 1 minus x, 1 plus x. 1233 01:04:11,810 --> 01:04:13,710 We have the expression for this guy 1234 01:04:13,710 --> 01:04:19,580 that we derived before that was minus 2a1 minus 6a2x plus 50 e 1235 01:04:19,580 --> 01:04:21,250 to the x. 1236 01:04:21,250 --> 01:04:24,470 So now at that point it's just multiplying things together 1237 01:04:24,470 --> 01:04:26,209 and integrating. 1238 01:04:26,209 --> 01:04:28,250 And you could do it all by hand for this example, 1239 01:04:28,250 --> 01:04:30,875 or you could again throw it into [? Mathematica ?] or something 1240 01:04:30,875 --> 01:04:32,200 and get it out. 1241 01:04:32,200 --> 01:04:34,920 And then what are we going to do? 1242 01:04:34,920 --> 01:04:41,070 We're going to set our 1 equal to 0, 1243 01:04:41,070 --> 01:04:44,860 and we're going to set our 2 equal to 0. 1244 01:04:44,860 --> 01:04:48,620 It's going to give us two conditions, two unknowns. 1245 01:04:48,620 --> 01:04:49,600 Solve those. 1246 01:04:49,600 --> 01:04:52,970 And we're going to come out with, in this case, 1247 01:04:52,970 --> 01:05:02,760 a solution that says a1 is 27.6 and a2 is 8.9. 1248 01:05:02,760 --> 01:05:04,950 OK, so I skipped over a lot of messy math there, 1249 01:05:04,950 --> 01:05:07,070 but I don't think there's anything conceptually 1250 01:05:07,070 --> 01:05:12,560 difficult. Two conditions now coming 1251 01:05:12,560 --> 01:05:14,720 from setting a weighted residuals 1252 01:05:14,720 --> 01:05:17,950 equal to 0, where the weighted residuals correspond 1253 01:05:17,950 --> 01:05:19,680 to taking the residual, multiplying it 1254 01:05:19,680 --> 01:05:22,550 by the basis function, the Galerkin, 1255 01:05:22,550 --> 01:05:25,630 integrating over the domain. 1256 01:05:25,630 --> 01:05:28,270 Plugging through all the math, solving the equation, 1257 01:05:28,270 --> 01:05:30,980 gets us this solution which says that by the method 1258 01:05:30,980 --> 01:05:34,560 of weighted residuals for this choice of the basis 1259 01:05:34,560 --> 01:05:38,840 function-- the cubic and the quadtratic-- in a Galerkin 1260 01:05:38,840 --> 01:05:43,660 method the solution we get is-- the approximate solution is 1261 01:05:43,660 --> 01:05:50,500 100 plus 27.6 amount of our quadratic basis function, 1262 01:05:50,500 --> 01:05:55,350 plus 8.9 amount of our cubic basis function. 1263 01:05:55,350 --> 01:05:57,110 So the different solution to what 1264 01:05:57,110 --> 01:06:01,240 we got with collocation, right? 1265 01:06:01,240 --> 01:06:03,130 We got to it through a different route. 1266 01:06:06,385 --> 01:06:08,650 So I'll follow it up, and we can look at that solution 1267 01:06:08,650 --> 01:06:13,700 and we can compare it to a collocation, 1268 01:06:13,700 --> 01:06:16,760 but first, questions about method weighted residuals. 1269 01:06:16,760 --> 01:06:18,667 Does that make sense? 1270 01:06:18,667 --> 01:06:19,542 AUDIENCE: [INAUDIBLE] 1271 01:06:33,944 --> 01:06:34,610 PROFESSOR: Yeah. 1272 01:06:34,610 --> 01:06:38,070 So that's a good-- that's a good question. 1273 01:06:38,070 --> 01:06:41,425 The answer is going to be, it's going to depend on the problem. 1274 01:06:41,425 --> 01:06:47,120 So there's no general guidelines that I can give you. 1275 01:06:47,120 --> 01:06:50,490 [AUDIO OUT] you're [INAUDIBLE] exactly right is that, 1276 01:06:50,490 --> 01:06:53,230 because the-- what came out of the collocation method, 1277 01:06:53,230 --> 01:06:55,340 and we'll see it in a second-- the residual was-- 1278 01:06:55,340 --> 01:06:57,120 I forget whether it was positive or negative everywhere, 1279 01:06:57,120 --> 01:06:58,467 but it always had one sign. 1280 01:06:58,467 --> 01:07:00,966 And we're going to see that the method of weighted residuals 1281 01:07:00,966 --> 01:07:02,395 actually kind of balances out. 1282 01:07:02,395 --> 01:07:04,520 Now that's going to make sense, because what are we 1283 01:07:04,520 --> 01:07:09,210 doing when we-- when we take the residual, and we weight it, 1284 01:07:09,210 --> 01:07:10,830 and then we integrated it. 1285 01:07:10,830 --> 01:07:13,126 I think of this as kind of like-- it's kind 1286 01:07:13,126 --> 01:07:14,750 of like we're asking the residual to be 1287 01:07:14,750 --> 01:07:22,100 0 on average over the domain, but on average weighted by w1. 1288 01:07:22,100 --> 01:07:23,760 Right? 1289 01:07:23,760 --> 01:07:28,253 Because if this were gone and I just 1290 01:07:28,253 --> 01:07:29,753 integrated it and set it equal to 0, 1291 01:07:29,753 --> 01:07:30,995 it would be like saying [INAUDIBLE] the residual 1292 01:07:30,995 --> 01:07:32,426 on average 0 over the domain. 1293 01:07:32,426 --> 01:07:35,830 So it's like taking an average, but weighting it by w1. 1294 01:07:35,830 --> 01:07:38,200 So yeah, I'm going to expect this to come out 1295 01:07:38,200 --> 01:07:40,720 with something that's going to be more evenly distributed, 1296 01:07:40,720 --> 01:07:43,150 rather than with collocation where had all of one sign. 1297 01:07:43,150 --> 01:07:45,108 But there's not-- I mean you want to be careful 1298 01:07:45,108 --> 01:07:48,790 about-- I think you want to be careful because it's 1299 01:07:48,790 --> 01:07:50,574 going to depend on the problem. 1300 01:07:50,574 --> 01:07:52,990 You'll see when I [INAUDIBLE] in a second that it actually 1301 01:07:52,990 --> 01:07:58,013 turns out our residual will be 0 at a particular point x. 1302 01:07:58,013 --> 01:08:00,096 Not because we set it that way, but because that's 1303 01:08:00,096 --> 01:08:00,880 how it comes out. 1304 01:08:00,880 --> 01:08:02,040 So another [INAUDIBLE] check would 1305 01:08:02,040 --> 01:08:04,120 be to go back and plug that point in and make sure 1306 01:08:04,120 --> 01:08:06,203 that the residual-- actually worried about getting 1307 01:08:06,203 --> 01:08:07,310 the integration wrong. 1308 01:08:07,310 --> 01:08:09,340 Take that point, x, plug it in, and make sure 1309 01:08:09,340 --> 01:08:11,145 that indeed the 0 is satisfied. 1310 01:08:14,236 --> 01:08:16,620 But I said earlier we don't really 1311 01:08:16,620 --> 01:08:18,340 use the collocation method, but we 1312 01:08:18,340 --> 01:08:19,840 do use method of weighted residuals, 1313 01:08:19,840 --> 01:08:21,044 that it's going to be, because it actually 1314 01:08:21,044 --> 01:08:23,260 turns out to have really great properties. 1315 01:08:23,260 --> 01:08:27,620 It wins for this problem, and that's not really 1316 01:08:27,620 --> 01:08:28,439 a coincidence. 1317 01:08:28,439 --> 01:08:30,669 And in fact it forms the basis of what 1318 01:08:30,669 --> 01:08:32,960 we're going to do with the finite element method, which 1319 01:08:32,960 --> 01:08:33,918 is incredibly powerful. 1320 01:08:39,771 --> 01:08:40,270 OK. 1321 01:08:40,270 --> 01:08:45,013 So I am going to run the same script that I ran before. 1322 01:08:45,013 --> 01:08:48,760 But now I also have the implementation 1323 01:08:48,760 --> 01:08:51,930 of the weighted residual method. 1324 01:08:51,930 --> 01:08:59,250 So here are-- so this is basically, 1325 01:08:59,250 --> 01:09:02,540 this is the combination of all those integrals over there-- 1326 01:09:02,540 --> 01:09:05,590 amounts of the [INAUDIBLE] matrix-- this k here, 1327 01:09:05,590 --> 01:09:09,319 this matrix, and the coefficients being [INAUDIBLE] 1328 01:09:09,319 --> 01:09:10,420 times b. 1329 01:09:10,420 --> 01:09:12,175 So all the integrations amount to that. 1330 01:09:12,175 --> 01:09:15,022 And so we're going to run it and plot. 1331 01:09:15,022 --> 01:09:18,420 So let me-- clear all, close all-- 1332 01:09:26,320 --> 01:09:26,819 OK. 1333 01:09:26,819 --> 01:09:28,490 So just like we looked at before, we 1334 01:09:28,490 --> 01:09:35,649 can look at the temperature as a function of x. 1335 01:09:35,649 --> 01:09:38,490 Solid lines, just like before, is the exact solution. 1336 01:09:38,490 --> 01:09:40,990 Dash line is the method of weighted residual solutions. 1337 01:09:40,990 --> 01:09:42,260 So remember, we've got the same degrees of freedom 1338 01:09:42,260 --> 01:09:43,840 as we had for collocation, right? 1339 01:09:43,840 --> 01:09:46,090 Still any two degrees of freedom. 1340 01:09:46,090 --> 01:09:48,036 And our same basis functions. 1341 01:09:48,036 --> 01:09:49,660 The only thing we've changed is the way 1342 01:09:49,660 --> 01:09:53,680 we choose how much of each basis function to put in. 1343 01:09:53,680 --> 01:09:56,030 And you can kind of see visually-- I'll put them 1344 01:09:56,030 --> 01:09:58,010 both up together-- you can see visually it does pretty well. 1345 01:09:58,010 --> 01:09:59,910 And actually what Kevin was just observing, 1346 01:09:59,910 --> 01:10:01,255 it's not always under. 1347 01:10:01,255 --> 01:10:02,630 It actually is under a little bit 1348 01:10:02,630 --> 01:10:04,250 here, and over a little bit there, 1349 01:10:04,250 --> 01:10:06,190 and in under a little bit here. 1350 01:10:06,190 --> 01:10:11,650 It's kind of just the way it came out for this problem. 1351 01:10:11,650 --> 01:10:15,140 So there's the temperature compared to the exact solution. 1352 01:10:15,140 --> 01:10:18,844 We can look at the error as a function of x again 1353 01:10:18,844 --> 01:10:20,510 because we have the exact solution here. 1354 01:10:20,510 --> 01:10:23,159 And again we can see it's negative, then it's positive, 1355 01:10:23,159 --> 01:10:23,950 then it's negative. 1356 01:10:26,560 --> 01:10:32,149 And we can look at the residual. 1357 01:10:32,149 --> 01:10:34,440 And so now, remember with collocation, what did we see? 1358 01:10:34,440 --> 01:10:36,000 We saw with the collocation method 1359 01:10:36,000 --> 01:10:38,820 that the residual was 0 at the collocation point, 1360 01:10:38,820 --> 01:10:40,900 because those were the conditions that we 1361 01:10:40,900 --> 01:10:43,340 imposed to get the coefficient. 1362 01:10:43,340 --> 01:10:49,650 Here it turns out that the residual is 0 minus 0.4 and at 1363 01:10:49,650 --> 01:10:50,800 plus 0.5. 1364 01:10:50,800 --> 01:10:52,237 But that just kind of fell out. 1365 01:10:52,237 --> 01:10:53,820 And again, if you're looking for check 1366 01:10:53,820 --> 01:10:55,653 to make sure you did the integrations right, 1367 01:10:55,653 --> 01:10:58,880 you can always take your residual, substitute 1368 01:10:58,880 --> 01:11:02,060 in whatever these values are, and make it came out to 0. 1369 01:11:02,060 --> 01:11:03,350 But again, that just fell out. 1370 01:11:03,350 --> 01:11:06,800 What we actually ask for was that this residual, 1371 01:11:06,800 --> 01:11:11,750 when weighted by this guy and an integrator over the domain, 1372 01:11:11,750 --> 01:11:13,160 is 0. 1373 01:11:13,160 --> 01:11:16,243 And this residual, when weighted by this guy-- 1374 01:11:16,243 --> 01:11:19,350 the cubic-- an integrator of the domain-- that is 0. 1375 01:11:26,090 --> 01:11:36,820 And so then finally-- let's see-- plot the comparisons. 1376 01:11:36,820 --> 01:11:38,420 So I put them all on the same plot. 1377 01:11:41,790 --> 01:11:45,040 So there in black is the exact solution. 1378 01:11:45,040 --> 01:11:47,040 The red is the method of weighted residuals. 1379 01:11:47,040 --> 01:11:48,127 The blue is collocation. 1380 01:11:48,127 --> 01:11:49,710 Turns out method of weighted residuals 1381 01:11:49,710 --> 01:11:51,875 did better for this problem, but again we 1382 01:11:51,875 --> 01:11:56,282 want to be careful about making general assumptions. 1383 01:11:56,282 --> 01:11:58,490 They both have the same number of degrees of freedom. 1384 01:11:58,490 --> 01:12:00,698 They only differ in the choice of those coefficients. 1385 01:12:02,960 --> 01:12:04,806 Here's a plot of the difference errors. 1386 01:12:07,516 --> 01:12:09,890 And again, I would say the method of weighted individuals 1387 01:12:09,890 --> 01:12:12,460 is kind of more balanced, again, because we 1388 01:12:12,460 --> 01:12:18,440 are asking for this weighted residual to be zero. 1389 01:12:18,440 --> 01:12:20,810 And then lastly, here are the plots 1390 01:12:20,810 --> 01:12:24,974 of the residuals as a function of x. 1391 01:12:24,974 --> 01:12:26,890 And now you can see clearly what I was saying. 1392 01:12:26,890 --> 01:12:29,875 There's the collocation [INAUDIBLE] 1393 01:12:29,875 --> 01:12:31,374 to 0 at the collation point. 1394 01:12:31,374 --> 01:12:33,040 The method of weighted residuals happens 1395 01:12:33,040 --> 01:12:34,660 to be 0 at a couple of other points. 1396 01:12:38,120 --> 01:12:38,620 OK? 1397 01:12:41,150 --> 01:12:41,862 More questions. 1398 01:12:45,117 --> 01:12:46,700 I'd say it's really important that you 1399 01:12:46,700 --> 01:12:50,130 feel very comfortable with the method of weighted residuals. 1400 01:12:50,130 --> 01:12:52,050 The idea-- and let me just say it again, 1401 01:12:52,050 --> 01:12:55,560 the idea that we're going to take the PDE-- we're not going 1402 01:12:55,560 --> 01:12:57,060 to mess around with the derivatives, 1403 01:12:57,060 --> 01:12:58,435 we're going to instead say, let's 1404 01:12:58,435 --> 01:13:01,490 approximate the solution and an expansion 1405 01:13:01,490 --> 01:13:04,180 with a finite number of basis function. 1406 01:13:04,180 --> 01:13:06,600 We're going to choose the form of the basis functions-- 1407 01:13:06,600 --> 01:13:10,280 and they were even talking about polynomial basis function. 1408 01:13:10,280 --> 01:13:12,820 Now we need to figure out a way to determine 1409 01:13:12,820 --> 01:13:16,060 the coefficients-- how much of each basis function. 1410 01:13:16,060 --> 01:13:18,750 And so the way we're going to do that is choose weighting 1411 01:13:18,750 --> 01:13:20,320 functions, and with Galerkin methods 1412 01:13:20,320 --> 01:13:23,460 we'll choose those weighting functions to be the same basis 1413 01:13:23,460 --> 01:13:25,170 function that we're approximating 1414 01:13:25,170 --> 01:13:26,690 the solution with. 1415 01:13:26,690 --> 01:13:29,500 We'll weight the residual with the weighting function, 1416 01:13:29,500 --> 01:13:33,270 integrate it over the domain, define the weighted residuals, 1417 01:13:33,270 --> 01:13:35,240 set those equal to 0, and get the conditions 1418 01:13:35,240 --> 01:13:40,210 we need to find the coefficients on our expansion. 1419 01:13:40,210 --> 01:13:41,340 All those sets. 1420 01:13:41,340 --> 01:13:46,515 And what we've done today is define global basis functions, 1421 01:13:46,515 --> 01:13:47,150 right? 1422 01:13:47,150 --> 01:13:50,630 So my c1 was a quadratic that varied over the whole domain, 1423 01:13:50,630 --> 01:13:53,344 and my c2 was a cubic that varied over the whole domain. 1424 01:13:53,344 --> 01:13:55,010 Finite element method-- you're all ready 1425 01:13:55,010 --> 01:13:56,780 for it now-- is just a, I guess kind 1426 01:13:56,780 --> 01:14:00,090 of a simple, but really pretty huge 1427 01:14:00,090 --> 01:14:02,010 next step, which is to say, let's not 1428 01:14:02,010 --> 01:14:04,260 do this on the whole domain, let's divide domain up 1429 01:14:04,260 --> 01:14:06,770 into little pieces, and let's use this idea. 1430 01:14:06,770 --> 01:14:09,530 Let's define basis functions-- special basis functions 1431 01:14:09,530 --> 01:14:13,012 that are polynomials just on the little pieces. 1432 01:14:13,012 --> 01:14:14,720 And then we're going to have coefficients 1433 01:14:14,720 --> 01:14:16,220 that go with those. 1434 01:14:16,220 --> 01:14:18,345 Yeah, [? Tran? ?] 1435 01:14:18,345 --> 01:14:19,220 AUDIENCE: [INAUDIBLE] 1436 01:14:21,444 --> 01:14:22,110 PROFESSOR: Yeah. 1437 01:14:22,110 --> 01:14:23,700 So that's a good-- [INAUDIBLE] In that case, 1438 01:14:23,700 --> 01:14:25,158 the weighted residual-- we're going 1439 01:14:25,158 --> 01:14:27,450 to see all that on Wednesday. 1440 01:14:27,450 --> 01:14:31,090 So what's going to happen now is that this weighted residual 1441 01:14:31,090 --> 01:14:33,630 is actually going to have very special structure, 1442 01:14:33,630 --> 01:14:36,010 because the way we're going to define the basis functions 1443 01:14:36,010 --> 01:14:38,700 is that they're going to be local on elements-- 1444 01:14:38,700 --> 01:14:42,160 the finite elements of the finite element method. 1445 01:14:42,160 --> 01:14:43,760 And so when we do the integration, 1446 01:14:43,760 --> 01:14:45,475 a whole bunch of it's going to disappear, 1447 01:14:45,475 --> 01:14:46,850 and we're going to be integrating 1448 01:14:46,850 --> 01:14:49,067 locally just over the elements. 1449 01:14:49,067 --> 01:14:51,150 But what you're going to see is that there ends up 1450 01:14:51,150 --> 01:14:54,590 being a little bit of interaction between one element 1451 01:14:54,590 --> 01:14:56,340 and its neighbors because of the way 1452 01:14:56,340 --> 01:14:58,210 the basic functions are going to come out. 1453 01:14:58,210 --> 01:15:00,340 So we'll work through all those integrals. 1454 01:15:00,340 --> 01:15:05,300 I think you read maybe a little bit of it already. 1455 01:15:05,300 --> 01:15:07,030 How far did you guys get in the reading? 1456 01:15:07,030 --> 01:15:08,670 You saw the linear, [INAUDIBLE]? 1457 01:15:11,410 --> 01:15:12,484 Yeah. 1458 01:15:12,484 --> 01:15:14,400 Yeah, we're going to work through all of that. 1459 01:15:14,400 --> 01:15:15,880 And you'll see that's what's incredibly 1460 01:15:15,880 --> 01:15:17,546 powerful with the finite element method, 1461 01:15:17,546 --> 01:15:20,170 is this idea of using a polynomial basis 1462 01:15:20,170 --> 01:15:22,580 and a local element, we're going to get these integrals 1463 01:15:22,580 --> 01:15:25,320 with so much structure that we can 1464 01:15:25,320 --> 01:15:28,040 handle-- it's going to sort of all work out 1465 01:15:28,040 --> 01:15:29,426 in a really neat way. 1466 01:15:29,426 --> 01:15:30,301 AUDIENCE: [INAUDIBLE] 1467 01:15:33,407 --> 01:15:34,740 PROFESSOR: That's exactly right. 1468 01:15:34,740 --> 01:15:36,490 We're still integrating a weighted residual 1469 01:15:36,490 --> 01:15:37,420 over the whole domain, but a whole lot of it's 1470 01:15:37,420 --> 01:15:39,840 going to go away, and it's going to turn out 1471 01:15:39,840 --> 01:15:42,774 that we get sort of these special patterns that show up 1472 01:15:42,774 --> 01:15:44,690 because of the way which is a basis functions. 1473 01:15:44,690 --> 01:15:46,645 And you'll see all of that. 1474 01:15:46,645 --> 01:15:47,520 We'll do all of that. 1475 01:15:47,520 --> 01:15:49,417 I think on Wednesday we'll sort of work 1476 01:15:49,417 --> 01:15:51,500 through all the steps of the finite element method 1477 01:15:51,500 --> 01:15:53,583 and have you go along and do it, so actually bring 1478 01:15:53,583 --> 01:15:57,710 your laptops if you can so you can do some stuff on Matlab. 1479 01:15:57,710 --> 01:15:58,700 OK. 1480 01:15:58,700 --> 01:15:59,200 Yeah, Ben? 1481 01:16:01,755 --> 01:16:02,630 AUDIENCE: [INAUDIBLE] 1482 01:16:09,109 --> 01:16:10,942 PROFESSOR: You know, that's a good question. 1483 01:16:10,942 --> 01:16:11,817 AUDIENCE: [INAUDIBLE] 1484 01:16:14,094 --> 01:16:15,510 PROFESSOR: That's a good question. 1485 01:16:15,510 --> 01:16:18,220 The question is, is the fact that the method 1486 01:16:18,220 --> 01:16:20,960 of weighted residuals, the resulting residual 1487 01:16:20,960 --> 01:16:24,740 crosses 0 in time, is that a coincidence, 1488 01:16:24,740 --> 01:16:26,560 or is it always going to happen? 1489 01:16:26,560 --> 01:16:28,920 I think that's a very interesting question, 1490 01:16:28,920 --> 01:16:32,347 and I'm actually not sure, because I was wondering 1491 01:16:32,347 --> 01:16:33,930 actually, is there a way to figure out 1492 01:16:33,930 --> 01:16:35,670 where we could have put the collocation 1493 01:16:35,670 --> 01:16:38,030 points for this problem. 1494 01:16:38,030 --> 01:16:39,780 We could have put the collocation points 1495 01:16:39,780 --> 01:16:41,917 in a particular point and gotten the same answer 1496 01:16:41,917 --> 01:16:44,000 that we got with the method of weighted residuals. 1497 01:16:44,000 --> 01:16:45,780 And it's going to have something to do with the 50e 1498 01:16:45,780 --> 01:16:47,749 to the x that's in the [INAUDIBLE] function. 1499 01:16:47,749 --> 01:16:49,540 I just think the fact that it crosses twice 1500 01:16:49,540 --> 01:16:51,820 is not a coincidence. 1501 01:16:51,820 --> 01:16:55,705 I think it probably has to cross twice, but I don't-- 1502 01:16:55,705 --> 01:16:56,580 AUDIENCE: [INAUDIBLE] 1503 01:17:05,394 --> 01:17:06,810 PROFESSOR: You feel like it's kind 1504 01:17:06,810 --> 01:17:08,404 of like a fundamental theorem? 1505 01:17:08,404 --> 01:17:10,562 AUDIENCE: [INAUDIBLE] 1506 01:17:10,562 --> 01:17:12,770 PROFESSOR: Maybe it's a great question for the final. 1507 01:17:15,160 --> 01:17:16,660 Really good final questions are when 1508 01:17:16,660 --> 01:17:18,951 the professors don't know the answer What do you think, 1509 01:17:18,951 --> 01:17:19,660 [? Xixi.? ?] 1510 01:17:19,660 --> 01:17:20,535 AUDIENCE: [INAUDIBLE] 1511 01:17:31,874 --> 01:17:32,540 PROFESSOR: Yeah. 1512 01:17:32,540 --> 01:17:34,956 Well the thing is, we have an expression for the residual, 1513 01:17:34,956 --> 01:17:37,564 which we wrote out, which was-- what's 1514 01:17:37,564 --> 01:17:38,980 the expression for our residuall-- 1515 01:17:38,980 --> 01:17:42,870 it's minus 2a1 minus 6a2x plus 50e to the x. 1516 01:17:42,870 --> 01:17:44,920 So I guess you can figure out how many crossings 1517 01:17:44,920 --> 01:17:48,509 are possible because of the degrees of freedom 1518 01:17:48,509 --> 01:17:49,050 that we have. 1519 01:17:52,551 --> 01:17:54,425 It actually turns out that even though things 1520 01:17:54,425 --> 01:17:56,810 seem like coincidences, there are almost no coincidences. 1521 01:17:56,810 --> 01:17:58,340 In these kinds of problems, it's usually 1522 01:17:58,340 --> 01:18:00,214 that there's so much structure in the problem 1523 01:18:00,214 --> 01:18:05,840 that you could have-- but-- yeah. 1524 01:18:05,840 --> 01:18:06,340 OK. 1525 01:18:06,340 --> 01:18:08,840 If you have-- if there are parts of the method of weighted 1526 01:18:08,840 --> 01:18:11,048 residuals that are a little bi uncomfortable for you, 1527 01:18:11,048 --> 01:18:13,540 I would strongly suggest you talk to me, or to Alex, 1528 01:18:13,540 --> 01:18:15,840 [? Xixi, ?] or to [? Bikram ?], before Wednesday, 1529 01:18:15,840 --> 01:18:17,820 because otherwise things are going to get dramatically worse 1530 01:18:17,820 --> 01:18:18,695 for you on Wednesday. 1531 01:18:18,695 --> 01:18:21,000 Make sure that this-- really-- make sure-- that's 1532 01:18:21,000 --> 01:18:22,450 why I went kind of slowly through this lecture, 1533 01:18:22,450 --> 01:18:25,033 is because it's really important that you have all these steps 1534 01:18:25,033 --> 01:18:26,196 kind of clear in your mind. 1535 01:18:26,196 --> 01:18:28,320 And please if you have a chance to even just listen 1536 01:18:28,320 --> 01:18:30,569 to a few minutes, especially those of you who said you 1537 01:18:30,569 --> 01:18:33,270 like the audio recording-- if the combination of what's 1538 01:18:33,270 --> 01:18:35,270 on the screen and me talking is good enough then 1539 01:18:35,270 --> 01:18:37,895 I can keep using the blackboard, but if not please let me know.