1 00:00:00,000 --> 00:00:01,960 The following content is provided 2 00:00:01,960 --> 00:00:06,100 by MIT OpenCourseWare under a Creative Commons license. 3 00:00:06,100 --> 00:00:08,230 Additional information about our license 4 00:00:08,230 --> 00:00:10,490 and MIT OpenCourseWare in general 5 00:00:10,490 --> 00:00:11,930 is available at ocw.mit.edu. 6 00:00:15,260 --> 00:00:17,840 PROFESSOR: So I hope, in time, for you 7 00:00:17,840 --> 00:00:24,360 to consider this material also in thinking 8 00:00:24,360 --> 00:00:27,290 about projects because there are lots of experiments 9 00:00:27,290 --> 00:00:28,490 to do with these. 10 00:00:28,490 --> 00:00:33,110 I did a MATLAB experiment that I'll mention. 11 00:00:33,110 --> 00:00:36,080 And I guess it was too small because it 12 00:00:36,080 --> 00:00:40,560 didn't make multigrid look as good as it is. 13 00:00:40,560 --> 00:00:45,220 So can I remember the steps of multigrid and then 14 00:00:45,220 --> 00:00:48,610 you'll remember why we take those steps 15 00:00:48,610 --> 00:00:56,280 and then make a sort of basic analysis of how 16 00:00:56,280 --> 00:01:04,580 do you decide whether this multiple step process is 17 00:01:04,580 --> 00:01:05,320 successful? 18 00:01:05,320 --> 00:01:07,640 How much does it reduce the error? 19 00:01:07,640 --> 00:01:11,710 So you remember the steps. 20 00:01:11,710 --> 00:01:13,490 Oh, thanks. 21 00:01:13,490 --> 00:01:19,760 So the first step is really a little bit outside multigrid. 22 00:01:19,760 --> 00:01:26,080 It uses an ordinary iteration, like Jacobi, a few times 23 00:01:26,080 --> 00:01:32,140 and-- so you remember that the matrix that 24 00:01:32,140 --> 00:01:39,540 governs this ordinary step, the matrix that's crucial for this 25 00:01:39,540 --> 00:01:47,810 is the-- so what multiplies the error at every step. 26 00:01:47,810 --> 00:01:52,220 So we have initial error and if we take a smoothing 27 00:01:52,220 --> 00:02:01,610 step with a preconditioner P, then the error 28 00:02:01,610 --> 00:02:05,850 is multiplied by I minus being P inverse A. 29 00:02:05,850 --> 00:02:08,110 So that's the matrix. 30 00:02:08,110 --> 00:02:13,680 That's sort of the one-step, one iteration matrix for ordinary 31 00:02:13,680 --> 00:02:17,250 iteration where A is our-- of course, 32 00:02:17,250 --> 00:02:19,630 we're solving A*u equal b. 33 00:02:19,630 --> 00:02:21,330 That's our problem. 34 00:02:21,330 --> 00:02:26,480 The matrix P is close to A. Of course if we took P equal to A 35 00:02:26,480 --> 00:02:29,410 then the error would be reduced to zero 36 00:02:29,410 --> 00:02:34,340 right away because we would be solving the system one shot. 37 00:02:34,340 --> 00:02:40,950 But now, we're left with some error and this-- steps 38 00:02:40,950 --> 00:02:44,320 2, 3, 4 reduce it further. 39 00:02:44,320 --> 00:02:50,590 And well, our hope is to see that this multigrid operation 40 00:02:50,590 --> 00:02:55,120 reduces the low-frequency part because this one will 41 00:02:55,120 --> 00:02:59,310 act successfully on the high-frequency part, 42 00:02:59,310 --> 00:03:06,400 the oscillating error, but for smooth error 43 00:03:06,400 --> 00:03:11,310 the eigenvalues here are too close to 1 and it's too slow. 44 00:03:11,310 --> 00:03:14,000 OK, so I was just going to track down-- 45 00:03:14,000 --> 00:03:17,810 well, first have to remember, what are the pieces here? 46 00:03:17,810 --> 00:03:20,990 So there's a matrix R, restriction matrix. 47 00:03:20,990 --> 00:03:27,260 A matrix A_(2h), which is original matrix A, 48 00:03:27,260 --> 00:03:29,570 or A_h I could call that. 49 00:03:29,570 --> 00:03:33,800 But the original one is on the fine mesh. 50 00:03:33,800 --> 00:03:37,340 So I need a coarse mesh version. 51 00:03:40,640 --> 00:03:44,710 So that's what I solve on the coarse mesh, the smaller 52 00:03:44,710 --> 00:03:48,820 problem, and then interpolate back with a matrix 53 00:03:48,820 --> 00:03:50,880 I back to the fine mesh. 54 00:03:50,880 --> 00:03:53,180 OK, so can I just remember, also, 55 00:03:53,180 --> 00:04:00,080 what those matrices-- we have all the pieces here. 56 00:04:00,080 --> 00:04:05,660 So if I remember what R and I are-- OK, 57 00:04:05,660 --> 00:04:08,760 so let me write down all those pieces. 58 00:04:08,760 --> 00:04:14,510 So A-- let me tell you the MATLAB experiment I ran. 59 00:04:14,510 --> 00:04:20,950 So A is our 2's and minus 1's matrix, 60 00:04:20,950 --> 00:04:26,050 out second difference matrix, in 1D to keep it simple. 61 00:04:28,730 --> 00:04:32,760 And it should be divided by h squared. 62 00:04:40,150 --> 00:04:46,470 Well, I guess we took the mesh with-- where the coarse mesh 63 00:04:46,470 --> 00:04:48,780 just had two interior points. 64 00:04:48,780 --> 00:04:52,350 The value at the boundaries was zero 65 00:04:52,350 --> 00:04:55,970 and the fine mesh has 5 interior-- 66 00:04:55,970 --> 00:04:57,360 so this will be 5 by 5. 67 00:05:02,000 --> 00:05:07,920 Then we needed the restriction and interpolation matrices. 68 00:05:07,920 --> 00:05:10,680 So this was R, the restriction. 69 00:05:10,680 --> 00:05:14,120 So the restriction, which we're going to use right away, 70 00:05:14,120 --> 00:05:18,670 will take us from the fine to the coarse. 71 00:05:18,670 --> 00:05:25,060 So that matrix will be-- it'll multiply things 72 00:05:25,060 --> 00:05:28,380 with 5 components and produce an output 73 00:05:28,380 --> 00:05:31,010 with only 2 components, [INAUDIBLE] 74 00:05:31,010 --> 00:05:32,070 near those mesh points. 75 00:05:32,070 --> 00:05:36,560 And the numbers were 1, 2, 1, 0, 0, and 0, 0, 1, 2, 76 00:05:36,560 --> 00:05:40,370 1, and needed to divide by a fourth 77 00:05:40,370 --> 00:05:44,160 because those rows added up to 4. 78 00:05:44,160 --> 00:05:48,320 The idea being that if we restricted all ones 79 00:05:48,320 --> 00:05:53,540 we should get all ones and we need that 1/4 factor to do it. 80 00:05:53,540 --> 00:05:57,110 And the interpolation went the other way 81 00:05:57,110 --> 00:06:00,650 and it was essentially the transpose. 82 00:06:00,650 --> 00:06:09,100 That's the nice connection to have 83 00:06:09,100 --> 00:06:12,630 and again, we need a factor-- and maybe the factor 84 00:06:12,630 --> 00:06:15,910 is 1/2 there. 85 00:06:15,910 --> 00:06:18,420 Good. 86 00:06:18,420 --> 00:06:22,170 We've now got all the pieces except A_(2h) and I think just 87 00:06:22,170 --> 00:06:27,690 at the very last minute last time I said what A_(2h) should 88 00:06:27,690 --> 00:06:29,940 be. 89 00:06:29,940 --> 00:06:35,000 And the good choice for A_(2h) is-- 90 00:06:35,000 --> 00:06:37,860 so that's on the coarse mesh. 91 00:06:37,860 --> 00:06:40,020 So that's going to be small matrix. 92 00:06:40,020 --> 00:06:46,970 So the good choice is I, which puts it up 93 00:06:46,970 --> 00:06:53,270 on the fine mesh, A_h, which is our operator on the fine mesh, 94 00:06:53,270 --> 00:06:56,460 and then R that restricts back. 95 00:06:56,460 --> 00:07:04,040 So R*A*I is the right construction for-- it's sort 96 00:07:04,040 --> 00:07:11,480 of the natural construction for the coarse mesh operator. 97 00:07:11,480 --> 00:07:16,800 And notice, I don't know if you appreciate having this, 98 00:07:16,800 --> 00:07:23,290 this is the same as R A R transposed with some factor 99 00:07:23,290 --> 00:07:27,070 so that it'll come out symmetric, 100 00:07:27,070 --> 00:07:28,900 it'll come out positive definite, 101 00:07:28,900 --> 00:07:32,390 and actually, it'll come out-- in this example, 102 00:07:32,390 --> 00:07:35,770 it will come out exactly the second difference 103 00:07:35,770 --> 00:07:38,930 operator on the coarse mesh. 104 00:07:38,930 --> 00:07:44,960 So this will turn out to be 2, minus 1; minus 1, 2, the 2 105 00:07:44,960 --> 00:07:46,300 by 2 operator. 106 00:07:46,300 --> 00:07:52,830 And since we're on the coarse mesh the step size is 2. 107 00:07:52,830 --> 00:08:01,270 I won't do that multiplication, but MATLAB confirmed it. 108 00:08:01,270 --> 00:08:03,930 So that's where we were. 109 00:08:03,930 --> 00:08:11,380 So I've sort of done now a recap of multigrid 110 00:08:11,380 --> 00:08:16,000 and I'm ready to tackle a little understanding now 111 00:08:16,000 --> 00:08:19,360 of what happens to the error. 112 00:08:19,360 --> 00:08:22,420 So at this stage I end up with some error. 113 00:08:26,710 --> 00:08:28,730 u_h is not the exact answer. 114 00:08:28,730 --> 00:08:33,670 I have an error e_h, which is u minus u_h. 115 00:08:33,670 --> 00:08:37,720 That's the error at the end. 116 00:08:41,030 --> 00:08:44,760 Now the question is, what happens to that error? 117 00:08:44,760 --> 00:08:51,730 Can we see how and why it's reduced as we do a v-cycle, 118 00:08:51,730 --> 00:08:54,480 as we do a 2, 3, 4 cycle? 119 00:08:54,480 --> 00:08:58,920 So since everything's linear, that error 120 00:08:58,920 --> 00:09:01,370 is multiplied by some matrix and we just 121 00:09:01,370 --> 00:09:05,930 have to track those steps, see what that matrix is, 122 00:09:05,930 --> 00:09:07,600 and look at its eigenvalues. 123 00:09:07,600 --> 00:09:14,550 So that's my goal here, is to find the matrix, call it S, 124 00:09:14,550 --> 00:09:21,020 that takes a step, a multigrid step, and what 125 00:09:21,020 --> 00:09:22,610 does it do to the error? 126 00:09:22,610 --> 00:09:28,160 OK, so can I just follow that step? 127 00:09:28,160 --> 00:09:29,430 Here's the key matrix. 128 00:09:29,430 --> 00:09:31,060 Maybe I'll write it underneath. 129 00:09:36,150 --> 00:09:39,610 So what happens to the error? 130 00:09:39,610 --> 00:09:44,670 First of all, let me write the steps down. e_h, 131 00:09:44,670 --> 00:09:48,240 then, is u minus u_h. 132 00:09:48,240 --> 00:09:52,180 That's-- entering multigrid, that's my error. 133 00:09:52,180 --> 00:09:57,090 OK, now I compute this residual, r_h. 134 00:10:01,230 --> 00:10:06,490 I want to say that it's A*e_h. 135 00:10:06,490 --> 00:10:09,510 Can I check that that's true? 136 00:10:09,510 --> 00:10:10,400 Yes. 137 00:10:10,400 --> 00:10:17,890 A times this is A times u-- that's the b-- minus A_h 138 00:10:17,890 --> 00:10:21,330 times u_h-- that's the second term. 139 00:10:21,330 --> 00:10:22,070 So that's OK. 140 00:10:22,070 --> 00:10:24,420 So that's what happened there. 141 00:10:24,420 --> 00:10:28,150 Then it got restricted. 142 00:10:28,150 --> 00:10:31,580 I'll keep a record of what happens to e_h. 143 00:10:31,580 --> 00:10:35,890 So it's multiplied by A to get the residual. 144 00:10:39,910 --> 00:10:42,050 We work with the residual and with b 145 00:10:42,050 --> 00:10:45,110 because b is the input we know. 146 00:10:45,110 --> 00:10:53,880 Then at this step two, that residual is restricted by R. 147 00:10:53,880 --> 00:10:58,490 Now we've got r_(2h). 148 00:10:58,490 --> 00:11:02,020 When I multiplied by R I got r_(2h). 149 00:11:02,020 --> 00:11:04,660 OK, next step. 150 00:11:04,660 --> 00:11:06,490 To get to E_(2h). 151 00:11:06,490 --> 00:11:08,020 So what do I do there? 152 00:11:08,020 --> 00:11:10,330 I multiply by the inverse. 153 00:11:10,330 --> 00:11:13,390 I solve this system, so of course, I don't actually 154 00:11:13,390 --> 00:11:18,880 find an inverse matrix, but that's the formula. 155 00:11:18,880 --> 00:11:23,150 To get this, I multiply the inverse matrix by that, 156 00:11:23,150 --> 00:11:25,320 so I've got an inverse matrix here. 157 00:11:25,320 --> 00:11:28,460 So I write it as A_(2h) inverse. 158 00:11:28,460 --> 00:11:31,850 This was A_h. 159 00:11:31,850 --> 00:11:37,200 Now when I've multiplied by A_(2h) inverse, I'm this far, 160 00:11:37,200 --> 00:11:44,540 and the final step multiplies that by I. So there you go. 161 00:11:47,180 --> 00:11:53,090 It looks pretty awkward, but that's 162 00:11:53,090 --> 00:11:55,650 the matrix S that produces E_h. 163 00:11:59,550 --> 00:12:02,790 So I'm thinking that my matrix is 164 00:12:02,790 --> 00:12:05,510 going to be called S. This matrix here 165 00:12:05,510 --> 00:12:10,640 is going to be called S. So let me write down what S is. 166 00:12:13,720 --> 00:12:18,790 All I want to do is remind us what A_(2h) is by this choice 167 00:12:18,790 --> 00:12:29,250 there, it's R*A*I. And then comes R and then comes A. 168 00:12:29,250 --> 00:12:30,300 A is now A_h. 169 00:12:35,000 --> 00:12:40,720 Well, we've got a matrix. 170 00:12:40,720 --> 00:12:46,900 And for this example, I can compute what it is. 171 00:12:46,900 --> 00:12:54,530 Can we say anything about that matrix from its formula? 172 00:12:54,530 --> 00:12:57,280 Looks a little messy. 173 00:12:57,280 --> 00:13:00,620 But of course, it's built out of these pieces. 174 00:13:00,620 --> 00:13:07,150 It's built out of the given matrix A and our R and our I. 175 00:13:07,150 --> 00:13:12,080 And there is a neat property hiding there. 176 00:13:12,080 --> 00:13:15,670 Which you can see if you square that matrix. 177 00:13:15,670 --> 00:13:18,320 So look at S squared. 178 00:13:18,320 --> 00:13:21,780 If we look at S squared-- so this is the matrix 179 00:13:21,780 --> 00:13:24,800 to understand now. 180 00:13:24,800 --> 00:13:28,030 And I don't claim to understand it as well as I would like, 181 00:13:28,030 --> 00:13:33,300 but-- so this is the matrix for these three steps. 182 00:13:33,300 --> 00:13:38,690 We would have a full multigrid v-cycle-- 183 00:13:38,690 --> 00:13:41,670 just before I lose the track on that. 184 00:13:41,670 --> 00:13:50,350 A full multigrid v-cycle would do M a few times, say twice. 185 00:13:50,350 --> 00:13:53,940 Two smoothers, then it would do a v-cycle 186 00:13:53,940 --> 00:13:56,830 and then smooth again. 187 00:13:56,830 --> 00:13:58,720 Well, I should've said the smooth again 188 00:13:58,720 --> 00:14:01,200 would be the one on the left. 189 00:14:01,200 --> 00:14:04,520 This is the original, so there's two smoothers 190 00:14:04,520 --> 00:14:06,330 followed by a multigrid cycle, followed 191 00:14:06,330 --> 00:14:08,610 by a couple of smoothers. 192 00:14:08,610 --> 00:14:12,840 That would be our total overall matrix, 193 00:14:12,840 --> 00:14:17,060 but I want to focus, for right now, on this matrix S. 194 00:14:17,060 --> 00:14:21,940 And I guess, I hope that anybody who 195 00:14:21,940 --> 00:14:27,560 does a project or a homework on this topic, 196 00:14:27,560 --> 00:14:32,920 you're going to create I, R, and A and compute S. 197 00:14:32,920 --> 00:14:36,480 And it should show what S squared is. 198 00:14:36,480 --> 00:14:39,250 So could I compute, could I look at S squared? 199 00:14:39,250 --> 00:14:41,690 You'll see why. 200 00:14:41,690 --> 00:14:45,050 So I just write S down twice. 201 00:14:45,050 --> 00:14:49,470 R*A*I inverse R*A, so that's once. 202 00:14:49,470 --> 00:14:51,060 Now repeat the whole thing. 203 00:14:51,060 --> 00:15:06,550 I, R*A*I inverse R*A. I have multiplied S by itself. 204 00:15:06,550 --> 00:15:07,950 And what do you see? 205 00:15:11,170 --> 00:15:13,960 Well it's nice. 206 00:15:13,960 --> 00:15:18,620 If you look at this you see that we've got this combination 207 00:15:18,620 --> 00:15:22,520 R*A*I sitting in the middle because when I did it twice, 208 00:15:22,520 --> 00:15:27,090 the RA came from there and then an I was at the start, 209 00:15:27,090 --> 00:15:33,700 so this is-- so what's left? 210 00:15:33,700 --> 00:15:44,140 S. This matrix S is equal to its own square. 211 00:15:44,140 --> 00:15:49,340 S squared equals S. You know, we're 212 00:15:49,340 --> 00:15:54,470 able to see this without-- this would apply for this example, 213 00:15:54,470 --> 00:15:58,020 but for all examples. 214 00:15:58,020 --> 00:16:02,580 Now I'm ready to think about eigenvalues a little bit. 215 00:16:02,580 --> 00:16:06,110 What does that tell me about the eigenvalues of S? 216 00:16:06,110 --> 00:16:10,440 So this is a small class of matrices with this property 217 00:16:10,440 --> 00:16:17,560 that S squared equals S. And maybe I 218 00:16:17,560 --> 00:16:19,980 say something about those here. 219 00:16:19,980 --> 00:16:24,290 So if S squared equals S, what does that 220 00:16:24,290 --> 00:16:29,180 tell us about eigenvalues of that matrix? 221 00:16:29,180 --> 00:16:32,650 It's a square matrix. 222 00:16:32,650 --> 00:16:34,340 It doesn't happen to be symmetric. 223 00:16:34,340 --> 00:16:39,090 Very often we're looking at symmetric matrices, 224 00:16:39,090 --> 00:16:40,810 but this is a little lopsided. 225 00:16:40,810 --> 00:16:43,760 We have an A off on the right. 226 00:16:43,760 --> 00:16:47,100 I might be able to make it symmetric by bringing 227 00:16:47,100 --> 00:16:51,650 part of that A off to the left, but this is the main point. 228 00:16:51,650 --> 00:16:55,160 What are the possible eigenvalues of that matrix, S? 229 00:16:58,780 --> 00:17:03,220 Well, 0 and 1. 230 00:17:03,220 --> 00:17:06,720 The only eigenvalues are 0 and 1. 231 00:17:06,720 --> 00:17:07,880 Why is that? 232 00:17:07,880 --> 00:17:18,370 Because if S*e equals lambda*e-- so I'll put that word if in. 233 00:17:18,370 --> 00:17:24,160 If S*e equals lambda*e, I could multiply by S again so I would 234 00:17:24,160 --> 00:17:34,930 get S squared e equals lambda*S*e, 235 00:17:34,930 --> 00:17:39,310 and that's lambda squared e. 236 00:17:39,310 --> 00:17:41,250 I haven't done anything fancy here, 237 00:17:41,250 --> 00:17:45,630 all I'm saying is that any matrix, if it 238 00:17:45,630 --> 00:17:49,960 has an eigenvalue of lambda and an eigenvector e, 239 00:17:49,960 --> 00:17:56,100 then S squared has that same eigenvector and its eigenvalue 240 00:17:56,100 --> 00:17:57,200 is lambda squared. 241 00:17:57,200 --> 00:18:04,180 But now, S squared is S. So this is the same as S*e, 242 00:18:04,180 --> 00:18:05,070 which is lambda*e. 243 00:18:07,650 --> 00:18:11,160 You see that I now have lambda equal lambda squared. 244 00:18:11,160 --> 00:18:17,240 Sorry, I probably made that take more time that it had to. 245 00:18:17,240 --> 00:18:21,400 If S squared equals S then lambda squared equals lambda. 246 00:18:21,400 --> 00:18:23,420 So I have lambda squared equal lambda 247 00:18:23,420 --> 00:18:26,520 and the only two possibilities-- that's a quadratic equation 248 00:18:26,520 --> 00:18:29,680 that's got two roots and those are the roots. 249 00:18:29,680 --> 00:18:33,440 If lambda squared equals lambda then lambda could be 0 250 00:18:33,440 --> 00:18:35,170 or it could be 1. 251 00:18:35,170 --> 00:18:38,570 So what does that tell me? 252 00:18:38,570 --> 00:18:44,850 That tells me that the eigenvectors that have 253 00:18:44,850 --> 00:18:49,820 eigenvalue 0, what happens to those in multigrid? 254 00:18:52,340 --> 00:18:54,230 They're killed. 255 00:18:54,230 --> 00:18:58,530 An eigenvector with an eigenvalue of 0 means that S*e 256 00:18:58,530 --> 00:18:59,950 is 0. 257 00:18:59,950 --> 00:19:02,740 So whatever error we started with one cycle 258 00:19:02,740 --> 00:19:05,550 through multigrid will remove it. 259 00:19:10,190 --> 00:19:14,640 These are in the null space of S. 260 00:19:14,640 --> 00:19:17,970 They're vectors that S completely removes. 261 00:19:17,970 --> 00:19:22,430 And these are vectors where S*e equals e. 262 00:19:22,430 --> 00:19:25,320 The eigenvalue is 1 and multigrid does nothing. 263 00:19:30,040 --> 00:19:31,730 Well, one part of the message then 264 00:19:31,730 --> 00:19:36,066 is that I could use multigrid-- well, 265 00:19:36,066 --> 00:19:37,565 I guess I hadn't thought about this, 266 00:19:37,565 --> 00:19:43,740 but one message is: don't repeat 2, 3, 4. 267 00:19:43,740 --> 00:19:45,980 That would be a large waste of time. 268 00:19:45,980 --> 00:19:49,780 If you just repeated-- if you just did another v-cycle 269 00:19:49,780 --> 00:19:52,730 and didn't do any smoothing or anything in between, 270 00:19:52,730 --> 00:19:58,260 then the error that came out of the first v-cycle 271 00:19:58,260 --> 00:20:00,080 would survive right through. 272 00:20:00,080 --> 00:20:03,670 Nothing good would happen in the second cycle that didn't 273 00:20:03,670 --> 00:20:05,230 already happened in the first. 274 00:20:05,230 --> 00:20:10,420 Now-- and another message is, of course, I 275 00:20:10,420 --> 00:20:12,240 could do multigrid forever and I'm not 276 00:20:12,240 --> 00:20:14,710 going to get convergence. 277 00:20:14,710 --> 00:20:16,830 Actually, that's sort of interesting 278 00:20:16,830 --> 00:20:21,830 because we're totally accustomed to working 279 00:20:21,830 --> 00:20:34,080 with matrices M whose eigenvalues 280 00:20:34,080 --> 00:20:39,060 are spread out, but below 1. 281 00:20:39,060 --> 00:20:42,970 This has its eigenvalues not spread out at all, 0 or 1. 282 00:20:42,970 --> 00:20:45,520 That's it. 283 00:20:45,520 --> 00:20:52,590 I'd better say quickly that the key matrix here is I minus S. 284 00:20:52,590 --> 00:20:54,890 Just the way that it was I minus P inverse A. 285 00:20:54,890 --> 00:20:59,730 So the multigrid matrix-- yeah, maybe I could've messed up. 286 00:21:03,090 --> 00:21:13,010 The matrix is really I minus S, so let me be sure 287 00:21:13,010 --> 00:21:15,450 I see where that happens. 288 00:21:15,450 --> 00:21:19,830 I guess I got down here to figure out what E_h is 289 00:21:19,830 --> 00:21:22,550 and then I didn't do anything with it. 290 00:21:22,550 --> 00:21:27,800 I forgot to write in the key step that at the end of step 4 291 00:21:27,800 --> 00:21:36,860 when I have the piece of the error, then I add that to u_h. 292 00:21:36,860 --> 00:21:47,010 So add u_h plus this estimated error. 293 00:21:47,010 --> 00:21:52,450 See, if I knew e_h, if I knew small e_h-- the exact error-- 294 00:21:52,450 --> 00:21:55,210 then when I added I would get u, the answer. 295 00:21:55,210 --> 00:21:57,030 Of course, I don't know that. 296 00:21:57,030 --> 00:22:00,710 What I know is capital E. So that's 297 00:22:00,710 --> 00:22:10,300 a cap E, which will agree with e on some of these, 298 00:22:10,300 --> 00:22:11,200 but not others. 299 00:22:11,200 --> 00:22:15,800 So all right, I guess I'm seeing the problem. 300 00:22:15,800 --> 00:22:18,680 I may have headed in reverse because it's 301 00:22:18,680 --> 00:22:21,260 I minus S that's crucial. 302 00:22:21,260 --> 00:22:22,640 So these are errors. 303 00:22:22,640 --> 00:22:24,810 Now what happens to them? 304 00:22:24,810 --> 00:22:26,030 Are these the good ones? 305 00:22:28,980 --> 00:22:32,030 I think they're the good ones, is that right? 306 00:22:32,030 --> 00:22:39,770 They're the good ones because the errors, in this stage, 307 00:22:39,770 --> 00:22:43,770 multigrid gets them exactly, so that when I add this in it's 308 00:22:43,770 --> 00:22:46,070 right on target. 309 00:22:46,070 --> 00:22:47,460 It's accounted for. 310 00:22:47,460 --> 00:22:55,760 So these are ones that multigrid fixes 311 00:22:55,760 --> 00:22:59,040 because of course, everybody recognizes that I minus-- 312 00:22:59,040 --> 00:23:00,620 let me just say it, though. 313 00:23:00,620 --> 00:23:07,010 That I minus S times those errors is zero. 314 00:23:07,010 --> 00:23:12,360 So the eigenvectors with eigenvalue 1 315 00:23:12,360 --> 00:23:16,030 are the ones that are perfectly captured-- 316 00:23:16,030 --> 00:23:20,800 E sub h has got those components of small e_h exactly right; 317 00:23:20,800 --> 00:23:23,740 when I add them on, perfection. 318 00:23:23,740 --> 00:23:27,560 But then there were other components 319 00:23:27,560 --> 00:23:30,130 which it hasn't got at all. 320 00:23:30,130 --> 00:23:35,960 And when I add those on, no change, no improvement. 321 00:23:35,960 --> 00:23:41,400 By the way, how many eigenvalues-- so 322 00:23:41,400 --> 00:23:43,520 these eigenvalues are repeated. 323 00:23:43,520 --> 00:23:47,030 Like here, I've got 5 by 5 matrix. 324 00:23:47,030 --> 00:23:50,590 How many zeros and how many ones? 325 00:23:50,590 --> 00:23:54,050 You could say it's a projection matrix. 326 00:23:54,050 --> 00:23:57,670 S projects onto these eigenvectors, 327 00:23:57,670 --> 00:24:01,330 I minus S projects onto these eigenvectors, 328 00:24:01,330 --> 00:24:08,600 and how many zeros and how many ones for this, if A is 5 by 5? 329 00:24:11,130 --> 00:24:12,790 Well, what is A? 330 00:24:12,790 --> 00:24:14,530 This A is 2 by 2. 331 00:24:17,040 --> 00:24:25,240 So if I look at my S, look at my nifty formula for S, 332 00:24:25,240 --> 00:24:26,910 do you see all this here? 333 00:24:26,910 --> 00:24:28,410 Let's just get the sizes. 334 00:24:28,410 --> 00:24:30,240 A is 5 by 5. 335 00:24:33,750 --> 00:24:35,040 R is 2 by 5. 336 00:24:35,040 --> 00:24:40,940 It shrinks us down to the coarse mesh, where this is only 2 337 00:24:40,940 --> 00:24:44,680 by 2, and this takes us back up. 338 00:24:44,680 --> 00:24:50,390 So the total result, 5 by 2, 2 by 2, 2 by 5, 5 by 5 is 5 by 5. 339 00:24:50,390 --> 00:24:54,840 But what's the rank of S? 340 00:24:54,840 --> 00:24:58,760 Small prize for telling me the rank. 341 00:25:01,310 --> 00:25:02,700 I'm interested in this count. 342 00:25:02,700 --> 00:25:06,740 How many vectors are killed? 343 00:25:06,740 --> 00:25:10,930 How many go through unchanged when I multiply by S? 344 00:25:10,930 --> 00:25:13,730 So what's your guess for the rank of S? 345 00:25:13,730 --> 00:25:15,600 2, exactly. 346 00:25:15,600 --> 00:25:20,400 So S will have 2 of these guys. 347 00:25:20,400 --> 00:25:21,450 2. 348 00:25:21,450 --> 00:25:26,470 This has multiplicity 2 in the 5 by 5 case 349 00:25:26,470 --> 00:25:28,620 and this one has multiplicity 3. 350 00:25:31,710 --> 00:25:38,380 So multigrid is only fixing 2-- getting 2 vectors 351 00:25:38,380 --> 00:25:40,080 exactly right. 352 00:25:40,080 --> 00:25:41,770 And not getting these right. 353 00:25:41,770 --> 00:25:47,080 Well, I mean, 2 is half of 5. 354 00:25:47,080 --> 00:25:52,870 Well, in fact, 2 is exactly half of 5 because if I went up 355 00:25:52,870 --> 00:25:55,740 it would be 3 and 7, 4 and 9. 356 00:25:55,740 --> 00:26:00,910 The point is that the number of coarse grid points 357 00:26:00,910 --> 00:26:04,880 is about half the number of fine grid points. 358 00:26:04,880 --> 00:26:10,600 So 2 is about half of 1, 2, 3, 4, 5. 359 00:26:10,600 --> 00:26:22,050 Of course, how could I expect better than getting 2 perfect? 360 00:26:22,050 --> 00:26:27,700 I can't expect more because the problem I ultimately solve here 361 00:26:27,700 --> 00:26:30,890 is on the 2 by 2 size. 362 00:26:30,890 --> 00:26:33,810 So when I actually do something useful, 363 00:26:33,810 --> 00:26:38,190 I'm only doing it on the coarse grid and that's got dimension 2 364 00:26:38,190 --> 00:26:41,620 and so there will be 2 eigenvectors that get perfectly 365 00:26:41,620 --> 00:26:44,290 fixed, but the others don't. 366 00:26:47,570 --> 00:26:53,810 I do have to think, which are the eigenvectors? 367 00:26:53,810 --> 00:26:56,470 What eigenvectors are they? 368 00:26:59,010 --> 00:27:02,910 I guess what I hope is, what I believe is that these 369 00:27:02,910 --> 00:27:10,790 eigenvectors, which multigrid fixes for me, those e's-- well, 370 00:27:10,790 --> 00:27:14,830 the es have 5 components. 371 00:27:14,830 --> 00:27:18,260 Our matrix S is 5 by 5. 372 00:27:18,260 --> 00:27:20,410 I guess I'm thinking, I'm expecting 373 00:27:20,410 --> 00:27:26,400 that the eigenvectors-- that these two are somehow basically 374 00:27:26,400 --> 00:27:28,500 on the coarse mesh. 375 00:27:28,500 --> 00:27:30,700 And that these 3 that don't get fixed 376 00:27:30,700 --> 00:27:34,520 are somehow basically orthogonal to the coarse mesh, 377 00:27:34,520 --> 00:27:35,930 I would say. 378 00:27:35,930 --> 00:27:38,850 That these will be low-frequency vectors and these 379 00:27:38,850 --> 00:27:41,600 will be high-frequency vectors. 380 00:27:41,600 --> 00:27:46,180 That's what I expect and that's what somebody-- I mean, 381 00:27:46,180 --> 00:27:49,110 there are whole books on multigrid, 382 00:27:49,110 --> 00:27:51,650 where the main step in the analysis 383 00:27:51,650 --> 00:27:55,620 is to see that those eigenvectors are 384 00:27:55,620 --> 00:28:00,440 as I described, sort of coarse mesh vectors that are fixed 385 00:28:00,440 --> 00:28:04,980 and fine mesh vectors that don't get fixed by multigrid 386 00:28:04,980 --> 00:28:09,570 and those are the ones that a smoother better deal with. 387 00:28:12,530 --> 00:28:15,930 I mentioned that just before class I did a MATLAB experiment 388 00:28:15,930 --> 00:28:21,070 and I actually did it on these matrices 389 00:28:21,070 --> 00:28:24,960 with a Jacobi smoother. 390 00:28:24,960 --> 00:28:29,570 And I broke down the numbers here somewhere. 391 00:28:29,570 --> 00:28:33,890 And actually, I was a little disappointed. 392 00:28:33,890 --> 00:28:38,475 But I came away saying, OK, 5 by 5 just wasn't big enough. 393 00:28:38,475 --> 00:28:40,670 So I'll put down what I've got. 394 00:28:44,160 --> 00:28:46,910 What did I get for the eigenvalues of S? 395 00:28:46,910 --> 00:28:48,470 I got 1 and 0. 396 00:28:48,470 --> 00:28:50,840 That was a good thing. 397 00:28:50,840 --> 00:28:54,450 Now, did I write them down? 398 00:28:54,450 --> 00:28:56,060 I sure hope I did. 399 00:28:56,060 --> 00:28:56,560 Yep. 400 00:29:00,310 --> 00:29:09,750 So the question is, what about when M is in there? 401 00:29:12,390 --> 00:29:16,510 So the exercises were find the eigenvalues-- well, 402 00:29:16,510 --> 00:29:18,310 it'd be interesting, first of all, 403 00:29:18,310 --> 00:29:22,610 to know the eigenvalues of M. This is the Jacobi smoother, 404 00:29:22,610 --> 00:29:24,200 weighted Jacobi. 405 00:29:26,910 --> 00:29:29,440 Here's one we're really interested in. 406 00:29:29,440 --> 00:29:32,460 We're interested in doing a smoother, 407 00:29:32,460 --> 00:29:35,240 doing a multigrid cycle, and doing a smoother. 408 00:29:38,510 --> 00:29:43,660 I'm hoping that those eigenvalues are below this. 409 00:29:43,660 --> 00:29:50,040 So this is one smoother and this is smoothers with multigrid 410 00:29:50,040 --> 00:29:59,105 and this would be two smoothers and two post-smoothers, 411 00:29:59,105 --> 00:30:00,970 so repeating Jacobi twice. 412 00:30:00,970 --> 00:30:03,680 And M cubed would be interesting. 413 00:30:08,080 --> 00:30:10,650 Here is what I got for these things. 414 00:30:13,300 --> 00:30:15,370 What do I know about the eigenvalues of M? 415 00:30:19,010 --> 00:30:22,010 Do you remember that we actually worked those out? 416 00:30:22,010 --> 00:30:25,690 For ordinary Jacobi they're cosines 417 00:30:25,690 --> 00:30:30,790 and for weighted Jacobi, that weight omega, which I 418 00:30:30,790 --> 00:30:32,860 chose to be 2/3, comes into it. 419 00:30:32,860 --> 00:30:38,980 Anyway, so in a 5 by 5 case-- well, 420 00:30:38,980 --> 00:30:43,850 it's the biggest one that we all really want to know. 421 00:30:43,850 --> 00:30:47,540 So this is the maximum eigenvalue. 422 00:30:47,540 --> 00:30:50,870 Let me just write down the maximum. 423 00:30:50,870 --> 00:30:57,260 So the maximum eigenvalue of M was 0.91. 424 00:30:57,260 --> 00:31:02,120 So that says that ordinary Jacobi on a 5 by 5 problem 425 00:31:02,120 --> 00:31:05,340 reduces the error by that factor at every step. 426 00:31:05,340 --> 00:31:10,270 And of course that factor is totally satisfactory. 427 00:31:10,270 --> 00:31:15,380 If we could always do that we wouldn't need to do multigrid. 428 00:31:15,380 --> 00:31:21,160 But that 0.91, if I go to 7 by 7 or 9 by 9, 429 00:31:21,160 --> 00:31:25,630 it's going to quickly move up toward 1. 430 00:31:25,630 --> 00:31:29,590 That's an indication that my little experiment here 431 00:31:29,590 --> 00:31:35,270 is a bit small because that's not as near 1 432 00:31:35,270 --> 00:31:37,030 as a true thing would. 433 00:31:37,030 --> 00:31:46,490 OK, what was the result after this? 434 00:31:46,490 --> 00:31:53,450 I'm sorry to say that it was 0.88. 435 00:31:53,450 --> 00:31:54,120 Disappointing. 436 00:31:54,120 --> 00:31:57,160 So I did this one. 437 00:31:57,160 --> 00:31:58,750 I did 2 smoothers. 438 00:31:58,750 --> 00:32:02,990 Well, of course that's going to give me 0.91 squared in there. 439 00:32:02,990 --> 00:32:12,440 But anyway, I got 0.64. 440 00:32:12,440 --> 00:32:17,190 Which, of course, is very good. 441 00:32:20,560 --> 00:32:23,970 I'll say very good, but actually for that size, 442 00:32:23,970 --> 00:32:30,500 I had hoped for better, because my impression of multigrid, 443 00:32:30,500 --> 00:32:37,500 from reading about it, is that-- I 444 00:32:37,500 --> 00:32:47,710 mean that a good multigrid cycle, but this 445 00:32:47,710 --> 00:32:54,530 has an eigenvalue of about 0.1, is the goal. 446 00:32:54,530 --> 00:32:58,420 So how is that achieved? 447 00:32:58,420 --> 00:33:01,300 Well, I don't want to achieve it by just doing 448 00:33:01,300 --> 00:33:04,240 a whole lot more smoothing. 449 00:33:04,240 --> 00:33:08,240 Actually it's achieved by doing a whole lot more multigrid. 450 00:33:08,240 --> 00:33:11,740 Instead of doing just a little v-cycle, 451 00:33:11,740 --> 00:33:17,110 this would be the same for a good, deep V-cycle that 452 00:33:17,110 --> 00:33:22,570 went down maybe 4 and maybe a W-cycle, do it twice. 453 00:33:29,340 --> 00:33:33,460 Then-- of course, this is for a big problem, 454 00:33:33,460 --> 00:33:41,140 but really making multigrid work, like a W-cycle. 455 00:33:41,140 --> 00:33:43,660 Or even there's something called full multigrid. 456 00:33:43,660 --> 00:33:45,790 Should I draw the picture that corresponds 457 00:33:45,790 --> 00:33:47,920 to W for full multigrid? 458 00:33:47,920 --> 00:33:51,250 So full multigrid, you start on a coarse mesh. 459 00:33:51,250 --> 00:33:57,200 Go up, back; up, up, back, back, maybe twice; 460 00:33:57,200 --> 00:34:05,080 up, up, up to this level, back, back, back, and up again. 461 00:34:05,080 --> 00:34:08,440 So that's called full multigrid. 462 00:34:08,440 --> 00:34:12,480 That gives the best numbers. 463 00:34:12,480 --> 00:34:20,070 Anyway, we get numbers like this for when we really do more 464 00:34:20,070 --> 00:34:25,660 and it's very much worth it. 465 00:34:25,660 --> 00:34:29,180 I mean, it's completely a success. 466 00:34:29,180 --> 00:34:35,530 I would be interested to see a little-- well, I 467 00:34:35,530 --> 00:34:39,890 guess what I'm going to do now is, for this model problem 468 00:34:39,890 --> 00:34:48,040 that we worked on, I could find these eigenvectors, e. 469 00:34:58,230 --> 00:35:00,350 And analyze this model problem. 470 00:35:00,350 --> 00:35:02,080 OK, so how to find these eigenvectors. 471 00:35:05,260 --> 00:35:08,470 Again, for these particular matrices. 472 00:35:08,470 --> 00:35:14,840 Well, let me start with the eigenvectors of A itself. 473 00:35:14,840 --> 00:35:17,360 Do we know the eigenvectors of A? 474 00:35:19,950 --> 00:35:26,460 I guess if I had one important matrix, whose 475 00:35:26,460 --> 00:35:28,660 eigenvectors-- and nontrivial. 476 00:35:28,660 --> 00:35:32,480 I can't look at the 5 by 5 there and guess-- 477 00:35:32,480 --> 00:35:36,400 you know, at sight say what the eigenvectors are. 478 00:35:36,400 --> 00:35:41,100 So everybody sees it's 5 by 5 with four minus 1's below, 479 00:35:41,100 --> 00:35:46,270 five 2's on the diagonal, four minus 1's above the diagonal, 480 00:35:46,270 --> 00:35:52,020 and the eigenvectors of those special matrices 481 00:35:52,020 --> 00:35:58,980 have a special form, which allows us to do everything 482 00:35:58,980 --> 00:36:00,950 here. 483 00:36:00,950 --> 00:36:02,290 So what can I do here? 484 00:36:05,910 --> 00:36:10,040 I can do the computation of what S is. 485 00:36:10,040 --> 00:36:12,990 Can I report on that, which will be in the notes. 486 00:36:12,990 --> 00:36:15,420 Let me tell you what S is. 487 00:36:15,420 --> 00:36:19,290 If I take that as a R, that as I, that as A_(2h), 488 00:36:19,290 --> 00:36:23,350 I get S to be this matrix. 489 00:36:23,350 --> 00:36:39,680 Column of 0's; 1/2, 1, 1/2; column of 0's; 1/2, 1, 1/2; 490 00:36:39,680 --> 00:36:40,840 and column of 0's. 491 00:36:40,840 --> 00:36:48,720 So it's rather remarkable in this particular case. 492 00:36:48,720 --> 00:36:54,180 Now what can we recognize from this? 493 00:36:54,180 --> 00:37:05,320 Well, can we see eigenvalues of S explicitly from the matrix? 494 00:37:08,630 --> 00:37:12,780 Well, we certainly see that it has rank 2. 495 00:37:12,780 --> 00:37:18,700 It has 2 independent columns so its rank is 2 as we predicted. 496 00:37:18,700 --> 00:37:24,620 So it will have three zero eigenvalues, 497 00:37:24,620 --> 00:37:27,040 and we can see what the eigenvectors are actually. 498 00:37:27,040 --> 00:37:31,710 What are the eigenvectors-- if I go up above here? 499 00:37:31,710 --> 00:37:33,070 Can I do that? 500 00:37:33,070 --> 00:37:35,050 I want to go up and say something 501 00:37:35,050 --> 00:37:41,460 about the eigenvectors with eigenvalue zero. 502 00:37:44,620 --> 00:37:46,300 What's the null space of that matrix? 503 00:37:49,020 --> 00:37:54,760 If I multiple S by vectors, I want to get zero vectors. 504 00:37:54,760 --> 00:37:58,940 The eigenvectors e for lambda equals zero, 505 00:37:58,940 --> 00:38:03,470 if I multiply by anything with a first component, 506 00:38:03,470 --> 00:38:11,130 nothing in the-- with these three components, 507 00:38:11,130 --> 00:38:18,980 you see that if I multiply-- S*e is zero there for these e's. 508 00:38:24,610 --> 00:38:29,700 In a way that's exactly what I hoped for. 509 00:38:29,700 --> 00:38:33,960 That these vectors e are the vectors 510 00:38:33,960 --> 00:38:38,440 that live on the fine grid, but with no component 511 00:38:38,440 --> 00:38:42,710 on the coarse grid. 512 00:38:42,710 --> 00:38:48,620 And they're the ones which have S*e equal zero and multigrid 513 00:38:48,620 --> 00:38:50,480 doesn't help. 514 00:38:50,480 --> 00:38:52,330 Multigrid doesn't help. 515 00:38:52,330 --> 00:39:00,130 I minus S times those vectors is those vectors, no improvement. 516 00:39:00,130 --> 00:39:04,100 So they're eigenvectors with eigenvalue 0 for S, 517 00:39:04,100 --> 00:39:15,330 but with 1 for I minus S. See, my general thought 518 00:39:15,330 --> 00:39:22,400 is those would be the high-frequency vectors. 519 00:39:22,400 --> 00:39:31,900 They're sort of high frequency, but they're not low frequency 520 00:39:31,900 --> 00:39:32,540 anyway. 521 00:39:32,540 --> 00:39:36,840 Because low frequency, these would be a smooth vector. 522 00:39:36,840 --> 00:39:40,390 OK, so what are the eigenvectors with-- the other two 523 00:39:40,390 --> 00:39:44,020 eigenvectors, the ones that multigrid fixes? 524 00:39:44,020 --> 00:39:47,640 OK, so I'm looking for the other two eigenvectors here. 525 00:39:47,640 --> 00:39:51,350 And how do I find them? 526 00:39:51,350 --> 00:39:55,840 Let me see if I can even do it for this matrix. 527 00:39:55,840 --> 00:39:59,670 I'm looking for the eigenvectors with eigenvalue 1 now. 528 00:39:59,670 --> 00:40:02,610 So I should subtract the identity from this matrix. 529 00:40:05,860 --> 00:40:08,440 When I subtract the identity the ones 530 00:40:08,440 --> 00:40:13,380 become zeros and the zeros become minus ones. 531 00:40:13,380 --> 00:40:19,330 That's S minus I now, trying to keep a running equation that's 532 00:40:19,330 --> 00:40:20,530 correct. 533 00:40:20,530 --> 00:40:23,710 That's S minus I. And I'm looking 534 00:40:23,710 --> 00:40:27,950 for the null space of that now. 535 00:40:27,950 --> 00:40:29,230 Am I going to find it? 536 00:40:29,230 --> 00:40:29,900 I don't know. 537 00:40:29,900 --> 00:40:32,280 Do you see immediately what-- that has 538 00:40:32,280 --> 00:40:34,020 a two-dimensional null space. 539 00:40:34,020 --> 00:40:38,470 There are two vectors and can you see what they are? 540 00:40:43,600 --> 00:40:46,580 What do you think? 541 00:40:46,580 --> 00:40:49,570 Yeah, we certainly could. 542 00:40:49,570 --> 00:40:56,570 I don't know whether-- anybody see 543 00:40:56,570 --> 00:41:00,770 a vector that's in the null space of that matrix? 544 00:41:00,770 --> 00:41:02,490 Let me just start and try to get one. 545 00:41:06,560 --> 00:41:08,340 So I'm looking at that matrix, looking 546 00:41:08,340 --> 00:41:10,790 for a vector in its null space. 547 00:41:10,790 --> 00:41:15,990 And that will be an error vector that multigrid totally fixes. 548 00:41:15,990 --> 00:41:21,020 Say if I start with a 1 up in that first component then 549 00:41:21,020 --> 00:41:25,740 the first row will force me to have a 2 there. 550 00:41:25,740 --> 00:41:26,480 Is that right? 551 00:41:29,640 --> 00:41:32,005 And then I fixed the first row, the second row 552 00:41:32,005 --> 00:41:34,030 is all zeros already. 553 00:41:34,030 --> 00:41:39,290 Then I have 0.5 of that, which is 1. 554 00:41:39,290 --> 00:41:41,550 Oh, let me start from the bottom here. 555 00:41:41,550 --> 00:41:43,170 Well, it's probably symmetric. 556 00:41:43,170 --> 00:41:44,110 What do you think? 557 00:41:44,110 --> 00:41:49,260 Maybe something like 1, 2, and what's that middle number? 558 00:41:49,260 --> 00:41:50,250 Maybe 2. 559 00:41:55,370 --> 00:41:59,300 I think that that is in the null space of S minus I, 560 00:41:59,300 --> 00:42:04,120 because if I multiply by the first row I get minus 1 plus 1, 561 00:42:04,120 --> 00:42:09,820 and the third row gives me 1 minus 2 plus 1, 562 00:42:09,820 --> 00:42:12,850 and the last-- yes, so that's one of them anyway. 563 00:42:12,850 --> 00:42:18,860 And the point about it is it's pretty smooth. 564 00:42:22,720 --> 00:42:33,940 That's what I anticipate, vectors that are smooth, 565 00:42:33,940 --> 00:42:37,820 that's the type of vectors we're going to find multigrid fixing. 566 00:42:37,820 --> 00:42:43,940 So I've got one more eigenvector to find. 567 00:42:43,940 --> 00:42:48,295 Maybe I'll leave that as a puzzle. 568 00:42:48,295 --> 00:42:49,920 Somerville there's another eigenvector. 569 00:42:54,280 --> 00:42:59,040 Guess I'm not sure where it is, but I 570 00:42:59,040 --> 00:43:01,940 think it should be smooth. 571 00:43:01,940 --> 00:43:06,210 Somewhere there is one. 572 00:43:06,210 --> 00:43:11,690 Can I now go away from this numerical example 573 00:43:11,690 --> 00:43:19,050 to give you the answer for this problem, but for any size? 574 00:43:19,050 --> 00:43:21,680 Oh, it's because we know the eigenvectors of A. 575 00:43:21,680 --> 00:43:24,650 I started to talk about the eigenvectors of A 576 00:43:24,650 --> 00:43:25,930 and I didn't finish. 577 00:43:29,070 --> 00:43:31,480 If I want to get formulas for these 578 00:43:31,480 --> 00:43:37,120 I need to know the eigenvectors of A. So A, 579 00:43:37,120 --> 00:43:45,620 this matrix of 2's and minus 1's, the eigenvectors 580 00:43:45,620 --> 00:43:54,810 of that matrix are discrete sine functions. 581 00:43:54,810 --> 00:44:02,190 So an eigenvector would be for example, sine of pi on 6, 582 00:44:02,190 --> 00:44:13,190 sine of 2*pi on 6 up to sine of 5*pi on 6. 583 00:44:13,190 --> 00:44:19,000 It's worth knowing that those are eigenvectors. 584 00:44:19,000 --> 00:44:24,560 And other eigenvectors would double the frequency, 585 00:44:24,560 --> 00:44:28,870 triple the frequency, four times the frequency and five times. 586 00:44:28,870 --> 00:44:34,660 The eigenvectors of this matrix are what 587 00:44:34,660 --> 00:44:36,090 I will call discrete sines. 588 00:44:38,940 --> 00:44:40,230 Discrete sine vectors. 589 00:44:43,650 --> 00:44:44,730 And why? 590 00:44:44,730 --> 00:44:52,690 Because this matrix builds in the boundary condition 591 00:44:52,690 --> 00:44:57,310 since there should be a minus 1 there, but it's chopped off. 592 00:44:59,930 --> 00:45:02,020 That minus 1, if it was there would 593 00:45:02,020 --> 00:45:03,680 multiply the zeroth component. 594 00:45:06,940 --> 00:45:09,760 But the zeroth component is removed, 595 00:45:09,760 --> 00:45:14,790 so we have to be sure that the zeroth component would 596 00:45:14,790 --> 00:45:16,125 have been zero anyway. 597 00:45:16,125 --> 00:45:17,000 And that's the point. 598 00:45:17,000 --> 00:45:19,070 You see, if I follow this pattern, 599 00:45:19,070 --> 00:45:23,220 the zeroth component that I'm missing would be sine of zero. 600 00:45:23,220 --> 00:45:26,760 The component I'm missing up here would be sine of 0*pi over 601 00:45:26,760 --> 00:45:29,060 6, which is zero. 602 00:45:29,060 --> 00:45:32,920 And the component that's missing down at this boundary would be 603 00:45:32,920 --> 00:45:39,630 sine 6*pi over 6, which is sine pi, which is zero. 604 00:45:39,630 --> 00:45:47,770 That choice of vectors is the perfect Fourier vector. 605 00:45:47,770 --> 00:45:50,340 I expect Fourier when I see constant coefficients 606 00:45:50,340 --> 00:45:54,700 there with the right boundary conditions, zero at both ends. 607 00:45:54,700 --> 00:45:58,200 Anyway, those are the eigenvectors. 608 00:45:58,200 --> 00:46:03,200 The k-th eigenvector will have sine k*pi, sine k*2*pi, 609 00:46:03,200 --> 00:46:06,470 down to sine k*5*pi, all over 6. 610 00:46:06,470 --> 00:46:09,000 And I'll just, in the remaining moment, 611 00:46:09,000 --> 00:46:17,620 write down the result of following through those vectors 612 00:46:17,620 --> 00:46:28,580 and finding, finally, the eigenvectors of S itself. 613 00:46:28,580 --> 00:46:34,880 So this is like multigrid in a nutshell, if I can find it. 614 00:46:34,880 --> 00:46:36,500 Multigrid in a nutshell. 615 00:46:36,500 --> 00:46:39,100 All right, better be on this final board. 616 00:46:44,360 --> 00:46:48,640 I minus S times this sine vector , 617 00:46:48,640 --> 00:46:51,620 the k-th sine vector that I wrote over there, 618 00:46:51,620 --> 00:47:00,080 and I minus S times the minus k-th sine vector. 619 00:47:00,080 --> 00:47:02,990 So these will be low frequencies, for small k, 620 00:47:02,990 --> 00:47:04,950 and these will be high frequencies. 621 00:47:04,950 --> 00:47:07,930 And it turns out that these are 1/2, 622 00:47:07,930 --> 00:47:18,260 1 minus the cosine of k*pi over 6, or N plus 1 times y_k plus-- 623 00:47:18,260 --> 00:47:20,110 s_k, sorry. 624 00:47:20,110 --> 00:47:26,520 s_k plus s_(N-k). 625 00:47:26,520 --> 00:47:30,650 And this, acting on the high frequencies, 626 00:47:30,650 --> 00:47:42,616 is 1/2 of 1 plus cosine k*pi over 6, s_k plus s_(N-k). 627 00:47:47,550 --> 00:47:49,050 What am I seeing there? 628 00:47:52,580 --> 00:47:57,410 Let's just accept the algebra that went into this and see, 629 00:47:57,410 --> 00:48:02,030 does that tell me what the eigenvectors of I minus S are? 630 00:48:02,030 --> 00:48:03,340 Because that's my goal. 631 00:48:03,340 --> 00:48:04,600 Well, it does. 632 00:48:04,600 --> 00:48:08,920 Look, if I add these two equations-- let me look 633 00:48:08,920 --> 00:48:10,630 first just at this equation. 634 00:48:10,630 --> 00:48:17,370 So this says that if I start with a low frequency, 635 00:48:17,370 --> 00:48:25,450 k small, low value of k, that it's nearly removed. 636 00:48:25,450 --> 00:48:30,700 If k is very small the cosine of k*pi over 6 is somewhere near 637 00:48:30,700 --> 00:48:31,820 1. 638 00:48:31,820 --> 00:48:35,360 Of course, 6 was a little feeble, 639 00:48:35,360 --> 00:48:40,520 so let me take N; bigger matrices. 640 00:48:44,540 --> 00:48:47,970 Then the low frequencies are the ones 641 00:48:47,970 --> 00:48:49,770 where this cosine is near 1. 642 00:48:49,770 --> 00:48:53,290 This number is near zero and they're practically removed. 643 00:48:53,290 --> 00:48:56,540 Where the high frequencies, not much 644 00:48:56,540 --> 00:49:00,770 happens, because the cosine is near 1, this number in near 2. 645 00:49:00,770 --> 00:49:03,810 I divide by 2 and it's near 1. 646 00:49:03,810 --> 00:49:07,060 So the overall picture is right. 647 00:49:07,060 --> 00:49:10,620 Now to pin it down, if I add that two equations, 648 00:49:10,620 --> 00:49:14,780 then I get this combination s_k plus s_(N-k). 649 00:49:14,780 --> 00:49:16,830 Oh in fact, I guess I see it. 650 00:49:16,830 --> 00:49:18,750 What happens if I add the two equations? 651 00:49:18,750 --> 00:49:28,150 I get I minus S times s_k plus s_(n-k), 652 00:49:28,150 --> 00:49:30,080 and what do I have on the right-hand side? 653 00:49:33,800 --> 00:49:36,210 Well, 1. 654 00:49:36,210 --> 00:49:38,010 These add to 1. 655 00:49:38,010 --> 00:49:45,430 So I get s_k plus s_(N-k). 656 00:49:45,430 --> 00:49:52,420 Those are the eigenvectors of I minus S with eigenvalue 1. 657 00:49:56,640 --> 00:49:57,940 They're the ones I found here. 658 00:49:57,940 --> 00:50:01,450 They're the eigenvalues of S with eigenvalue zero. 659 00:50:01,450 --> 00:50:07,850 These are the s_k's plus s_(n-k)'s. 660 00:50:07,850 --> 00:50:12,350 And they live completely on the mesh points 661 00:50:12,350 --> 00:50:15,400 that are in the fine, but not the coarse mesh. 662 00:50:15,400 --> 00:50:19,340 And then if I play around one more step, 663 00:50:19,340 --> 00:50:24,710 I can find the eigenvectors for the other eigenvalue. 664 00:50:24,710 --> 00:50:32,570 The ones that are basically low frequency and where 665 00:50:32,570 --> 00:50:35,620 we have a numerical example. 666 00:50:35,620 --> 00:50:38,340 OK, I've run out of time before I can 667 00:50:38,340 --> 00:50:39,900 do that last bit of algebra. 668 00:50:39,900 --> 00:50:45,450 That will be in the notes, which we'll get onto the website, 669 00:50:45,450 --> 00:50:46,620 Monday at the latest. 670 00:50:49,490 --> 00:50:58,570 So I hope you have a sort of picture of what multigrid does 671 00:50:58,570 --> 00:51:03,940 and the experiments that you might do to check it out. 672 00:51:03,940 --> 00:51:07,780 OK, I'll see you Monday and we'll take a little more time 673 00:51:07,780 --> 00:51:12,510 to discuss projects because we'll have material on the web 674 00:51:12,510 --> 00:51:13,650 to work with. 675 00:51:13,650 --> 00:51:14,775 OK, thanks.