1 00:00:00,000 --> 00:00:01,470 NARRATOR: The following content is 2 00:00:01,470 --> 00:00:04,690 provided by MIT OpenCourseWare under a Creative Commons 3 00:00:04,690 --> 00:00:06,090 license. 4 00:00:06,090 --> 00:00:08,230 Additional information about our license 5 00:00:08,230 --> 00:00:10,490 and MIT OpenCourseWare in general 6 00:00:10,490 --> 00:00:14,380 is available at ocw.mit.edu. 7 00:00:14,380 --> 00:00:23,700 PROFESSOR: Ready to go on lecture five, I guess this is. 8 00:00:23,700 --> 00:00:29,480 So this -- we've done the one-way wave equation, 9 00:00:29,480 --> 00:00:34,600 first-order equation and now it's just natural to see what 10 00:00:34,600 --> 00:00:43,970 about the ordinary, second-order wave equation and on this 11 00:00:43,970 --> 00:00:47,120 board, I've written it two ways. 12 00:00:47,120 --> 00:00:51,460 I've written it as a second-order equation, 13 00:00:51,460 --> 00:00:54,210 so second time derivative appears. 14 00:00:54,210 --> 00:00:57,860 That's going to make a change. 15 00:00:57,860 --> 00:01:01,420 It will have second differences in time, 16 00:01:01,420 --> 00:01:04,730 so we're going to have more steps, 17 00:01:04,730 --> 00:01:12,320 and of the matching second difference in space. 18 00:01:12,320 --> 00:01:13,870 That's one way. 19 00:01:13,870 --> 00:01:18,440 Then this is another important way 20 00:01:18,440 --> 00:01:23,280 to write the same equation as a first-order system. 21 00:01:23,280 --> 00:01:28,090 So I can get back to first-order systems and I can use all those 22 00:01:28,090 --> 00:01:32,940 methods -- Friedrichs, Lax-Friedrichs for example, 23 00:01:32,940 --> 00:01:39,740 Lax-Wendroff, whatever improvements we think of -- 24 00:01:39,740 --> 00:01:45,170 on this first order system, d by dt of a vector is a matrix 25 00:01:45,170 --> 00:01:47,090 times d by dx of a vector. 26 00:01:47,090 --> 00:01:52,030 So that's -- you really have a choice here. 27 00:01:52,030 --> 00:01:54,640 Written this way, well, notice a little bit 28 00:01:54,640 --> 00:01:59,280 of a good thing, one good thing here. 29 00:01:59,280 --> 00:02:03,100 The matrix that shows up is symmetric. 30 00:02:03,100 --> 00:02:08,140 That was by the careful choice of putting a c in there. 31 00:02:08,140 --> 00:02:13,840 Then you see that the first equation in this system is u_tt 32 00:02:13,840 --> 00:02:16,330 is c time c*u_xx. 33 00:02:19,370 --> 00:02:22,010 So the first equation is the wave equation. 34 00:02:22,010 --> 00:02:23,850 And what about the second equation? 35 00:02:23,850 --> 00:02:26,240 This is typical, when you reduce things 36 00:02:26,240 --> 00:02:30,460 to a lower-order system, that you get an equation here 37 00:02:30,460 --> 00:02:32,360 which is just an identity. 38 00:02:32,360 --> 00:02:36,210 The derivative of c -- the time -- this is c*u_xt -- 39 00:02:36,210 --> 00:02:41,280 it's the derivative in x and t from there -- 40 00:02:41,280 --> 00:02:44,520 and we have c times the x derivative of u_t, 41 00:02:44,520 --> 00:02:45,900 the cross derivative. 42 00:02:45,900 --> 00:02:51,980 So that is an identity because u_tx is the same as u_xt. 43 00:02:51,980 --> 00:02:56,100 We can take time and x and t derivatives in either order, 44 00:02:56,100 --> 00:02:58,890 for a function of x and t. 45 00:02:58,890 --> 00:03:00,470 So we'll see that. 46 00:03:03,200 --> 00:03:06,900 I guess what I want to do in the lecture is not 47 00:03:06,900 --> 00:03:13,640 to repeat Lax-Friedrichs or Lax-Wendroff for this system. 48 00:03:13,640 --> 00:03:18,450 That would be unexciting. 49 00:03:18,450 --> 00:03:22,650 Let me just mention, what are the eigenvalues of that matrix? 50 00:03:22,650 --> 00:03:26,020 So the eigenvalues -- for a system, 51 00:03:26,020 --> 00:03:32,450 it's the eigenvalues of the matrix that tell us what waves 52 00:03:32,450 --> 00:03:38,010 we've got, what speeds they go, where it -- when it was 1 by 1, 53 00:03:38,010 --> 00:03:40,620 of course, it was just that single number c, 54 00:03:40,620 --> 00:03:43,560 but what are the eigenvalues of that matrix? 55 00:03:43,560 --> 00:03:47,380 Now, having made it a symmetric matrix, 56 00:03:47,380 --> 00:03:50,430 we know right away it has real eigenvalues, 57 00:03:50,430 --> 00:03:53,900 and so it's a wave problem. 58 00:03:53,900 --> 00:03:58,880 For a heat equation, we would see something different, 59 00:03:58,880 --> 00:04:02,990 but this'll be a wave equation and this has two eigenvalues 60 00:04:02,990 --> 00:04:08,000 and they are c and minus c. 61 00:04:08,000 --> 00:04:11,130 You could quickly check that that 2 by 2 matrix 62 00:04:11,130 --> 00:04:14,630 has eigenvalues c and minus c. 63 00:04:14,630 --> 00:04:18,020 They add up to 0, which is the trace. 64 00:04:18,020 --> 00:04:22,870 They multiply -- c times minus c is minus c squared, 65 00:04:22,870 --> 00:04:24,080 which is the determinant. 66 00:04:24,080 --> 00:04:26,800 So that's -- they're the right eigenvalues. 67 00:04:26,800 --> 00:04:32,190 So that's going to tell us what we'll find every way, 68 00:04:32,190 --> 00:04:36,710 that the speeds of the waves are c and minus c, which 69 00:04:36,710 --> 00:04:39,690 means a wave going one way with speed c 70 00:04:39,690 --> 00:04:43,960 and a wave going the other way with speed c. 71 00:04:43,960 --> 00:04:46,230 So it's a two-way wave equation. 72 00:04:46,230 --> 00:04:51,710 And this is the equation of real -- that really happens, 73 00:04:51,710 --> 00:04:54,120 and I wanted to say just a little bit about it -- 74 00:04:54,120 --> 00:04:57,260 just two words about real problems, 75 00:04:57,260 --> 00:05:01,660 because we can't, in these first days, 76 00:05:01,660 --> 00:05:07,630 tackle the difficult problems of electromagnetism, 77 00:05:07,630 --> 00:05:16,280 antenna design, all kinds of wave problems. 78 00:05:16,280 --> 00:05:20,040 I guess I'm hoping some of you may be meeting real wave 79 00:05:20,040 --> 00:05:29,750 problems in other courses and would make a project that tries 80 00:05:29,750 --> 00:05:32,170 our methods on real problems. 81 00:05:32,170 --> 00:05:35,010 I just wanted to write down here one 82 00:05:35,010 --> 00:05:37,390 sort of typical real problem. 83 00:05:37,390 --> 00:05:43,620 So in a real problem, we have a variable coefficient x, 84 00:05:43,620 --> 00:05:47,140 because maybe our material is not homogeneous, 85 00:05:47,140 --> 00:05:53,150 it's not uniform, and we have a forcing term -- 86 00:05:53,150 --> 00:05:57,100 I just put F for the amplitude to emphasize that's forcing 87 00:05:57,100 --> 00:06:01,700 term, so F standing for forcing, but it's an oscillating forcing 88 00:06:01,700 --> 00:06:05,120 term, it's a -- this is what you're going to have. 89 00:06:05,120 --> 00:06:08,190 In electromagnetism, the frequency 90 00:06:08,190 --> 00:06:09,690 is going to be very, very high. 91 00:06:12,200 --> 00:06:17,170 So this is a problem that's not easy numerically. 92 00:06:17,170 --> 00:06:20,880 Very, very high frequencies would normally 93 00:06:20,880 --> 00:06:24,010 require very, very small wavelengths, very, very 94 00:06:24,010 --> 00:06:26,640 small delta x, because you remember, 95 00:06:26,640 --> 00:06:30,520 there'll be a k delta x in the error. 96 00:06:30,520 --> 00:06:35,730 So we took a big delta x or even an ordinary size delta 97 00:06:35,730 --> 00:06:39,830 x and let the frequency go way, way up, high, high frequency 98 00:06:39,830 --> 00:06:43,540 oscillation, our k delta x would be big 99 00:06:43,540 --> 00:06:47,980 and the accuracy would be poor and the results useless. 100 00:06:47,980 --> 00:06:53,190 So a lot of -- I'm really -- guess I'm thinking here about 101 00:06:53,190 --> 00:06:58,620 a course on wave propagation would study this as a first 102 00:06:58,620 --> 00:07:06,340 model problem, do some analysis and then go into 2-D and 3-D. 103 00:07:06,340 --> 00:07:11,110 That's the reality of wave theory, 104 00:07:11,110 --> 00:07:15,350 is you can get asymptotic results for k going 105 00:07:15,350 --> 00:07:16,700 to infinity. 106 00:07:16,700 --> 00:07:23,290 You get things -- you're looking in matching powers of k, 107 00:07:23,290 --> 00:07:24,110 so to speak. 108 00:07:24,110 --> 00:07:29,450 You're getting plane waves and interesting stuff 109 00:07:29,450 --> 00:07:33,810 that we can't do already, right away here. 110 00:07:33,810 --> 00:07:37,280 So I'm going back to the ordinary wave equation, 111 00:07:37,280 --> 00:07:40,910 either second or -- start with second order, 112 00:07:40,910 --> 00:07:43,100 u_tt is c squared u_xx. 113 00:07:43,100 --> 00:07:46,460 That's our goal. 114 00:07:46,460 --> 00:07:49,260 As I said, we don't want to see Lax-Friedrichs and Lax-Wendroff 115 00:07:49,260 --> 00:07:49,760 again. 116 00:07:49,760 --> 00:07:52,830 We know those. 117 00:07:52,830 --> 00:08:00,320 It's rather -- so one new method is going to show up and it's -- 118 00:08:00,320 --> 00:08:04,420 leapfrog is the right name, the natural name to give it. 119 00:08:04,420 --> 00:08:09,230 Leapfrog because in the time direction, 120 00:08:09,230 --> 00:08:13,250 we have time n minus 1, n and n plus 1. 121 00:08:13,250 --> 00:08:19,980 There's a leap there, but let me start with semidiscrete. 122 00:08:19,980 --> 00:08:24,790 We haven't done this until today. 123 00:08:24,790 --> 00:08:30,850 Semidiscrete means, as you see, that the time variable 124 00:08:30,850 --> 00:08:33,990 stays continuous. 125 00:08:33,990 --> 00:08:39,310 We have ordinary differential equations in t, 126 00:08:39,310 --> 00:08:42,990 but the space variable is what's getting discrete. 127 00:08:42,990 --> 00:08:47,730 so the problem is like half discrete -- discrete in x, 128 00:08:47,730 --> 00:08:52,770 there's a delta x, but there's no delta t yet. 129 00:08:52,770 --> 00:08:59,260 So it's natural to analyze this problem. 130 00:08:59,260 --> 00:09:00,730 So what do we have, really? 131 00:09:00,730 --> 00:09:06,240 In the x direction, we have a mesh of width delta x. 132 00:09:06,240 --> 00:09:08,370 So we have unknowns. 133 00:09:08,370 --> 00:09:17,510 If that's 0, j is measuring -- so j delta x is the typical 134 00:09:17,510 --> 00:09:22,260 point, point number j along there. 135 00:09:22,260 --> 00:09:26,950 And then in the time direction, we're going continuously. 136 00:09:26,950 --> 00:09:32,150 So I don't have discrete steps, so it's called -- 137 00:09:32,150 --> 00:09:36,230 because those are lines in the time direction, this is -- 138 00:09:36,230 --> 00:09:41,370 semidiscrete is also referred to as the method of lines. 139 00:09:41,370 --> 00:09:44,980 So the method of lines is what we're doing here and it's -- 140 00:09:44,980 --> 00:09:51,260 all I want to do is what I always do. 141 00:09:51,260 --> 00:09:57,400 Take exponentials, look at their growth factors, 142 00:09:57,400 --> 00:09:59,110 understand the equation. 143 00:09:59,110 --> 00:10:02,330 Actually, I better do it first with a wave equation itself. 144 00:10:02,330 --> 00:10:06,780 So I guess my organization for today is, 145 00:10:06,780 --> 00:10:12,500 first step is follow e to the i*k*x for the wave equation. 146 00:10:12,500 --> 00:10:14,650 So I'll do that here. 147 00:10:14,650 --> 00:10:24,010 u_tt equals c squared u_xx, and I'm going to look at u 148 00:10:24,010 --> 00:10:28,410 proportional to -- and I'll call this factor G again -- 149 00:10:28,410 --> 00:10:31,890 G of t and times the frequency i*k*x. 150 00:10:35,000 --> 00:10:40,660 So I'm going to look for pure exponentials 151 00:10:40,660 --> 00:10:42,600 and we'll quickly find them. 152 00:10:42,600 --> 00:10:45,690 And then I'm going to do the same for semidiscrete, 153 00:10:45,690 --> 00:10:51,850 where that x becomes j delta x and I'm at point j. 154 00:10:51,850 --> 00:11:00,450 And then I'm going to eventually look at the discrete, now fully 155 00:11:00,450 --> 00:11:07,050 discrete, discrete in time and discrete in space, 156 00:11:07,050 --> 00:11:12,940 and the question of stability arises. 157 00:11:12,940 --> 00:11:15,380 Accuracy we can -- you pretty much -- 158 00:11:15,380 --> 00:11:19,700 we pretty much know the accuracy for second differences, 159 00:11:19,700 --> 00:11:23,700 that's a second-order accurate thing because it's centered, 160 00:11:23,700 --> 00:11:25,580 but stability is going to come in. 161 00:11:32,380 --> 00:11:34,610 So that's -- this is our first step. 162 00:11:37,510 --> 00:11:40,540 Then I'll just mention what other point 163 00:11:40,540 --> 00:11:45,630 remains in this wave equation, is to look 164 00:11:45,630 --> 00:11:47,930 at the first-order system. 165 00:11:50,560 --> 00:11:56,980 How does that look in space and time? 166 00:11:56,980 --> 00:12:01,390 As I said, the obvious thing to do 167 00:12:01,390 --> 00:12:04,370 would be Lax-Friedrichs or Lax-Wendroff, 168 00:12:04,370 --> 00:12:14,210 but there's another idea and it brings in a staggered grid. 169 00:12:14,210 --> 00:12:16,890 You'll see it. 170 00:12:16,890 --> 00:12:20,310 Somehow that staggered grid is really an important idea 171 00:12:20,310 --> 00:12:22,030 that we haven't met yet. 172 00:12:22,030 --> 00:12:28,780 That some unknowns are on the standard grid, U_(j, n), 173 00:12:28,780 --> 00:12:36,935 but the other unknowns are on a grid that's half a delta x 174 00:12:36,935 --> 00:12:40,950 and half a delta t different. 175 00:12:40,950 --> 00:12:42,710 It's just right, actually. 176 00:12:42,710 --> 00:12:47,870 So that's a premier method in electromagnetism. 177 00:12:47,870 --> 00:12:50,790 So that's what's coming, but let's start 178 00:12:50,790 --> 00:12:52,970 with the second-order method, because we haven't 179 00:12:52,970 --> 00:12:55,600 seen the second-order method. 180 00:12:55,600 --> 00:13:00,530 Second-order equation -- plug in G. So I have -- 181 00:13:00,530 --> 00:13:06,130 the second time derivative gives me G double prime times e 182 00:13:06,130 --> 00:13:09,750 to the i*k*x -- I'm separating variables, of course; 183 00:13:09,750 --> 00:13:12,460 t here and x there. 184 00:13:12,460 --> 00:13:15,030 On the other side, I have c squared. 185 00:13:15,030 --> 00:13:19,600 Now I have the x variable, so that brings down an i*k -- 186 00:13:19,600 --> 00:13:27,620 so that's i*k squared times G e to the i*k*x. 187 00:13:27,620 --> 00:13:30,120 Good. 188 00:13:30,120 --> 00:13:39,480 So simple, but substituting this is just a natural first step 189 00:13:39,480 --> 00:13:40,840 to see what's happening. 190 00:13:40,840 --> 00:13:44,860 Then, of course, canceling e to the i*k*x leaves us with 191 00:13:44,860 --> 00:13:50,790 the equation for the G. G double prime is -- 192 00:13:50,790 --> 00:13:57,940 I'll make that i squared minus -- minus c squared k squared G. 193 00:13:57,940 --> 00:14:03,100 Of course, the new aspect is it's second order. 194 00:14:03,100 --> 00:14:06,890 So it's got two solutions instead of just one. 195 00:14:06,890 --> 00:14:09,920 It's constant coefficients, of course, 196 00:14:09,920 --> 00:14:13,840 and so we look for exponentials. 197 00:14:13,840 --> 00:14:22,800 And the solution then would be -- two solutions are some -- 198 00:14:22,800 --> 00:14:28,410 there's an e to the i -- I guess I'm bringing back the i -- 199 00:14:28,410 --> 00:14:44,100 e to the i*c*k*t e to the i*k*x and e to the minus i*c*k*t e 200 00:14:44,100 --> 00:14:46,540 to the i*k*x. 201 00:14:46,540 --> 00:14:49,550 Those are the two possible G's. 202 00:14:49,550 --> 00:14:57,280 Those are the -- if we take their second time derivative, 203 00:14:57,280 --> 00:15:02,690 we get the same as taking the second x derivative. 204 00:15:02,690 --> 00:15:07,010 We get the factor c is in the right place. 205 00:15:07,010 --> 00:15:08,200 You'll see it. 206 00:15:08,200 --> 00:15:11,300 The second time derivative brings this factor down, 207 00:15:11,300 --> 00:15:16,910 just as we wanted, but the point is that there are two of them. 208 00:15:16,910 --> 00:15:25,270 So this I can write as e to the i*k x plus ct. 209 00:15:25,270 --> 00:15:27,650 That's our old friend. 210 00:15:27,650 --> 00:15:34,650 This one I can write as e to the i*k x minus ct, 211 00:15:34,650 --> 00:15:37,920 which is our new friend, the new wave. 212 00:15:37,920 --> 00:15:39,660 The wave that's going to the right. 213 00:15:39,660 --> 00:15:45,600 So this x plus c*t follows the characteristic lines 214 00:15:45,600 --> 00:15:52,000 to the left, just the way we had in the one-way wave equation. 215 00:15:52,000 --> 00:15:59,910 This x minus c*t stays constant on characteristic lines going 216 00:15:59,910 --> 00:16:10,580 up to the right; it travels with speed c and the signal travels 217 00:16:10,580 --> 00:16:14,270 along those characteristics with speed c, so that a -- 218 00:16:14,270 --> 00:16:23,910 an initial value, now -- maybe I draw a picture over here -- 219 00:16:23,910 --> 00:16:27,620 so here is t equals -- this is x as always. 220 00:16:27,620 --> 00:16:29,320 This is t equals 0. 221 00:16:29,320 --> 00:16:33,630 I have some initial value u at (0, 0), 222 00:16:33,630 --> 00:16:39,400 and I also have an initial velocity, because I'm in -- 223 00:16:39,400 --> 00:16:44,010 got a second-order equation, but information somehow, 224 00:16:44,010 --> 00:16:49,270 pure exponential information travels along characteristics 225 00:16:49,270 --> 00:16:51,880 this way -- that's the new one -- 226 00:16:51,880 --> 00:16:55,370 and characteristics this way -- that's the old one. 227 00:16:55,370 --> 00:16:58,790 This is time, space. 228 00:16:58,790 --> 00:17:02,490 I'm graphing the two characteristic lines now. 229 00:17:02,490 --> 00:17:08,520 x minus c*t equals -- if it starts from 0, 230 00:17:08,520 --> 00:17:10,520 then it would be 0. 231 00:17:10,520 --> 00:17:15,670 This is the x plus c*t equals 0, the one we had before. 232 00:17:15,670 --> 00:17:17,090 The two characteristic lines. 233 00:17:19,790 --> 00:17:24,540 Waves are going both ways, right? 234 00:17:24,540 --> 00:17:29,205 Now, what we were able to do with the first-order equation 235 00:17:29,205 --> 00:17:37,400 -- we even got a completely explicit solution 236 00:17:37,400 --> 00:17:40,120 to the one-way wave equation and we can do the same 237 00:17:40,120 --> 00:17:44,480 for the two-way wave equation, so I better write it down. 238 00:17:44,480 --> 00:17:47,730 I better write down the solution. 239 00:17:47,730 --> 00:17:52,130 So let me just continue this same idea. 240 00:17:52,130 --> 00:18:01,730 The general, the complete solution will be u of x and t 241 00:18:01,730 --> 00:18:10,820 is some function of x minus c*t and some function of -- 242 00:18:10,820 --> 00:18:16,860 call that f_2 -- of x plus c*t. 243 00:18:16,860 --> 00:18:22,500 Now I'm taking the jump, the jump from one exponential, 244 00:18:22,500 --> 00:18:30,430 a particular k that gave me these particular guys, 245 00:18:30,430 --> 00:18:35,360 to all exponentials and assembling all exponentials 246 00:18:35,360 --> 00:18:36,350 into functions. 247 00:18:36,350 --> 00:18:37,830 So why is that OK? 248 00:18:37,830 --> 00:18:42,070 It's only OK in this because of this very special situation 249 00:18:42,070 --> 00:18:45,620 that all frequencies are behaving the same here. 250 00:18:45,620 --> 00:18:50,830 All frequencies -- I have no dispersion. 251 00:18:50,830 --> 00:18:54,490 Dispersion is going to be different behavior 252 00:18:54,490 --> 00:18:58,580 of different frequencies, so that's an important fact, 253 00:18:58,580 --> 00:19:01,500 which we don't face here. 254 00:19:01,500 --> 00:19:06,330 There will be dispersion in the discrete methods, 255 00:19:06,330 --> 00:19:09,890 the semidiscrete and the discrete method. 256 00:19:09,890 --> 00:19:13,210 Different frequencies will travel at different speeds 257 00:19:13,210 --> 00:19:17,400 and that's what produces the oscillating error. 258 00:19:17,400 --> 00:19:22,830 Whatever shape the error has is because different k's are doing 259 00:19:22,830 --> 00:19:25,300 slightly different things, as we'll see 260 00:19:25,300 --> 00:19:28,680 when we do the discrete ones. 261 00:19:28,680 --> 00:19:33,560 But in the continuous case, every k, we have the same -- 262 00:19:33,560 --> 00:19:38,200 traveling either with speed c or minus c and therefore, 263 00:19:38,200 --> 00:19:41,570 we put them all together and we have a whole function traveling 264 00:19:41,570 --> 00:19:44,450 with speed c or minus c. 265 00:19:44,450 --> 00:19:48,280 Now we've got two functions and we 266 00:19:48,280 --> 00:19:51,440 have to do we have to match two initial conditions. 267 00:19:51,440 --> 00:19:59,540 We have to match a u of x and 0 and the time derivative 268 00:19:59,540 --> 00:20:03,080 has to match a u_t of x and 0, so these 269 00:20:03,080 --> 00:20:05,850 are the initial conditions. 270 00:20:10,010 --> 00:20:12,690 You just match them up and you find the answer. 271 00:20:12,690 --> 00:20:15,990 So you discover what these functions really are. 272 00:20:15,990 --> 00:20:19,190 It turns out that, I think, we had -- you remember before, 273 00:20:19,190 --> 00:20:26,740 we had a u of x plus c*t and 0? 274 00:20:26,740 --> 00:20:30,380 That was everything in the solution to the one-way wave 275 00:20:30,380 --> 00:20:31,400 equation. 276 00:20:31,400 --> 00:20:44,990 Now we will have u of x minus c*t, 0 and this divided by 2 -- 277 00:20:44,990 --> 00:20:51,270 so there, you see, a wave's going each way and the division 278 00:20:51,270 --> 00:20:58,660 by 2 makes us -- now we're matching the initial condition, 279 00:20:58,660 --> 00:21:04,740 so that would be the total answer if the equation, 280 00:21:04,740 --> 00:21:08,940 if the body starts from rest with zero velocity, 281 00:21:08,940 --> 00:21:14,760 but I haven't matched -- so I've only matched du/dt equals 0 -- 282 00:21:14,760 --> 00:21:18,040 think the time derivative of that would be 0. 283 00:21:18,040 --> 00:21:20,570 Yeah, because the time derivative of this would bring 284 00:21:20,570 --> 00:21:25,740 out a c, this would bring out a minus c and a t equals 0, 285 00:21:25,740 --> 00:21:26,940 they'd cancelled. 286 00:21:26,940 --> 00:21:34,200 So I need another term and it turns out to be -- 287 00:21:34,200 --> 00:21:35,680 I'll just write it down. 288 00:21:35,680 --> 00:21:41,360 It's got to depend on x minus c*t and x plus c*t 289 00:21:41,360 --> 00:21:50,500 and it's this -- it's the integral of this velocity dx. 290 00:21:50,500 --> 00:21:55,840 I won't -- there's no reason to take time to derive that. 291 00:21:55,840 --> 00:21:59,190 I think it's right and could check. 292 00:21:59,190 --> 00:22:00,290 Right. 293 00:22:00,290 --> 00:22:09,510 So what this means is that the initial velocity is -- 294 00:22:09,510 --> 00:22:12,560 it's entering, somehow, all along -- 295 00:22:12,560 --> 00:22:23,600 somehow the initial velocity is affecting things within this 296 00:22:23,600 --> 00:22:31,520 cone, this characteristic cone that's defined 297 00:22:31,520 --> 00:22:34,480 by the characteristic lines. 298 00:22:34,480 --> 00:22:37,880 In two dimensions, that cone will really look like a cone. 299 00:22:37,880 --> 00:22:40,300 It'll look like an ice cream cone -- 300 00:22:40,300 --> 00:22:41,950 or maybe that's in three dimensions. 301 00:22:44,670 --> 00:22:45,170 Whatever. 302 00:22:48,560 --> 00:22:51,600 In other words, if the initial condition 303 00:22:51,600 --> 00:22:54,760 was a delta function at the origin, 304 00:22:54,760 --> 00:23:01,130 you could quickly see what the solution would be, 305 00:23:01,130 --> 00:23:03,330 and if the delta, if the initial condition 306 00:23:03,330 --> 00:23:06,830 was a step function at the origin, what would happen then? 307 00:23:06,830 --> 00:23:10,810 Suppose I started with this step function at the origin. 308 00:23:10,810 --> 00:23:14,910 So, like, a wall of water and suppose it's at rest. 309 00:23:14,910 --> 00:23:19,060 So nothing -- at moment t equals 0, 310 00:23:19,060 --> 00:23:26,200 I remove the dam and the water starts -- the water flows. 311 00:23:26,200 --> 00:23:32,110 Then this term is 0 because there was no initial velocity 312 00:23:32,110 --> 00:23:35,780 and this term is just half of that wall goes one way 313 00:23:35,780 --> 00:23:38,560 and half goes the other way. 314 00:23:38,560 --> 00:23:46,670 The notes draw a picture of that, so that -- so that's -- 315 00:23:46,670 --> 00:23:52,712 I've kind of quickly disposed of the solution of the wave 316 00:23:52,712 --> 00:23:58,270 equation and of course, that's too easy. 317 00:23:58,270 --> 00:24:07,010 This is -- I mean, that's good to know and good to compare 318 00:24:07,010 --> 00:24:12,340 when we meet real problems where c depends on x, 319 00:24:12,340 --> 00:24:15,520 where there's a forcing term, where there's a -- 320 00:24:15,520 --> 00:24:18,840 real complications. 321 00:24:18,840 --> 00:24:22,580 But it just pays to stay with the model problems 322 00:24:22,580 --> 00:24:23,950 at the beginning. 323 00:24:23,950 --> 00:24:28,850 So, I'm going to stay with the model problem and move 324 00:24:28,850 --> 00:24:36,470 on to discrete, so try to understand -- 325 00:24:36,470 --> 00:24:42,930 let me try to understand what happens if I make the space 326 00:24:42,930 --> 00:24:45,670 variable discrete, right? 327 00:24:49,260 --> 00:24:54,270 I guess I should say, another step toward reality 328 00:24:54,270 --> 00:24:58,540 would be, have some boundaries. 329 00:24:58,540 --> 00:25:01,990 Here, this is on the whole line, x from minus infinity 330 00:25:01,990 --> 00:25:06,640 to infinity, so reality would be that there would be -- 331 00:25:06,640 --> 00:25:14,290 this picture would have some boundary, maybe there at, say, 332 00:25:14,290 --> 00:25:22,430 minus L and L, and some boundary conditions there, 333 00:25:22,430 --> 00:25:25,180 on that boundary. 334 00:25:25,180 --> 00:25:32,000 And that -- so now we have a finite problem. 335 00:25:32,000 --> 00:25:34,750 That means the calculations are fine, 336 00:25:34,750 --> 00:25:37,470 but it means some new effects are coming in. 337 00:25:37,470 --> 00:25:43,230 Waves can bounce back off the boundary, partly. 338 00:25:43,230 --> 00:25:50,120 They can go out, be lost, go beyond 339 00:25:50,120 --> 00:25:54,840 or disappear, depending what the boundary conditions are. 340 00:25:54,840 --> 00:25:57,130 So that's another part of reality, 341 00:25:57,130 --> 00:26:00,290 is boundary conditions. 342 00:26:00,290 --> 00:26:06,720 I'm probably suggesting, then, some more realistic 343 00:26:06,720 --> 00:26:08,330 numerical experiments. 344 00:26:08,330 --> 00:26:10,060 So a realistic numerical experiment 345 00:26:10,060 --> 00:26:14,140 would be, put in some boundaries, 346 00:26:14,140 --> 00:26:17,040 make this a finite system. 347 00:26:17,040 --> 00:26:24,910 So if that's 0, let's just have a finite number, stop there. 348 00:26:24,910 --> 00:26:27,260 This would be one boundary, this would be the other. 349 00:26:27,260 --> 00:26:33,120 Then I have just seven unknowns in that problem. 350 00:26:33,120 --> 00:26:36,840 That'd be a seven by seven matrix over there 351 00:26:36,840 --> 00:26:38,580 and it would be the second difference 352 00:26:38,580 --> 00:26:49,810 matrix that is so fundamental in all of scientific computing. 353 00:26:49,810 --> 00:26:52,180 So we have here a second difference matrix, 354 00:26:52,180 --> 00:26:54,420 but it's infinite because I haven't 355 00:26:54,420 --> 00:26:56,410 got a boundary right now. 356 00:26:56,410 --> 00:26:59,130 So the fact of not having a boundary 357 00:26:59,130 --> 00:27:02,540 means Fourier is ready to go. 358 00:27:02,540 --> 00:27:08,870 So I'm going to plug in -- again, I'm going to try U. 359 00:27:08,870 --> 00:27:12,840 This is capital U now, because I've discretized something. 360 00:27:17,010 --> 00:27:21,470 I better write this in a form where we see the j, 361 00:27:21,470 --> 00:27:28,400 so can I write this equation, just again for U number j -- 362 00:27:28,400 --> 00:27:32,353 so tracking up this line, for example, or this one. 363 00:27:32,353 --> 00:27:38,550 So I'm tracking up this line -- do you see that U is now 364 00:27:38,550 --> 00:27:39,370 a system? 365 00:27:39,370 --> 00:27:43,310 In this case -- let's see. 366 00:27:43,310 --> 00:27:46,240 I shouldn't have put this one in so that I'd have 1, 2, 3, 4, 5, 367 00:27:46,240 --> 00:27:47,560 6, 7 -- that's good. 368 00:27:51,650 --> 00:27:58,020 So my unknowns are U_j tracking up that line. 369 00:27:58,020 --> 00:28:03,930 Each U_j is going in the time direction, 370 00:28:03,930 --> 00:28:09,960 so this equation is really the time derivative. 371 00:28:09,960 --> 00:28:12,640 It's an ordinary derivative. 372 00:28:12,640 --> 00:28:15,710 I can write d and not partial derivative, 373 00:28:15,710 --> 00:28:21,450 because the only derivatives here are in time of U_j -- 374 00:28:21,450 --> 00:28:31,700 is c squared over delta x squared times U_(j+1) minus 375 00:28:31,700 --> 00:28:37,700 2*U_j plus U_(j-1). 376 00:28:37,700 --> 00:28:40,410 That's my equation. 377 00:28:40,410 --> 00:28:42,340 My system of equations, sorry. 378 00:28:42,340 --> 00:28:45,140 My system of equations. 379 00:28:45,140 --> 00:28:48,530 For the moment, I'm thinking j goes from minus infinity 380 00:28:48,530 --> 00:28:49,280 to infinity. 381 00:28:49,280 --> 00:28:53,860 I'm not going to put in a boundary, but what I will do, 382 00:28:53,860 --> 00:29:05,150 of course, is try U_j is some growth factor that -- 383 00:29:05,150 --> 00:29:09,160 j is a space, is counting space steps, 384 00:29:09,160 --> 00:29:14,400 so the growth factor is in time and it's continuous in time, 385 00:29:14,400 --> 00:29:22,800 because time's continuous, but it's always e to the i*k*j 386 00:29:22,800 --> 00:29:28,250 delta x. 387 00:29:28,250 --> 00:29:30,070 That's the right thing to plug in. 388 00:29:30,070 --> 00:29:36,870 I mean, I guess what we're -- what I'm really -- 389 00:29:36,870 --> 00:29:42,490 the reason for really doing this is just to reinforce the idea 390 00:29:42,490 --> 00:29:47,410 that trying a pure exponential is a good thing to do. 391 00:29:47,410 --> 00:29:51,270 It's even a good thing to do with variable coefficients 392 00:29:51,270 --> 00:29:54,450 and real problems. 393 00:29:54,450 --> 00:29:59,100 It's absolutely a good thing to do with these model problems. 394 00:29:59,100 --> 00:30:02,970 Plug it in and what happens? 395 00:30:02,970 --> 00:30:07,830 So I get G double prime times the exponential, 396 00:30:07,830 --> 00:30:10,190 but of course you know in advance, 397 00:30:10,190 --> 00:30:12,390 I'm going to cancel that exponential -- 398 00:30:12,390 --> 00:30:18,230 is c squared over delta x squared times -- 399 00:30:18,230 --> 00:30:19,450 what goes there? 400 00:30:19,450 --> 00:30:23,320 What will cancel the exponential -- 401 00:30:23,320 --> 00:30:27,180 so I'm imagining that exponential as far out, 402 00:30:27,180 --> 00:30:29,340 but here it is at j plus 1. 403 00:30:29,340 --> 00:30:35,845 So I've incremented j by 1, so that is going to give me an e 404 00:30:35,845 --> 00:30:39,670 to the i*k delta x, right? 405 00:30:39,670 --> 00:30:44,080 Here I haven't incremented it and here I've incremented it 406 00:30:44,080 --> 00:30:51,180 by minus 1, so that will give me an e to the minus i*k delta x, 407 00:30:51,180 --> 00:30:55,780 all times the same exponential which appeared there 408 00:30:55,780 --> 00:30:58,820 and appeared there and got cancelled. 409 00:30:58,820 --> 00:31:00,870 So that's it there. 410 00:31:00,870 --> 00:31:07,890 G double prime -- oh there's got to be a G -- right, 411 00:31:07,890 --> 00:31:15,924 there's a G. Right. 412 00:31:15,924 --> 00:31:17,590 When I plugged in on the right-hand side 413 00:31:17,590 --> 00:31:21,230 I got a G that was so uninteresting I lost it. 414 00:31:23,890 --> 00:31:28,330 What does -- what's G there? 415 00:31:31,200 --> 00:31:41,660 I guess the main point to see is, this quantity, which is -- 416 00:31:41,660 --> 00:31:48,930 divided by delta x squared, which is coming because we have 417 00:31:48,930 --> 00:31:50,940 differences instead of derivatives. 418 00:31:50,940 --> 00:31:55,790 When we had derivatives, that quantity was c squared i*k 419 00:31:55,790 --> 00:31:56,290 squared. 420 00:31:59,650 --> 00:32:02,560 Or, in other words, minus c squared k squared. 421 00:32:05,230 --> 00:32:18,300 This was the correct factor and this one is the discrete factor 422 00:32:18,300 --> 00:32:21,380 and it's worth just paying a moment of attention 423 00:32:21,380 --> 00:32:23,860 to compare the two. 424 00:32:27,500 --> 00:32:30,320 Where am I going to write that comparison? 425 00:32:30,320 --> 00:32:33,560 I guess that's going to be on the board that's hidden, 426 00:32:33,560 --> 00:32:37,990 so I'm going to -- can you try to remember that? 427 00:32:37,990 --> 00:32:41,830 Let me focus just on this quantity for a minute, or even 428 00:32:41,830 --> 00:32:47,490 just on this one, just because we see it so many times, 429 00:32:47,490 --> 00:32:50,860 because it's coming directly from second differences. 430 00:32:50,860 --> 00:32:53,350 For the moment, let me take k delta x. 431 00:32:53,350 --> 00:32:54,600 I'll just call it theta. 432 00:32:54,600 --> 00:32:56,420 It's some angle. 433 00:32:56,420 --> 00:33:03,180 So can I just do a little bit of trig with this factor? 434 00:33:03,180 --> 00:33:07,890 2 minus 2 cos theta. 435 00:33:07,890 --> 00:33:09,490 Let's see. 436 00:33:09,490 --> 00:33:12,760 I'm going to, I'm going to bring out a minus sign. 437 00:33:12,760 --> 00:33:15,600 So I'm going to put plus signs on those 438 00:33:15,600 --> 00:33:18,500 and minus signs on those. 439 00:33:18,500 --> 00:33:22,100 You see the main point of course, 440 00:33:22,100 --> 00:33:26,990 that e to the plus something, e to the i theta 441 00:33:26,990 --> 00:33:33,370 and e to the minus i theta combine to give 2 cos theta. 442 00:33:33,370 --> 00:33:35,550 Right, so that's the key simplification that's 443 00:33:35,550 --> 00:33:38,260 going to make this much neater. 444 00:33:38,260 --> 00:33:41,000 So I have 2 cos theta minus 2. 445 00:33:41,000 --> 00:33:47,230 I have 2 cos theta minus 2, and if I bring out a minus sign, 446 00:33:47,230 --> 00:33:49,540 I'll have 2 minus 2 cos theta and that's 447 00:33:49,540 --> 00:33:50,670 what I want to write. 448 00:33:50,670 --> 00:33:52,560 I want to write 2 minus 2 cos theta. 449 00:33:59,450 --> 00:34:02,690 I want to see what that expression is. 450 00:34:02,690 --> 00:34:05,325 Right, so that brought out a minus sign just 451 00:34:05,325 --> 00:34:13,430 to match that minus sign and the c squareds match, 452 00:34:13,430 --> 00:34:17,570 but what's different is this k squared is now 453 00:34:17,570 --> 00:34:25,570 gone into this 2 minus 2 cos k delta x I'll write it, 454 00:34:25,570 --> 00:34:29,120 divided by delta x squared. 455 00:34:29,120 --> 00:34:33,710 You see that this is -- that's the change. 456 00:34:33,710 --> 00:34:36,790 k squared, which is a positive quantity 457 00:34:36,790 --> 00:34:41,720 became this, which is also a positive quantity, 2 minus 2 458 00:34:41,720 --> 00:34:46,370 cos theta, but it's not a pure k squared. 459 00:34:46,370 --> 00:34:49,670 We are getting dispersion. 460 00:34:49,670 --> 00:34:54,070 Different frequencies are showing up inside the cosine 461 00:34:54,070 --> 00:34:57,210 and that's not a linear function. 462 00:34:57,210 --> 00:35:01,150 So we're seeing different frequencies 463 00:35:01,150 --> 00:35:10,160 going their own way in a more interesting way then just what 464 00:35:10,160 --> 00:35:12,970 we saw here with k squared. 465 00:35:12,970 --> 00:35:17,580 Of course, when we take the square root, as we did here, 466 00:35:17,580 --> 00:35:24,280 that produced linear in k and no dispersion and something 467 00:35:24,280 --> 00:35:28,200 simple, but here, when we take the square root -- 468 00:35:28,200 --> 00:35:29,954 let's get ready to take the square root. 469 00:35:29,954 --> 00:35:31,620 How can we take the square root of that? 470 00:35:36,100 --> 00:35:37,520 By writing it as a square. 471 00:35:40,200 --> 00:35:44,170 It's never negative, and if I use a little trigonometry -- 472 00:35:44,170 --> 00:35:45,840 so I'm just going to write it down. 473 00:35:45,840 --> 00:35:52,960 This is 4 -- I think it's sine squared of theta over 2. 474 00:35:55,600 --> 00:35:59,170 That's just a handy fact. 475 00:35:59,170 --> 00:36:04,500 It's handy because I can take its square root and really see 476 00:36:04,500 --> 00:36:10,060 what -- so theta -- remember this theta is standing for k 477 00:36:10,060 --> 00:36:12,420 delta x. 478 00:36:12,420 --> 00:36:15,580 So then, I want to divided it by delta x squared. 479 00:36:15,580 --> 00:36:19,290 Can I bring down that quantity just so you see it again? 480 00:36:19,290 --> 00:36:25,130 So this was the 2 minus 2 cos theta with the minus sign, 481 00:36:25,130 --> 00:36:29,470 and dividing by delta x squared and that's -- 482 00:36:29,470 --> 00:36:32,680 so it was G double prime -- let's just write it. 483 00:36:32,680 --> 00:36:37,850 So I have G -- I'm now going to copy what -- 484 00:36:37,850 --> 00:36:42,670 G double prime was a minus sign times the c squared times this 485 00:36:42,670 --> 00:36:52,330 -- 4 sine squared of k delta x on 2 divided by delta x 486 00:36:52,330 --> 00:36:53,490 squared. 487 00:36:53,490 --> 00:36:56,789 Maybe I'll put the delta x squared over there, 488 00:36:56,789 --> 00:36:57,830 where it kind of belongs. 489 00:37:03,970 --> 00:37:16,130 Times G, always forgetting G. So we're 490 00:37:16,130 --> 00:37:19,840 just following the golden way here, 491 00:37:19,840 --> 00:37:23,130 plugging in an exponential and seeing what happens, 492 00:37:23,130 --> 00:37:27,240 and what happens is pretty nice. 493 00:37:27,240 --> 00:37:29,300 We now know what the solutions are. 494 00:37:29,300 --> 00:37:31,000 There'll be two solutions. 495 00:37:31,000 --> 00:37:33,670 It's a linear problem, so the solutions 496 00:37:33,670 --> 00:37:35,730 will be exponential in t. 497 00:37:38,840 --> 00:37:42,080 The solutions will have a plus or minus i, 498 00:37:42,080 --> 00:37:44,280 because it's a minus sign. 499 00:37:44,280 --> 00:37:46,960 So G -- can I write it this way? 500 00:37:46,960 --> 00:37:52,940 G of -- the solution to this, or the two exponential solutions 501 00:37:52,940 --> 00:37:57,930 will be e to the plus or minus -- 502 00:37:57,930 --> 00:38:00,520 now I'm going to take this square root -- 503 00:38:00,520 --> 00:38:06,810 i times c times the square root of this. 504 00:38:06,810 --> 00:38:08,480 Actually, that's not so hard. 505 00:38:08,480 --> 00:38:11,440 2 -- that was our point, wasn't it? 506 00:38:11,440 --> 00:38:18,960 Sorry, I forgot about that -- sine k delta x over 2 divided 507 00:38:18,960 --> 00:38:23,550 by delta x -- and look, here's something nice. 508 00:38:23,550 --> 00:38:25,780 Bring the 2 down there. 509 00:38:28,570 --> 00:38:31,060 Make it 1/2 of the denominator. 510 00:38:31,060 --> 00:38:35,100 Do you see what this expression is? 511 00:38:35,100 --> 00:38:38,920 Actually, do you know its name? 512 00:38:38,920 --> 00:38:42,310 It's the sinc function. 513 00:38:42,310 --> 00:38:45,040 It's the sinc function, right? 514 00:38:45,040 --> 00:38:52,060 And for very small delta x -- oh, times t, right? 515 00:38:52,060 --> 00:38:55,000 It just -- we just have an exponential. 516 00:38:55,000 --> 00:38:56,500 Of course we do. 517 00:38:56,500 --> 00:39:00,410 This was a constant coefficient problem in t, 518 00:39:00,410 --> 00:39:04,940 and a second order, so I had two exponentials, 519 00:39:04,940 --> 00:39:08,290 and I just took the square root of that coefficient, 520 00:39:08,290 --> 00:39:10,410 put it there, times t. 521 00:39:10,410 --> 00:39:11,950 Absolutely straightforward. 522 00:39:16,750 --> 00:39:20,050 This quantity is the key one and this 523 00:39:20,050 --> 00:39:28,970 is the quantity which, for small k or small delta x, 524 00:39:28,970 --> 00:39:32,060 is approximately what? 525 00:39:32,060 --> 00:39:37,165 So if k and delta x are small, or if even just delta x 526 00:39:37,165 --> 00:39:40,560 is small, what does this sinc function look like? 527 00:39:40,560 --> 00:39:48,030 What is that ratio approximately, when k is small? 528 00:39:48,030 --> 00:39:51,400 What does the sine of theta look like when 529 00:39:51,400 --> 00:39:54,280 theta is a small angle? 530 00:39:54,280 --> 00:39:57,460 Looks like theta, right? 531 00:39:57,460 --> 00:40:00,200 Sine theta is about theta. 532 00:40:00,200 --> 00:40:04,070 So this thing is about k delta x over 2 divided by delta -- 533 00:40:04,070 --> 00:40:15,650 it's k, so it's approximately k for small delta x, let's say. 534 00:40:15,650 --> 00:40:18,550 Delta x is small. 535 00:40:18,550 --> 00:40:23,370 That's the key thing to know about the sinc function, 536 00:40:23,370 --> 00:40:27,730 that it begins by approximating the sine function, 537 00:40:27,730 --> 00:40:32,390 but then of course, when k delta x gets large, it wanders away. 538 00:40:32,390 --> 00:40:33,850 It's not linear in k. 539 00:40:33,850 --> 00:40:37,620 See, it starts out practically linear in k, 540 00:40:37,620 --> 00:40:40,480 and that k is exactly the right k. 541 00:40:40,480 --> 00:40:42,220 That's the right factor. 542 00:40:42,220 --> 00:40:43,400 That's the k here. 543 00:40:47,680 --> 00:40:49,280 But in the differential equation, 544 00:40:49,280 --> 00:40:53,930 it stayed k and in the difference equation, 545 00:40:53,930 --> 00:41:02,790 for k delta x moving away, it changes and that's why -- 546 00:41:02,790 --> 00:41:06,380 of course, that's the source of the error. 547 00:41:06,380 --> 00:41:09,790 We're seeing now why the method is probably 548 00:41:09,790 --> 00:41:11,720 second-order accuracy. 549 00:41:11,720 --> 00:41:16,140 We know that these second differences are second -- 550 00:41:16,140 --> 00:41:18,130 give second-order accuracy. 551 00:41:18,130 --> 00:41:21,050 This would be -- if I looked at the next term, 552 00:41:21,050 --> 00:41:23,650 what's the next term in sine theta? 553 00:41:23,650 --> 00:41:26,750 Sine theta starts out theta and then, 554 00:41:26,750 --> 00:41:28,440 what's the term after that? 555 00:41:31,810 --> 00:41:38,480 Everybody's Taylor series or -- [UNINTELLIGIBLE] theta cubed, 556 00:41:38,480 --> 00:41:40,880 it's a theta cubed term. 557 00:41:40,880 --> 00:41:45,490 Exactly, it's a minus theta cubed over 6, three factorial, 558 00:41:45,490 --> 00:41:47,700 but it's a theta cubed term. 559 00:41:47,700 --> 00:41:53,110 And so the theta gave us the right thing 560 00:41:53,110 --> 00:41:55,580 and then two more powers of theta 561 00:41:55,580 --> 00:41:58,070 will give us a second-order error, right? 562 00:42:00,880 --> 00:42:08,600 I better move since -- so that's the story for semidiscrete. 563 00:42:08,600 --> 00:42:12,620 Semidiscrete produced a pure exponential, 564 00:42:12,620 --> 00:42:21,360 but with a phase factor, you could say, 565 00:42:21,360 --> 00:42:23,990 that wasn't linear in k where the real one was. 566 00:42:26,590 --> 00:42:33,350 Now, what about -- let me move up to that board above, 567 00:42:33,350 --> 00:42:38,970 where now we're going to have -- we have it's discrete in time 568 00:42:38,970 --> 00:42:43,394 as well, so we're going to have single steps. 569 00:42:43,394 --> 00:42:44,810 What's going to be the difference? 570 00:42:47,580 --> 00:42:50,530 Again, I'm going to try -- you know, 571 00:42:50,530 --> 00:42:56,920 I only have one idea here -- U_(j, n) will be some G, 572 00:42:56,920 --> 00:43:04,750 some growth factor, times e to the i*j*k delta x. 573 00:43:04,750 --> 00:43:09,740 The same -- I'm going to try an e to the i*k*x, 574 00:43:09,740 --> 00:43:14,830 and in the space variable, it will be G. And after n steps, 575 00:43:14,830 --> 00:43:17,730 it'll be G n times. 576 00:43:17,730 --> 00:43:19,910 So this is the discrete, right? 577 00:43:19,910 --> 00:43:25,400 This is the ansatz, to use a fancy word. 578 00:43:25,400 --> 00:43:26,590 This is what you plug in. 579 00:43:29,550 --> 00:43:31,800 Little crazy to use the word ansatz, which 580 00:43:31,800 --> 00:43:36,110 sounds fancy and the word plug, which is far from fancy. 581 00:43:36,110 --> 00:43:40,460 I should say substitute. 582 00:43:40,460 --> 00:43:41,560 Substitute in it. 583 00:43:41,560 --> 00:43:43,710 All right. 584 00:43:43,710 --> 00:43:46,990 Do we know what the process is going to do? 585 00:43:46,990 --> 00:43:51,900 When I plug it in -- sorry, substitute it in on the left, 586 00:43:51,900 --> 00:43:59,710 we get -- and I'm going to cancel this from every term -- 587 00:43:59,710 --> 00:44:03,090 so all I'm interested in is the -- 588 00:44:03,090 --> 00:44:05,780 maybe I'll cancel G to the n minus 1. 589 00:44:05,780 --> 00:44:08,090 So let me write down what I get. 590 00:44:08,090 --> 00:44:10,580 This is going to give me -- in the time direction, 591 00:44:10,580 --> 00:44:19,080 I'll have a G squared minus a 2G plus a 1 over delta t squared, 592 00:44:19,080 --> 00:44:23,650 and in the space direction, which is at the centered time, 593 00:44:23,650 --> 00:44:28,330 so it's going to multiply a G, it's going to be my same, 594 00:44:28,330 --> 00:44:29,620 my very same thing. 595 00:44:29,620 --> 00:44:33,260 I could maybe give it a name here. 596 00:44:33,260 --> 00:44:35,960 I don't know whether -- should I give it a name? 597 00:44:35,960 --> 00:44:37,770 I know what it is anyway, because it's 598 00:44:37,770 --> 00:44:42,510 the same thing that I had in the semidiscrete method. 599 00:44:42,510 --> 00:44:49,130 It's this -- let's see what it looked like. 600 00:44:49,130 --> 00:44:57,980 At this point, it was -- look, let's do one thing. 601 00:44:57,980 --> 00:45:02,010 Let me get this delta t squared up there times the c squared 602 00:45:02,010 --> 00:45:03,670 divided by the delta x squared. 603 00:45:03,670 --> 00:45:08,810 Let me just clean up those constants, 604 00:45:08,810 --> 00:45:13,250 so that when I multiply up by the delta t squared times 605 00:45:13,250 --> 00:45:18,640 the c squared divided by the delta x squared, what's that? 606 00:45:18,640 --> 00:45:24,030 c delta t over delta x squared is my old ratio, the Courant 607 00:45:24,030 --> 00:45:31,020 number r, squared, and then it's this times G. 608 00:45:31,020 --> 00:45:33,980 So this will all be just exactly the same 609 00:45:33,980 --> 00:45:38,380 and that's what I simplified here. 610 00:45:38,380 --> 00:45:43,030 Let me just leave it as -- with a minus. 611 00:45:43,030 --> 00:45:48,370 Let me remember that I did take a minus so that I could write 612 00:45:48,370 --> 00:45:58,400 it as 2 minus 2 cosine of k delta x times G. Is that -- 613 00:45:58,400 --> 00:46:01,950 I really think I have kept track of everything here. 614 00:46:01,950 --> 00:46:07,640 The r squared coming from all this stuff, the minus 2 615 00:46:07,640 --> 00:46:11,560 coming here and the plus 2 cosine coming from there. 616 00:46:11,560 --> 00:46:12,370 You OK with that? 617 00:46:16,670 --> 00:46:20,510 But there's one new ingredient here. 618 00:46:20,510 --> 00:46:27,240 Again, G to the n -- I cancelled G to the n minus 1 times this 619 00:46:27,240 --> 00:46:30,340 from every term. 620 00:46:30,340 --> 00:46:33,850 So the new ingredient, that we just have five minutes to deal 621 00:46:33,850 --> 00:46:39,530 with, is the fact that we have second -- 622 00:46:39,530 --> 00:46:42,760 G squared just showed up. 623 00:46:42,760 --> 00:46:44,330 So why did G squared show up? 624 00:46:44,330 --> 00:46:52,000 Because it's a multistep method and therefore, 625 00:46:52,000 --> 00:46:53,240 I've got two G's. 626 00:46:53,240 --> 00:46:54,320 Of course. 627 00:46:54,320 --> 00:46:57,690 I had two G's in all these other cases 628 00:46:57,690 --> 00:46:59,440 because I had second derivatives and now I 629 00:46:59,440 --> 00:47:01,160 have second differences. 630 00:47:01,160 --> 00:47:04,180 So I have two G's, so I have to solve for G -- 631 00:47:04,180 --> 00:47:07,220 and what is stability going to depend on? 632 00:47:07,220 --> 00:47:11,760 Stability is going to be whether G -- 633 00:47:11,760 --> 00:47:14,090 both G's, because there are two of them now -- 634 00:47:14,090 --> 00:47:15,750 are less than or equal to 1. 635 00:47:15,750 --> 00:47:18,510 That's what I have to check and that's the equation. 636 00:47:22,490 --> 00:47:24,610 What do we figure? 637 00:47:24,610 --> 00:47:30,160 We figure that if r is pretty big -- if r is big, no way. 638 00:47:30,160 --> 00:47:34,770 If r is big, the Courant test will fail 639 00:47:34,770 --> 00:47:37,040 and stability will fail. 640 00:47:37,040 --> 00:47:40,050 But if r is small, then I expect -- 641 00:47:40,050 --> 00:47:42,590 I have a right to hope for stability. 642 00:47:42,590 --> 00:47:45,500 So it's going to be the size of r. 643 00:47:45,500 --> 00:47:48,370 So I just have to -- I've got this quadratic equation. 644 00:47:48,370 --> 00:47:50,530 I'm going to bring this thing over here. 645 00:47:50,530 --> 00:47:56,520 I'm going to write this as G squared minus 2a*G plus 1 646 00:47:56,520 --> 00:48:01,860 equals 0, where a is this quantity -- So I had minus 2a, 647 00:48:01,860 --> 00:48:08,240 so a is a 1 from there, and when I bring this over to the other 648 00:48:08,240 --> 00:48:13,810 side, it's going to be a plus r squared -- factoring out -- 649 00:48:13,810 --> 00:48:16,000 notice the 2 is everywhere. 650 00:48:16,000 --> 00:48:19,190 So I put the 2 here. 651 00:48:19,190 --> 00:48:23,460 The a comes from the 1 there and from this times 652 00:48:23,460 --> 00:48:30,670 the r squared 1 plus r squared minus r squared cos k delta x. 653 00:48:39,380 --> 00:48:45,560 I'm just doing algebra and it's coming out nicely. 654 00:48:45,560 --> 00:48:47,510 It's coming out to a nice equation 655 00:48:47,510 --> 00:48:51,080 here with a slightly messy expression for a, 656 00:48:51,080 --> 00:48:57,730 but now that I've named this quantity a, I can solve this. 657 00:48:57,730 --> 00:48:59,120 So what's the solution? 658 00:48:59,120 --> 00:49:07,430 I remember the quadratic formula and I get G as 1, I think, 659 00:49:07,430 --> 00:49:13,450 plus or minus the square root of 1 minus a squared. 660 00:49:16,010 --> 00:49:24,280 That's G. Oh, maybe this is an a; probably is. 661 00:49:24,280 --> 00:49:31,450 I guess the quadratic equation takes a little memorizing, 662 00:49:31,450 --> 00:49:34,780 but I guess the first point is that that coefficient shows 663 00:49:34,780 --> 00:49:38,940 up there and then the square root that we know. 664 00:49:41,550 --> 00:49:42,380 So what's up? 665 00:49:47,440 --> 00:49:50,030 Again, none of this is deep. 666 00:49:50,030 --> 00:49:56,330 I'm just following my one-way path. 667 00:49:56,330 --> 00:49:58,290 Check stability. 668 00:49:58,290 --> 00:50:02,140 Check the size of G. Get an equation for G. 669 00:50:02,140 --> 00:50:06,970 Get a formula for G and look at it. 670 00:50:06,970 --> 00:50:12,010 So a is some positive number and the key 671 00:50:12,010 --> 00:50:15,790 is going to be whether a is bigger than 1 672 00:50:15,790 --> 00:50:17,950 or smaller than 1. 673 00:50:17,950 --> 00:50:25,160 If a is -- is that right, 1 minus a squared or should that 674 00:50:25,160 --> 00:50:28,760 be a squared minus 1? 675 00:50:28,760 --> 00:50:30,150 Is it a squared minus 1? 676 00:50:32,780 --> 00:50:36,080 Professors are not responsible for the quadratic formula 677 00:50:36,080 --> 00:50:41,450 because we proved that we could do it in third grade 678 00:50:41,450 --> 00:50:44,110 and lost it since. 679 00:50:44,110 --> 00:50:46,370 I guess it's right. 680 00:50:46,370 --> 00:50:49,050 Is that right? 681 00:50:49,050 --> 00:50:52,150 Because look, here's the story. 682 00:50:52,150 --> 00:50:55,350 Suppose a is bigger than 1. 683 00:50:55,350 --> 00:50:59,440 Suppose -- I'm really looking at the roots of this equation. 684 00:50:59,440 --> 00:51:01,810 Notice, by the way, the roots of that equation 685 00:51:01,810 --> 00:51:04,020 multiply to give 1. 686 00:51:04,020 --> 00:51:07,240 So I'm on the edge here. 687 00:51:07,240 --> 00:51:14,220 Either both roots have size 1 or one of those roots is too big. 688 00:51:14,220 --> 00:51:17,650 The test is going to be, is a greater than 1? a greater 689 00:51:17,650 --> 00:51:28,020 than 1 will be unstable. a less than 1 will be stable 690 00:51:28,020 --> 00:51:35,420 and I'll connect a less than 1 to r less than 1. 691 00:51:35,420 --> 00:51:39,330 That will give me r less than 1. 692 00:51:39,330 --> 00:51:39,830 All right. 693 00:51:39,830 --> 00:51:44,990 I've given away the result because time is pressing. 694 00:51:44,990 --> 00:51:49,760 Let me just take the remaining time to see this. 695 00:51:49,760 --> 00:51:53,300 Suppose a is bigger than 1. 696 00:51:53,300 --> 00:51:55,520 I'm just looking at the roots of this equation 697 00:51:55,520 --> 00:51:56,820 and here they are. 698 00:51:56,820 --> 00:52:03,190 If a is bigger than 1, like 2, I have 2 plus square root of 3, 699 00:52:03,190 --> 00:52:05,470 I'm way up, right? 700 00:52:05,470 --> 00:52:07,990 I'm bigger than 1, no question. 701 00:52:07,990 --> 00:52:11,550 Suppose a is less than 1. 702 00:52:11,550 --> 00:52:14,420 Suppose a is 1/2. 703 00:52:14,420 --> 00:52:19,880 Then I have 1/2 plus or minus the square root of -- what? 704 00:52:19,880 --> 00:52:21,280 What's up here? 705 00:52:21,280 --> 00:52:28,440 If a is smaller than 1, this is negative and if it's negative, 706 00:52:28,440 --> 00:52:31,800 its square root is imaginary. 707 00:52:31,800 --> 00:52:33,510 So this is good. 708 00:52:33,510 --> 00:52:39,200 I have a real part and then an imaginary part 709 00:52:39,200 --> 00:52:43,070 and then on some magic little bit of board, 710 00:52:43,070 --> 00:52:44,650 I'm going to add their squares. 711 00:52:44,650 --> 00:52:50,240 So I just want to take the real parts squared and the imaginary 712 00:52:50,240 --> 00:52:54,230 part squared -- now the imaginary part is going to be 1 713 00:52:54,230 --> 00:53:00,090 minus a squared because when I bring out an i, 714 00:53:00,090 --> 00:53:04,310 then I have a 1 minus a squared there and when I add them, 715 00:53:04,310 --> 00:53:06,850 I get 1. 716 00:53:06,850 --> 00:53:09,810 So let me just say again what it is. 717 00:53:09,810 --> 00:53:11,880 I just figured out what is absolute value 718 00:53:11,880 --> 00:53:16,010 of G squared as real part squared 719 00:53:16,010 --> 00:53:19,420 and imaginary part squared and I got the answer 1. 720 00:53:19,420 --> 00:53:25,620 So the conclusion is, the roots are stable when a is below 1 721 00:53:25,620 --> 00:53:30,120 and I have instability when a is above 1. 722 00:53:30,120 --> 00:53:34,620 Then if I track that down, that reduces to the tests -- 723 00:53:34,620 --> 00:53:37,700 it just happens to be the same test on r, 724 00:53:37,700 --> 00:53:41,810 whether r is below 1, which is the Courant-Friedrichs-Lewy 725 00:53:41,810 --> 00:53:46,120 condition, that I'm staying inside the characteristics, 726 00:53:46,120 --> 00:53:50,920 or r is bigger than 1 and I'm taking a delta t that 727 00:53:50,920 --> 00:53:53,540 isn't stable. 728 00:53:53,540 --> 00:53:56,530 I'm sorry to go slightly over the time. 729 00:53:56,530 --> 00:53:58,240 Thanks for staying with me. 730 00:53:58,240 --> 00:54:03,130 I'll begin next time with this staggered grid. 731 00:54:03,130 --> 00:54:05,470 That won't take the whole lecture, 732 00:54:05,470 --> 00:54:10,680 but it's worth knowing because we see staggered grids in many 733 00:54:10,680 --> 00:54:13,210 of the best methods. 734 00:54:13,210 --> 00:54:13,760 Thanks. 735 00:54:13,760 --> 00:54:17,510 Have a good weekend and I guess it's Tuesday rather than Monday 736 00:54:17,510 --> 00:54:19,940 that I see you next.