1 00:00:00,000 --> 00:00:01,470 NARRATOR: The following content is 2 00:00:01,470 --> 00:00:04,966 provided by MIT OpenCourseWare under a Creative Commons 3 00:00:04,966 --> 00:00:06,060 license. 4 00:00:06,060 --> 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,430 is available at ocw.mit.edu. 7 00:00:14,430 --> 00:00:19,220 PROFESSOR: Ready to go. 8 00:00:19,220 --> 00:00:23,290 So first of all, to say thank you to several people 9 00:00:23,290 --> 00:00:31,820 in the class who sent codes to find these wavefronts when 10 00:00:31,820 --> 00:00:39,230 a shock, a step function is moving along with velocity c. 11 00:00:39,230 --> 00:00:45,410 I had roughly drawn what these three methods produced, 12 00:00:45,410 --> 00:00:49,830 but it was much better to see it in Mr. Sekora's movie that's 13 00:00:49,830 --> 00:00:53,150 on 18.086 site. 14 00:00:53,150 --> 00:01:02,340 And sure enough, behind the moving front is an overshoot, 15 00:01:02,340 --> 00:01:06,860 that reminds us of the Gibbs phenomenon, from Lax-Wendroff, 16 00:01:06,860 --> 00:01:11,220 and I think it's sort of unavoidable if we have 17 00:01:11,220 --> 00:01:15,360 a negative -- because one of the three coefficients 18 00:01:15,360 --> 00:01:18,290 at the previous time is negative for Lax-Wendroff, 19 00:01:18,290 --> 00:01:21,170 that's how it gets its second order accuracy, 20 00:01:21,170 --> 00:01:24,160 and we see that better accuracy in a much steeper, 21 00:01:24,160 --> 00:01:26,580 much steeper profile. 22 00:01:26,580 --> 00:01:29,600 Then Lax-Friedrichs, if you've noticed, 23 00:01:29,600 --> 00:01:35,830 has a sort of jagged profile. 24 00:01:35,830 --> 00:01:38,600 Maybe you've realized why that would be. 25 00:01:38,600 --> 00:01:45,430 Somehow Lax-Friedrichs kind of operates on a staggered grid. 26 00:01:45,430 --> 00:01:49,140 We'll see, actually with -- I've drawn a staggered grid here, 27 00:01:49,140 --> 00:01:50,770 so I can say what I mean. 28 00:01:50,770 --> 00:01:54,350 Lax-Friedrichs computes this value 29 00:01:54,350 --> 00:01:59,770 from the two earlier values there and then 30 00:01:59,770 --> 00:02:01,900 at the next level again and so forth, 31 00:02:01,900 --> 00:02:09,690 so that actually, Lax-Friedrichs is using two staggered grids 32 00:02:09,690 --> 00:02:11,350 separately. 33 00:02:11,350 --> 00:02:16,460 I think -- normally, with Lax-Friedrichs, 34 00:02:16,460 --> 00:02:19,440 we call that n plus 1 and n plus 2 and n plus 3, 35 00:02:19,440 --> 00:02:23,350 but the picture is still right, so I think that's probably 36 00:02:23,350 --> 00:02:30,440 responsible for what you see, that there's two waves, 37 00:02:30,440 --> 00:02:36,360 two fronts, right, one delta x away from each other. 38 00:02:36,360 --> 00:02:40,070 And finally, upwind is also smeared out. 39 00:02:40,070 --> 00:02:46,680 I guess I was so pleased to see these actually showing 40 00:02:46,680 --> 00:02:51,670 on the website and that makes me think of more questions. 41 00:02:51,670 --> 00:02:54,670 Maybe you too. 42 00:02:54,670 --> 00:03:00,230 First of all, as time goes forward, 43 00:03:00,230 --> 00:03:03,500 we see this bump beginning to appear. 44 00:03:03,500 --> 00:03:06,970 So am I right in thinking that it reaches a certain height 45 00:03:06,970 --> 00:03:08,790 and stays there? 46 00:03:08,790 --> 00:03:13,170 So I guess I'm thinking about sort of further questions, 47 00:03:13,170 --> 00:03:15,820 because every time you do a numerical experiment, 48 00:03:15,820 --> 00:03:19,150 good additional question show up. 49 00:03:19,150 --> 00:03:23,990 So I'm wondering, as this wavefront forms, 50 00:03:23,990 --> 00:03:28,750 this characteristic profile for these three methods, 51 00:03:28,750 --> 00:03:31,900 first of all, does that profile settle down 52 00:03:31,900 --> 00:03:34,610 to a steady profile? 53 00:03:34,610 --> 00:03:37,110 Ultimately it'd be great to be able to predict 54 00:03:37,110 --> 00:03:40,330 what it would be. 55 00:03:40,330 --> 00:03:43,300 In particular, does that bump reach a certain height? 56 00:03:43,300 --> 00:03:45,770 Because you can see it just barely forming and then 57 00:03:45,770 --> 00:03:48,650 you see it growing to a certain point. 58 00:03:48,650 --> 00:03:52,200 And then, when the movie ends, fortunately it 59 00:03:52,200 --> 00:03:55,210 plots this picture and you really see the profile, 60 00:03:55,210 --> 00:03:57,420 and you can actually see, if you look closely, 61 00:03:57,420 --> 00:04:02,460 that it goes above 1 again and probably more. 62 00:04:05,630 --> 00:04:10,580 That would be, does it approach a steady profile? 63 00:04:10,580 --> 00:04:14,530 Does that height settle down? 64 00:04:14,530 --> 00:04:18,170 It'd be fantastic to be able to predict that height. 65 00:04:18,170 --> 00:04:20,540 For example, you always want to know, how do things 66 00:04:20,540 --> 00:04:22,780 depend on the parameter? 67 00:04:22,780 --> 00:04:26,510 The one parameter we have in this problem is r -- 68 00:04:26,510 --> 00:04:28,240 c delta t over delta x. 69 00:04:28,240 --> 00:04:32,180 If I change r, I'm changing all the coefficients. 70 00:04:32,180 --> 00:04:36,790 If I changed r to be exactly 1, then the profile 71 00:04:36,790 --> 00:04:38,500 would be perfect, right? 72 00:04:38,500 --> 00:04:43,370 That's the golden ratio, r equal 1. 73 00:04:43,370 --> 00:04:48,280 I would be computing that value exactly from this value, 74 00:04:48,280 --> 00:04:51,400 at exactly the right slope, on the characteristic, 75 00:04:51,400 --> 00:04:54,330 and perfection. 76 00:04:54,330 --> 00:04:57,600 Now as r goes away from 1, I presume -- 77 00:04:57,600 --> 00:04:58,980 it goes down below 1. 78 00:04:58,980 --> 00:05:02,620 Of course, if it goes above 1, catastrophe. 79 00:05:02,620 --> 00:05:08,140 If it goes below 1, I presume the bump begins to appear, 80 00:05:08,140 --> 00:05:09,890 goes higher. 81 00:05:09,890 --> 00:05:11,530 I don't know. 82 00:05:11,530 --> 00:05:16,130 Could you see how the dependence on r appears? 83 00:05:16,130 --> 00:05:23,030 And then I can even suggest one more thing, which is -- 84 00:05:23,030 --> 00:05:31,910 let's put a fourth guy onto this picture, 85 00:05:31,910 --> 00:05:33,850 which would be leapfrog. 86 00:05:33,850 --> 00:05:36,350 Leapfrog for first-order equations, 87 00:05:36,350 --> 00:05:40,210 so let me just put down below what that would be. 88 00:05:40,210 --> 00:05:44,110 So it would be on that kind of a staggered grid. 89 00:05:44,110 --> 00:05:46,800 A new value at time n plus 1 would 90 00:05:46,800 --> 00:05:51,650 come from these at time n, really, and this one, at time n 91 00:05:51,650 --> 00:05:52,370 minus 1. 92 00:05:52,370 --> 00:05:55,900 So leapfrog -- you'd think of it right away. 93 00:05:55,900 --> 00:06:04,070 I use a centered difference in time, U_(j, n+1) minus U_(j, 94 00:06:04,070 --> 00:06:09,850 n-1) over 2 delta t equals c times a centered difference 95 00:06:09,850 --> 00:06:20,510 in space, U_(j+1, n) minus U_(j-1, n) over 2 delta x. 96 00:06:20,510 --> 00:06:24,680 So you see right away, the 2's cancel. 97 00:06:24,680 --> 00:06:29,325 The delta x times c -- the delta t times c over delta x is 98 00:06:29,325 --> 00:06:36,110 our old ratio r, so this is easily written in terms of r 99 00:06:36,110 --> 00:06:37,300 again. 100 00:06:37,300 --> 00:06:44,140 It does have this two time step issue 101 00:06:44,140 --> 00:06:47,030 and of course, we have to think about stability. 102 00:06:47,030 --> 00:06:53,960 I'm writing down a fourth candidate for the equation u_t 103 00:06:53,960 --> 00:06:59,990 equals c*u_x, of course, before I come back to the second-order 104 00:06:59,990 --> 00:07:03,020 equations, or systems. 105 00:07:03,020 --> 00:07:05,220 I just wanted to put in these comments, 106 00:07:05,220 --> 00:07:11,500 partly because I'm thinking about projects that are -- 107 00:07:11,500 --> 00:07:20,120 and I hope you are -- so some people will have theses 108 00:07:20,120 --> 00:07:28,030 or problems from other courses which involve solving PDEs 109 00:07:28,030 --> 00:07:36,050 and that'd be perfectly natural to base some project 110 00:07:36,050 --> 00:07:42,720 on, but if you don't have some specific application, 111 00:07:42,720 --> 00:07:47,660 then here are a whole lot of interesting questions, 112 00:07:47,660 --> 00:07:49,790 to just go further with that. 113 00:07:49,790 --> 00:07:59,150 So the dependence on r would be a -- 114 00:07:59,150 --> 00:08:08,700 the profile dependence on r, c delta t over delta x, 115 00:08:08,700 --> 00:08:09,650 would be a question. 116 00:08:14,710 --> 00:08:18,240 Let me just emphasize, what's the goal? 117 00:08:18,240 --> 00:08:21,330 When I say that this upwind one is smeared out, 118 00:08:21,330 --> 00:08:26,190 I mean that it doesn't satisfy what you really hope for. 119 00:08:26,190 --> 00:08:31,860 You want to capture that shock, that discontinuity -- 120 00:08:31,860 --> 00:08:34,710 not perfectly, you can't expect that -- 121 00:08:34,710 --> 00:08:39,980 but you want to capture it, maybe in, let's say, 2 delta x. 122 00:08:39,980 --> 00:08:43,510 A good method captures the shock within 2 delta x 123 00:08:43,510 --> 00:08:50,960 and does it without much undesirable oscillation, 124 00:08:50,960 --> 00:08:54,250 physical oscillation like that. 125 00:08:54,250 --> 00:08:58,870 So these are methods where we're trading off a good shock 126 00:08:58,870 --> 00:09:03,400 capture versus a smeared one, which is not satisfactory, 127 00:09:03,400 --> 00:09:07,650 really, in a lot of applications. 128 00:09:07,650 --> 00:09:12,060 So capturing the shock within 2 delta 129 00:09:12,060 --> 00:09:19,200 x, roughly, is highly desirable, and you 130 00:09:19,200 --> 00:09:24,290 might have to go add a artificial viscosity that we'll 131 00:09:24,290 --> 00:09:28,300 discuss to get there. 132 00:09:28,300 --> 00:09:33,120 So that's past things, but still very much present, 133 00:09:33,120 --> 00:09:34,340 if I can say. 134 00:09:34,340 --> 00:09:38,720 Here I've introduced a new leapfrog, 135 00:09:38,720 --> 00:09:42,450 a one-way equation leapfrog, I'll 136 00:09:42,450 --> 00:09:50,230 call this, where the last lecture was 137 00:09:50,230 --> 00:09:52,520 about two-way leapfrog. 138 00:09:52,520 --> 00:09:56,040 Leapfrog for u_tt equals c squared 139 00:09:56,040 --> 00:09:58,510 u_xx, a two-way wave equation. 140 00:09:58,510 --> 00:10:04,480 I might just mention about this one-way leapfrog, 141 00:10:04,480 --> 00:10:10,170 once you put in e to the i*k*x as we always do, 142 00:10:10,170 --> 00:10:17,240 or e to the i*k*j delta x in the discrete case -- 143 00:10:17,240 --> 00:10:27,100 so you would put in an e to the i*j delta x times k, 144 00:10:27,100 --> 00:10:33,560 and then find the G, the growth factor in -- 145 00:10:33,560 --> 00:10:39,040 that'll depend on k and will tell us the time dependence. 146 00:10:39,040 --> 00:10:40,550 It'll be a G to the n-th. 147 00:10:43,330 --> 00:10:48,790 I think you'll find that for this guy, 148 00:10:48,790 --> 00:10:53,440 the absolute value of G is exactly 1 while it's stable. 149 00:10:53,440 --> 00:10:57,130 Of course, if the Courant condition is violated, 150 00:10:57,130 --> 00:10:59,670 then there's no way it could be stable 151 00:10:59,670 --> 00:11:04,010 and G's will grow, be bigger than 1. 152 00:11:04,010 --> 00:11:10,040 But, I think in the stable range, you will have -- 153 00:11:10,040 --> 00:11:13,290 this G will have absolute value exactly 1. 154 00:11:16,960 --> 00:11:18,620 So it'll be on the unit circle. 155 00:11:18,620 --> 00:11:23,390 You don't have much leeway, right? 156 00:11:23,390 --> 00:11:28,920 We found upwind was, like, well inside; 157 00:11:28,920 --> 00:11:32,840 Lax-Friedrichs was well inside; Lax-Wendroff, 158 00:11:32,840 --> 00:11:38,240 because it had higher accuracy for low frequencies, 159 00:11:38,240 --> 00:11:44,210 was closer; and I think this guy is right on. 160 00:11:44,210 --> 00:11:48,170 So this is the first-order methods. 161 00:11:48,170 --> 00:11:50,220 This would be Lax-Wendroff and this would 162 00:11:50,220 --> 00:11:53,150 be this second-order method. 163 00:11:53,150 --> 00:11:56,710 So you're really playing with fire there 164 00:11:56,710 --> 00:12:00,630 and maybe this is not a favorite, just 165 00:12:00,630 --> 00:12:04,920 because it's too close to the edge, in fact, right 166 00:12:04,920 --> 00:12:06,530 on the edge. 167 00:12:06,530 --> 00:12:10,960 So those are some comments really generated 168 00:12:10,960 --> 00:12:17,890 by your numerical experiments and I think that's the way this 169 00:12:17,890 --> 00:12:23,490 course should -- homeworks and projects should develop out 170 00:12:23,490 --> 00:12:26,740 of numerical experiment. 171 00:12:26,740 --> 00:12:31,730 Now I'll come back to complete my lecture 172 00:12:31,730 --> 00:12:34,110 on the second-order wave equation. 173 00:12:37,260 --> 00:12:43,110 So we studied leapfrog for that. 174 00:12:43,110 --> 00:12:47,000 I won't repeat that, but then with second-order wave 175 00:12:47,000 --> 00:12:49,730 equation, we have another option, 176 00:12:49,730 --> 00:12:56,080 which is to reduce a second-order equation with two 177 00:12:56,080 --> 00:13:01,260 time derivatives to a system of two equations that are 178 00:13:01,260 --> 00:13:05,570 first order in time and space. 179 00:13:05,570 --> 00:13:12,310 I've chosen to use the letters H and E as a kind of hint 180 00:13:12,310 --> 00:13:17,350 that we're touching a really big application, which 181 00:13:17,350 --> 00:13:20,430 is electromagnetism. 182 00:13:20,430 --> 00:13:26,370 So E for the electric field, H for the magnetic field but here 183 00:13:26,370 --> 00:13:35,400 in 1-D -- so it allows me just to mention that in 3-D, 184 00:13:35,400 --> 00:13:39,160 when E has three components, H has three components, 185 00:13:39,160 --> 00:13:45,310 this is really the curl and this is really minus the curl. 186 00:13:45,310 --> 00:13:56,920 And the notes will show the beautiful Yee mesh, 187 00:13:56,920 --> 00:14:05,790 staggered mesh that copies for finite difference methods, 188 00:14:05,790 --> 00:14:11,700 the properties of the curl, our interpretation 189 00:14:11,700 --> 00:14:16,210 of and the properties of -- that Maxwell discovered the physics 190 00:14:16,210 --> 00:14:23,099 of, you know, current, magnetic fields going around a wire that 191 00:14:23,099 --> 00:14:24,890 along which one an electric field is going. 192 00:14:28,200 --> 00:14:31,670 But let me stay here with one dimension. 193 00:14:31,670 --> 00:14:37,180 So first of all, can we recover the wave equation from that? 194 00:14:37,180 --> 00:14:41,070 Let's just see that we haven't left behind the wave equation. 195 00:14:45,190 --> 00:14:48,810 So I just take the second derivative -- 196 00:14:48,810 --> 00:14:51,820 so the second derivative -- I just want to recover the wave 197 00:14:51,820 --> 00:14:56,360 equation so that I haven't lost it here -- so this will be, 198 00:14:56,360 --> 00:14:58,810 if I -- I'm taking the time derivative of the first 199 00:14:58,810 --> 00:15:07,220 equation, so I get d second h dt dx, right? 200 00:15:07,220 --> 00:15:13,730 But by the useful, extremely useful fact that this is 201 00:15:13,730 --> 00:15:20,060 the same as taking the t derivative first and the x 202 00:15:20,060 --> 00:15:24,860 derivative second, now I have the x derivative of this 203 00:15:24,860 --> 00:15:32,240 equation, so this is c -- now I have the x derivative, 204 00:15:32,240 --> 00:15:35,310 or c times it, so now I'm up to c squared, 205 00:15:35,310 --> 00:15:39,920 the x derivative of the x derivative, right? 206 00:15:43,310 --> 00:15:49,246 So we eliminated H, got back to one equation, second order, 207 00:15:49,246 --> 00:15:50,370 and it's the wave equation. 208 00:15:53,660 --> 00:15:58,560 I want to show the same thing now for finite differences. 209 00:15:58,560 --> 00:16:05,060 It's just -- it's such a simple and useful device and our point 210 00:16:05,060 --> 00:16:09,610 will be that it works for -- just as well for differences. 211 00:16:09,610 --> 00:16:14,980 That allows us to do this staggered grid idea. 212 00:16:14,980 --> 00:16:21,480 So the staggered grid idea is, I'll do E on this grid, 213 00:16:21,480 --> 00:16:26,170 at these grid points, H at the half points, 214 00:16:26,170 --> 00:16:32,750 E again at the integer points, H again at the half points. 215 00:16:32,750 --> 00:16:41,790 Now, so my difference method, leapfrog, 216 00:16:41,790 --> 00:16:46,390 on this staggered mesh, will copy -- 217 00:16:46,390 --> 00:16:54,900 so the first equation will give E at the new time from 218 00:16:54,900 --> 00:16:59,770 the difference in H at this time. 219 00:16:59,770 --> 00:17:02,250 So, you see it. 220 00:17:02,250 --> 00:17:08,810 dE/dt is going to be replaced by that time difference. 221 00:17:08,810 --> 00:17:14,180 dH/dx is going to be replaced by this space difference, 222 00:17:14,180 --> 00:17:16,420 and that will determine E at the new time. 223 00:17:16,420 --> 00:17:21,280 So I need time 0 and time 1/2 to get started. 224 00:17:21,280 --> 00:17:23,610 Maybe I put those down here, somewhere. 225 00:17:23,610 --> 00:17:26,330 I have to use the initial condition, 226 00:17:26,330 --> 00:17:33,710 the initial velocity to get started on E and H 227 00:17:33,710 --> 00:17:35,990 and then I go onwards. 228 00:17:35,990 --> 00:17:38,470 I've got to this point and this point. 229 00:17:38,470 --> 00:17:43,230 Then this guy comes from this one, this one and this one. 230 00:17:46,520 --> 00:17:52,410 Of course, that similarly comes from the same equation 231 00:17:52,410 --> 00:17:55,810 shifted over. 232 00:17:55,810 --> 00:17:56,980 Now I know these. 233 00:17:56,980 --> 00:17:59,540 Now I'm ready for this one. 234 00:17:59,540 --> 00:18:03,150 Coming from -- what am I approximating now? 235 00:18:03,150 --> 00:18:09,270 I'm on the staggered part of the grid, the half steps. 236 00:18:09,270 --> 00:18:14,220 I'm approximating this on the half steps, where H is defined. 237 00:18:14,220 --> 00:18:18,990 So that minus that is the time difference. 238 00:18:18,990 --> 00:18:23,380 This minus this -- which, I know these now -- 239 00:18:23,380 --> 00:18:26,190 is the space difference in this equation, 240 00:18:26,190 --> 00:18:30,060 and that's what allows me to compute the new one. 241 00:18:30,060 --> 00:18:33,940 You see, it's a simple idea. 242 00:18:33,940 --> 00:18:41,710 It's close but different from my scalar 243 00:18:41,710 --> 00:18:44,580 leapfrog, one-way leapfrog here. 244 00:18:44,580 --> 00:18:49,140 Here it was the same U at all the points. 245 00:18:49,140 --> 00:18:56,400 Here it is E at the integer time levels and H at the half 246 00:18:56,400 --> 00:18:59,700 integer time levels. 247 00:18:59,700 --> 00:19:03,630 It's natural to say -- I'm calling this leapfrog. 248 00:19:06,990 --> 00:19:12,180 Could I do this for the difference equation? 249 00:19:12,180 --> 00:19:17,760 I just want to see that if I eliminate H -- 250 00:19:17,760 --> 00:19:19,750 you saw what happened there. 251 00:19:19,750 --> 00:19:24,640 By using the identity that the second derivative in t and x 252 00:19:24,640 --> 00:19:28,640 is always the same as the second derivative in x and t, 253 00:19:28,640 --> 00:19:32,730 I eliminated H and got an equation that involved E only. 254 00:19:36,550 --> 00:19:44,030 What's going to be the corresponding identity? 255 00:19:44,030 --> 00:19:47,630 Trivial, but just -- trivial things are not bad things 256 00:19:47,630 --> 00:19:51,820 to notice -- for the different method. 257 00:19:54,760 --> 00:19:58,570 This is what I wanted to be sure of, for the H part. 258 00:19:58,570 --> 00:20:05,460 This H -- so the H were -- do you mind if I draw yet another 259 00:20:05,460 --> 00:20:06,650 symbol? 260 00:20:06,650 --> 00:20:11,840 I want to use this idea to eliminate H. So 261 00:20:11,840 --> 00:20:15,270 let me put two H's there. 262 00:20:15,270 --> 00:20:16,700 Is that right? 263 00:20:16,700 --> 00:20:18,020 Yeah. 264 00:20:18,020 --> 00:20:25,000 I think what I'd like to know -- let me just say what I believe. 265 00:20:25,000 --> 00:20:31,090 I believe that the time difference of the space 266 00:20:31,090 --> 00:20:35,990 difference of H at mesh points is 267 00:20:35,990 --> 00:20:44,490 equal to the space difference of the time difference of H 268 00:20:44,490 --> 00:20:45,560 at the same mesh points. 269 00:20:45,560 --> 00:20:47,370 I meant to put these as subscripts. 270 00:20:51,290 --> 00:20:52,670 It's not delta x. 271 00:20:52,670 --> 00:20:57,180 It's delta sub x. 272 00:20:57,180 --> 00:21:01,130 Difference in the time direction, difference 273 00:21:01,130 --> 00:21:02,950 in the space direction. 274 00:21:02,950 --> 00:21:05,520 Let's just see what this means. 275 00:21:05,520 --> 00:21:08,870 Let me redraw these four points. 276 00:21:08,870 --> 00:21:13,140 These are H. H at all those points. 277 00:21:13,140 --> 00:21:19,480 So this says, figure out the space differences -- so this, 278 00:21:19,480 --> 00:21:22,920 this minus this and this minus this -- 279 00:21:22,920 --> 00:21:27,790 and then take the time difference of those. 280 00:21:27,790 --> 00:21:30,470 Can I see what I'll get if I do that? 281 00:21:30,470 --> 00:21:33,890 So this means I take the space differences, 282 00:21:33,890 --> 00:21:39,190 so I have 1 minus 1 and that would be 1 minus 1, 283 00:21:39,190 --> 00:21:42,870 but now I'm going to take the time difference of those. 284 00:21:42,870 --> 00:21:45,340 So that'll be this one minus this one 285 00:21:45,340 --> 00:21:48,610 and this one plus this one. 286 00:21:48,610 --> 00:21:51,630 Do you see that? 287 00:21:51,630 --> 00:21:58,490 What we have here is H at this point minus H 288 00:21:58,490 --> 00:22:00,740 at this point minus H at this point 289 00:22:00,740 --> 00:22:05,740 plus H at this point plus 1. 290 00:22:05,740 --> 00:22:09,170 I claim that we have the same thing here, 291 00:22:09,170 --> 00:22:12,640 that if I take the time differences first -- 292 00:22:12,640 --> 00:22:14,020 can I do that? 293 00:22:14,020 --> 00:22:16,340 Instead of taking the space differences first, 294 00:22:16,340 --> 00:22:19,740 I'll take this one, this time difference, 295 00:22:19,740 --> 00:22:23,780 this minus this and I'll subtract -- 296 00:22:23,780 --> 00:22:27,510 I'm taking now the space difference -- I'll subtract -- 297 00:22:27,510 --> 00:22:32,160 are you with me? 298 00:22:32,160 --> 00:22:35,960 You see, it's just the same four values -- 299 00:22:35,960 --> 00:22:42,840 two 1's and two minus 1's, whether we go first -- in fact, 300 00:22:42,840 --> 00:22:46,640 this actually is a -- I think maybe throws a little light 301 00:22:46,640 --> 00:22:56,740 on the calculus identity, that we can exchange the order 302 00:22:56,740 --> 00:23:00,820 of the derivatives, because we know we can exchange the order 303 00:23:00,820 --> 00:23:04,120 of the differences, because we just got numbers like 1, 304 00:23:04,120 --> 00:23:09,190 minus 1, minus 1, and plus 1. 305 00:23:12,940 --> 00:23:19,180 If we let the spacing, the mesh, go to 0, this -- 306 00:23:19,180 --> 00:23:24,960 and divided by the delta x and the delta t, 307 00:23:24,960 --> 00:23:31,840 I suppose we would prove the continuous case. 308 00:23:31,840 --> 00:23:36,030 So in a way, this throws light on something that's probably 309 00:23:36,030 --> 00:23:38,110 something that we take for granted, 310 00:23:38,110 --> 00:23:43,010 but we wouldn't want to be pressed on too closely. 311 00:23:46,360 --> 00:23:51,880 So having that identity allows me 312 00:23:51,880 --> 00:23:57,000 to do exactly what I did with the continuous case there 313 00:23:57,000 --> 00:24:03,270 and show that this, when I eliminate the half levels, 314 00:24:03,270 --> 00:24:08,030 I've got ordinary leapfrog. 315 00:24:08,030 --> 00:24:11,670 So when I eliminate half levels, I will be -- 316 00:24:11,670 --> 00:24:15,310 when I eliminate this half level, let's say, 317 00:24:15,310 --> 00:24:20,320 then I'll be connecting -- when I eliminate half levels, 318 00:24:20,320 --> 00:24:25,020 I'm going to be connecting these at three levels -- one, two, 319 00:24:25,020 --> 00:24:28,310 three. 320 00:24:28,310 --> 00:24:30,790 It'll be leapfrog. 321 00:24:30,790 --> 00:24:37,890 So since it's been a few days since we wrote down 322 00:24:37,890 --> 00:24:44,220 two-way leapfrog or second-order equation leapfrog, let me just 323 00:24:44,220 --> 00:24:47,410 write it again, and that's what we would get. 324 00:24:47,410 --> 00:24:55,100 The time difference squared of E will 325 00:24:55,100 --> 00:25:01,250 be equal to c squared times the space difference squared of E. 326 00:25:01,250 --> 00:25:05,070 And of course, here we have a delta x squared 327 00:25:05,070 --> 00:25:08,760 and here a delta t squared. 328 00:25:08,760 --> 00:25:11,120 So altogether, an r squared. 329 00:25:11,120 --> 00:25:13,540 That's the formula we know. 330 00:25:13,540 --> 00:25:14,740 That's the formula we know. 331 00:25:19,320 --> 00:25:25,480 So if I simplify this to make it look good 332 00:25:25,480 --> 00:25:27,910 and put the delta t squared up there, 333 00:25:27,910 --> 00:25:29,870 you see that it's just r squared. 334 00:25:37,720 --> 00:25:47,040 Maybe it's worth realizing that, again, the magic r equal 1 -- 335 00:25:47,040 --> 00:25:58,950 The magic ratio r equal 1 gives the exact U, 336 00:25:58,950 --> 00:26:02,900 agreeing exactly with u. 337 00:26:02,900 --> 00:26:08,030 This equation, if r is 1, would be satisfied exactly 338 00:26:08,030 --> 00:26:14,920 by the continuous solution and so it's the same as this one. 339 00:26:18,520 --> 00:26:22,040 So that's leapfrog. 340 00:26:22,040 --> 00:26:24,650 So can I summarize leapfrog? 341 00:26:24,650 --> 00:26:29,090 Leapfrog was, first of all, that led us to these -- 342 00:26:29,090 --> 00:26:32,270 it worked for second-order equations. 343 00:26:32,270 --> 00:26:38,200 It led us to the same stability condition 344 00:26:38,200 --> 00:26:42,130 that r had to be less or equal to 1, 345 00:26:42,130 --> 00:26:54,730 but it took a quadratic equation for G. Remember, 346 00:26:54,730 --> 00:27:01,070 we had G squared minus 2G times some quantity 347 00:27:01,070 --> 00:27:07,830 a that involved r's and cosines plus 1 equals 0. 348 00:27:07,830 --> 00:27:09,782 The reason it was a quadratic was there 349 00:27:09,782 --> 00:27:10,990 were two time steps involved. 350 00:27:14,810 --> 00:27:17,100 We handled that. 351 00:27:17,100 --> 00:27:21,070 We got stability, if r was less than or equal to 1. 352 00:27:21,070 --> 00:27:25,330 That led us to a, in magnitude, less or equal 1. 353 00:27:25,330 --> 00:27:30,100 And that led us to G -- I'll just remember those steps -- 354 00:27:30,100 --> 00:27:34,955 a less or equal 1, and that let us to G less than or equal 355 00:27:34,955 --> 00:27:38,230 to 1. 356 00:27:38,230 --> 00:27:47,480 Yes, the notes, including more about Maxwell's equation 357 00:27:47,480 --> 00:27:54,290 and Yee's beautiful method, with a figure that shows his mesh, 358 00:27:54,290 --> 00:28:01,130 will go up -- I mean, every section is getting upgraded 359 00:28:01,130 --> 00:28:05,040 and this one is the next one to be upgraded. 360 00:28:05,040 --> 00:28:10,650 Probably by tomorrow, you'll have a good section 361 00:28:10,650 --> 00:28:14,050 on second-order equations. 362 00:28:17,070 --> 00:28:24,220 For me, that's what I wanted to say about the wave 363 00:28:24,220 --> 00:28:31,510 equation alone, with no diffusion 364 00:28:31,510 --> 00:28:36,810 and now I'm ready to move to the heat equation. 365 00:28:36,810 --> 00:28:40,400 So what do we have coming up? 366 00:28:40,400 --> 00:28:42,160 Maybe important to say what's coming up. 367 00:28:47,120 --> 00:28:50,010 So we've done one-way wave. 368 00:28:54,240 --> 00:28:56,280 Now we've done two-way waves. 369 00:29:00,740 --> 00:29:10,820 Next comes the heat equation, heat/diffusion, 370 00:29:10,820 --> 00:29:14,080 and then will come a mixture of the two, 371 00:29:14,080 --> 00:29:26,810 convection-diffusion -- and by the way, 372 00:29:26,810 --> 00:29:34,560 so I'll go straight to these -- in a couple of weeks, 373 00:29:34,560 --> 00:29:38,810 we'll have a guest lecturer who will do the applications 374 00:29:38,810 --> 00:29:44,980 to financial mathematics, mathematical finance. 375 00:29:44,980 --> 00:29:49,280 Specifically, the Black-Scholes equation. 376 00:29:53,920 --> 00:30:00,040 So you probably know that a lot of effort and a lot of money 377 00:30:00,040 --> 00:30:04,730 are going into the valuation of options 378 00:30:04,730 --> 00:30:13,330 and other financial derivatives and that this Black-Scholes 379 00:30:13,330 --> 00:30:18,590 equation beautifully produced the heat equation, 380 00:30:18,590 --> 00:30:23,330 and additional correction terms will 381 00:30:23,330 --> 00:30:26,220 produce a convection-diffusion equation. 382 00:30:26,220 --> 00:30:29,200 So this is an application that we 383 00:30:29,200 --> 00:30:34,060 wouldn't have made some years ago, 384 00:30:34,060 --> 00:30:37,970 but now it's worth focusing on that. 385 00:30:37,970 --> 00:30:41,300 I think it's interesting in itself. 386 00:30:41,300 --> 00:30:45,500 So this is what's coming and then 387 00:30:45,500 --> 00:30:48,780 you could say one-way wave equations, but nonlinear. 388 00:30:48,780 --> 00:30:53,870 So nonlinear wave equations and those 389 00:30:53,870 --> 00:30:56,040 are called conservation laws. 390 00:31:05,740 --> 00:31:09,500 That's after these linear cases. 391 00:31:09,500 --> 00:31:10,840 All right. 392 00:31:10,840 --> 00:31:17,170 So I'm ready to tackle the heat equation, starting 393 00:31:17,170 --> 00:31:22,100 then on to the next section of the notes. 394 00:31:22,100 --> 00:31:25,510 So let me tackle it here. 395 00:31:25,510 --> 00:31:33,010 So the heat equation. 396 00:31:33,010 --> 00:31:38,010 Let me take the constant to be 1; u_t equals u_xx. 397 00:31:41,310 --> 00:31:43,060 Because we already see the big difference. 398 00:31:43,060 --> 00:31:45,970 Now, there's a second x derivative, but only 399 00:31:45,970 --> 00:31:49,840 a first derivative in time. 400 00:31:49,840 --> 00:31:53,510 The dimensions of t and x are no longer the same. 401 00:31:53,510 --> 00:31:58,810 We won't have delta t and delta x comparable. 402 00:31:58,810 --> 00:32:03,515 Now it will be delta t comparable with delta x 403 00:32:03,515 --> 00:32:06,930 squared, and that's a very significant difference, 404 00:32:06,930 --> 00:32:09,680 because that's -- if delta x is small, 405 00:32:09,680 --> 00:32:12,110 delta x squared is extremely small. 406 00:32:12,110 --> 00:32:19,060 So when delta t is constrained by delta x squared, 407 00:32:19,060 --> 00:32:22,650 we're looking at small time steps. 408 00:32:22,650 --> 00:32:27,610 We're looking at stiff systems, absolutely. 409 00:32:27,610 --> 00:32:29,370 This is going to be a stiff problem, 410 00:32:29,370 --> 00:32:36,220 because the low frequencies and the high frequencies 411 00:32:36,220 --> 00:32:39,100 differ enormously in the decay rate. 412 00:32:39,100 --> 00:32:41,550 In fact, why don't we see it right away, 413 00:32:41,550 --> 00:32:44,530 starting as always with exponentials. 414 00:32:44,530 --> 00:32:55,870 So if I plug in u of x and t is some G of t e to the i*k*x, 415 00:32:55,870 --> 00:32:57,860 separating variables as always. 416 00:33:01,100 --> 00:33:03,860 Look for a pure exponential solution, 417 00:33:03,860 --> 00:33:12,870 plug that in and we get dG/dt times e to the i*k*x 418 00:33:12,870 --> 00:33:16,970 on the left, and now I have to take two x derivatives, 419 00:33:16,970 --> 00:33:23,750 so that brings i*k down twice, so that's minus k squared -- 420 00:33:23,750 --> 00:33:29,610 i squared giving the minus 1 -- times G, times e to the i*k*x. 421 00:33:29,610 --> 00:33:40,870 And now, of course, I can cancel that, which is never 0, 422 00:33:40,870 --> 00:33:45,010 and I've separated out the time part, 423 00:33:45,010 --> 00:33:51,050 the G part, dG/dt is minus k squared G. So G 424 00:33:51,050 --> 00:33:55,880 is e to the minus k squared t. 425 00:33:55,880 --> 00:33:59,580 Notice that it's k squared, and notice 426 00:33:59,580 --> 00:34:02,750 that it's real and negative. 427 00:34:02,750 --> 00:34:06,320 See, that's a very big difference. 428 00:34:06,320 --> 00:34:16,010 Compare e to the i*k*c*t, which it was for the one-way wave 429 00:34:16,010 --> 00:34:17,490 equation. 430 00:34:17,490 --> 00:34:21,450 The difference is enormous here. 431 00:34:21,450 --> 00:34:26,920 That's magnitude 1, energy conserved. 432 00:34:26,920 --> 00:34:30,180 This is magnitude smaller than 1, energy dissipated. 433 00:34:36,080 --> 00:34:40,810 We had a ratio delta t over delta x. 434 00:34:40,810 --> 00:34:43,390 Now we're going to see delta t over delta x squared 435 00:34:43,390 --> 00:34:52,010 because somehow x and t are -- now have -- 436 00:34:52,010 --> 00:34:56,950 it's x squared that matches t now. 437 00:34:56,950 --> 00:35:00,890 So now, when I put that into here -- let me just do it -- 438 00:35:00,890 --> 00:35:06,270 G of t is e to the minus k squared t. 439 00:35:06,270 --> 00:35:10,100 So there is the pure exponential. 440 00:35:10,100 --> 00:35:13,120 Simple as always, because we have constant coefficients, 441 00:35:13,120 --> 00:35:16,770 but highly informative. 442 00:35:16,770 --> 00:35:20,750 I guess another thing that I read off of that is, 443 00:35:20,750 --> 00:35:24,620 what frequencies are decaying fast? 444 00:35:24,620 --> 00:35:26,220 High frequencies? 445 00:35:26,220 --> 00:35:30,750 If k is large, k squared is very large 446 00:35:30,750 --> 00:35:34,690 and e to the minus k squared t is decaying very quickly. 447 00:35:34,690 --> 00:35:39,840 So high-frequency noise in this system, 448 00:35:39,840 --> 00:35:46,970 roughness, discontinuities are going to get smoothed out, 449 00:35:46,970 --> 00:35:51,070 strongly, by moving forward in time. 450 00:35:51,070 --> 00:35:52,750 Physically, what's happening is, we 451 00:35:52,750 --> 00:36:00,020 have our wavefront, which stayed a perfect step 452 00:36:00,020 --> 00:36:07,680 function in the wave equation, will instantly smear. 453 00:36:07,680 --> 00:36:10,990 So diffusion smears discontinuity. 454 00:36:14,420 --> 00:36:15,550 Heat travels. 455 00:36:15,550 --> 00:36:22,940 If we were back over here, if the temperature starts out as 1 456 00:36:22,940 --> 00:36:28,540 on this side and 0 on this side, then in an instant, 457 00:36:28,540 --> 00:36:33,870 some heat flows from right to left. 458 00:36:33,870 --> 00:36:39,790 In fact, it flows with infinite speed. 459 00:36:39,790 --> 00:36:44,220 In a short delta t, there's a little heat all the way out 460 00:36:44,220 --> 00:36:48,930 there -- very little, of course, because it's -- 461 00:36:48,930 --> 00:36:54,690 I guess we want to see what that behavior is. 462 00:36:54,690 --> 00:36:59,160 So I now want to write down -- staying with the differential 463 00:36:59,160 --> 00:37:03,380 equation, what do we want to do? 464 00:37:03,380 --> 00:37:08,590 We did the exponential case and learned a good bit 465 00:37:08,590 --> 00:37:12,110 from that, the fast decay of high frequencies. 466 00:37:16,640 --> 00:37:20,680 The next step would be to put different frequencies, 467 00:37:20,680 --> 00:37:22,550 different k's together. 468 00:37:25,080 --> 00:37:33,120 By linearity, we can add these solutions, 469 00:37:33,120 --> 00:37:36,830 we can multiply that by any numbers we want, 470 00:37:36,830 --> 00:37:40,400 depending on k; we still have solutions. 471 00:37:40,400 --> 00:37:43,980 And we can integrate over k, so we will, actually. 472 00:37:43,980 --> 00:37:47,160 That that will be the next step. 473 00:37:47,160 --> 00:37:50,710 Let me write down what that does. 474 00:37:50,710 --> 00:37:55,780 I'm going to jump, take a little jump here 475 00:37:55,780 --> 00:37:58,630 to put on the board what I just said in words. 476 00:37:58,630 --> 00:38:03,806 I can multiply this, e to the minus k squared t e 477 00:38:03,806 --> 00:38:09,930 to the i*k*x -- that's what's happening to the pure frequency 478 00:38:09,930 --> 00:38:11,350 k. 479 00:38:11,350 --> 00:38:23,610 If I multiply that by the amount of that frequency which is 480 00:38:23,610 --> 00:38:26,220 in the initial condition -- so here is the initial condition, 481 00:38:26,220 --> 00:38:30,730 u_0, and I've taken its Fourier transform. 482 00:38:30,730 --> 00:38:36,020 This tells me how much of frequency k is in the problem, 483 00:38:36,020 --> 00:38:38,930 is in the initial problem. 484 00:38:38,930 --> 00:38:41,140 This tells me how much of frequency k 485 00:38:41,140 --> 00:38:43,430 is in the initial problem. 486 00:38:43,430 --> 00:38:48,220 That amount multiplies this, with this rapid decay as time 487 00:38:48,220 --> 00:38:53,020 goes forward, but at any later time, I'm just adding up -- 488 00:38:53,020 --> 00:38:55,930 and since k -- we're on the whole line -- 489 00:38:55,930 --> 00:39:03,380 k is a continuous -- so we add up from k equal minus infinity 490 00:39:03,380 --> 00:39:09,530 to infinity and I think we have to remember the 2*pi that 491 00:39:09,530 --> 00:39:14,100 depends on our particular definition of that transform, 492 00:39:14,100 --> 00:39:17,020 but I'm going to stay with this one. 493 00:39:17,020 --> 00:39:18,470 That's the answer. 494 00:39:18,470 --> 00:39:19,760 That's u of x and t. 495 00:39:29,400 --> 00:39:32,910 So I've said that in words, but actually, we 496 00:39:32,910 --> 00:39:36,170 could just check it. 497 00:39:36,170 --> 00:39:41,350 We would like to know that this left-hand side solves the heat 498 00:39:41,350 --> 00:39:43,990 equation, and we would like to know 499 00:39:43,990 --> 00:39:49,970 that it has the correct start, the correct u of x and 0. 500 00:39:49,970 --> 00:39:50,960 Let's check that. 501 00:39:50,960 --> 00:39:56,060 At t equals 0, at the start, this is 1. 502 00:39:56,060 --> 00:40:00,460 So at the start, this formula, without that thing 503 00:40:00,460 --> 00:40:04,910 there, is just the inverse Fourier transform 504 00:40:04,910 --> 00:40:07,780 that takes the Fourier transform, multiplies by this, 505 00:40:07,780 --> 00:40:12,380 integrates to recover u_0. 506 00:40:12,380 --> 00:40:14,010 So it does start out correctly. 507 00:40:17,300 --> 00:40:19,240 Should I say that again? 508 00:40:19,240 --> 00:40:22,520 It starts correctly because at t equal 0, 509 00:40:22,520 --> 00:40:25,415 this is just the inverse Fourier transform of u_0, 510 00:40:25,415 --> 00:40:29,830 so it produces u_0. 511 00:40:29,830 --> 00:40:34,040 It inverts this transform that we took. 512 00:40:34,040 --> 00:40:37,110 Secondly, does it solve the heat equation? 513 00:40:37,110 --> 00:40:41,770 Sure, because for each k, we've just 514 00:40:41,770 --> 00:40:43,720 found that that solves the heat equation 515 00:40:43,720 --> 00:40:47,520 and now we're just putting different k's together. 516 00:40:47,520 --> 00:40:50,740 So that's the answer. 517 00:40:50,740 --> 00:40:52,740 So you might say, OK, perfection. 518 00:40:59,360 --> 00:41:02,000 Do we need finite differences? 519 00:41:04,670 --> 00:41:05,770 I guess we do. 520 00:41:05,770 --> 00:41:13,700 This is typical of formulas that give the answer exactly, 521 00:41:13,700 --> 00:41:17,630 but in terms that are not numerically convenient. 522 00:41:17,630 --> 00:41:21,660 Because, to use his formula, first of all, 523 00:41:21,660 --> 00:41:29,400 this this requires an integral, an infinite integral to find -- 524 00:41:29,400 --> 00:41:37,130 integral to find -- for u_0, u hat. 525 00:41:37,130 --> 00:41:42,240 To use this formula, we'd have to find this transform, 526 00:41:42,240 --> 00:41:45,340 and then we have to do this integral 527 00:41:45,340 --> 00:41:57,730 for the inverse transform, this integral, for the answer, u. 528 00:41:57,730 --> 00:41:58,880 Two infinite integrals. 529 00:42:03,710 --> 00:42:09,580 And, not to mention the fact that on a finite interval, 530 00:42:09,580 --> 00:42:12,160 when x doesn't go all the way from minus infinity 531 00:42:12,160 --> 00:42:19,180 to infinity, we have to think all over again. 532 00:42:19,180 --> 00:42:24,440 So we have a nice formula for the answer, but -- 533 00:42:24,440 --> 00:42:28,240 it looks nice, but it's not numerically terrific. 534 00:42:31,390 --> 00:42:34,330 We can get a lot of information out of this 535 00:42:34,330 --> 00:42:39,660 and there's one other special solution that's 536 00:42:39,660 --> 00:42:42,220 also extremely informative. 537 00:42:42,220 --> 00:42:47,320 What if -- so I'm going to do a special case, 538 00:42:47,320 --> 00:42:49,350 but it's the big case. 539 00:42:49,350 --> 00:42:57,240 What if the initial conditions is a delta function? 540 00:42:57,240 --> 00:43:02,870 What if the initial condition is a delta function? 541 00:43:02,870 --> 00:43:14,430 An impulse at time 0, x equal 0, an instant source of heat 542 00:43:14,430 --> 00:43:18,372 at a point -- a point source with finite strength, 543 00:43:18,372 --> 00:43:19,280 you could say. 544 00:43:19,280 --> 00:43:22,580 An impulse at times 0. 545 00:43:27,450 --> 00:43:29,980 For the wave equation, what happened? 546 00:43:29,980 --> 00:43:32,150 That was like turning on a flash of light 547 00:43:32,150 --> 00:43:35,920 and it went along the characteristics. 548 00:43:35,920 --> 00:43:42,600 For the heat equation, it'll be quite different. 549 00:43:42,600 --> 00:43:47,000 There aren't characteristics here, 550 00:43:47,000 --> 00:43:49,530 but this is an extremely important solution, 551 00:43:49,530 --> 00:43:54,255 and I think you could call it the fundamental solution 552 00:43:54,255 --> 00:43:55,130 to the heat equation. 553 00:44:01,390 --> 00:44:02,570 You may know what it is. 554 00:44:02,570 --> 00:44:05,230 You may have seen this formula. 555 00:44:05,230 --> 00:44:11,720 It's fantastic that we get a formula for this one. 556 00:44:11,720 --> 00:44:14,930 You could say, we've got a formula. 557 00:44:14,930 --> 00:44:18,170 What's the Fourier transform, what's u_0 hat of k 558 00:44:18,170 --> 00:44:19,510 for the delta function? 559 00:44:22,280 --> 00:44:24,120 1, right? 560 00:44:24,120 --> 00:44:30,010 The Fourier transform of the delta function is a constant 1. 561 00:44:30,010 --> 00:44:34,280 All frequencies are there in equal amounts. 562 00:44:34,280 --> 00:44:38,310 This is a constant, so I can remove it. 563 00:44:38,310 --> 00:44:39,710 It's 1. 564 00:44:39,710 --> 00:44:43,320 I'm left with a specific integral to do. 565 00:44:43,320 --> 00:44:46,500 And the question is, can I do it? 566 00:44:46,500 --> 00:44:49,410 And the answer turns out to be yes. 567 00:44:49,410 --> 00:44:53,100 You can do that integral when this is a constant 568 00:44:53,100 --> 00:44:55,030 and that will give you the answer 569 00:44:55,030 --> 00:44:58,130 with that starting value. 570 00:44:58,130 --> 00:45:00,920 Let me just say what that answer is. 571 00:45:00,920 --> 00:45:04,970 u of x and t -- this is the fundamental solution, 572 00:45:04,970 --> 00:45:09,800 u fundamental, maybe I should say, 573 00:45:09,800 --> 00:45:14,940 because it's such an important case -- is, turns out to be -- 574 00:45:14,940 --> 00:45:19,960 it's not obvious what that integral is. 575 00:45:19,960 --> 00:45:37,030 By the way, normally -- let's see -- normally it's -- 576 00:45:37,030 --> 00:45:39,050 to get the answer that I'm going to write down, 577 00:45:39,050 --> 00:45:43,510 we take a kind of end run on the integral, 578 00:45:43,510 --> 00:45:48,450 and I'm going to take a serious end run and write down 579 00:45:48,450 --> 00:45:49,580 the answer exactly. 580 00:45:54,340 --> 00:45:55,940 Here's the key part of the answer. 581 00:46:00,270 --> 00:46:03,880 It's a solution which starts from a delta function, spreads 582 00:46:03,880 --> 00:46:10,620 of course, and the shape as it spreads is a bell. 583 00:46:10,620 --> 00:46:15,665 It's the famous bell-shaped Gaussian distribution of e 584 00:46:15,665 --> 00:46:23,230 to the minus -- so is it e to the minus x squared, I guess? 585 00:46:23,230 --> 00:46:29,880 And then, always here comes -- that scalar tells us the width 586 00:46:29,880 --> 00:46:32,020 of the bell. 587 00:46:32,020 --> 00:46:34,900 How far has it spread at time t? 588 00:46:34,900 --> 00:46:37,210 And what goes there is 4t. 589 00:46:40,230 --> 00:46:42,250 That's the key observation. 590 00:46:42,250 --> 00:46:45,960 And notice how x squared and t are coming in. 591 00:46:45,960 --> 00:46:50,380 It's that ratio, x squared to t, that's crucial. 592 00:46:50,380 --> 00:46:52,480 That's the parameter again. 593 00:46:56,250 --> 00:46:59,550 Of course, we need to multiply by a constant. 594 00:47:03,630 --> 00:47:06,790 How do I know I need a constant? 595 00:47:06,790 --> 00:47:12,450 Because the total heat is conserved. 596 00:47:16,140 --> 00:47:19,210 In other words, the integral of the delta function, 597 00:47:19,210 --> 00:47:24,010 the original source of heat, was 1. 598 00:47:24,010 --> 00:47:26,280 The integral from minus infinity to infinity 599 00:47:26,280 --> 00:47:31,150 of the delta function, which is all totally concentrated 600 00:47:31,150 --> 00:47:33,290 at one point, is 1. 601 00:47:33,290 --> 00:47:35,480 So I need to put on whatever constant 602 00:47:35,480 --> 00:47:37,360 it takes so that the integral of this thing 603 00:47:37,360 --> 00:47:44,590 shall stay 1 for later times. 604 00:47:44,590 --> 00:47:47,940 This is one integral from minus infinity to infinity that we 605 00:47:47,940 --> 00:47:51,740 can do and it turns out to need 1 over the square root 606 00:47:51,740 --> 00:47:53,220 of 4*pi*t. 607 00:47:59,520 --> 00:48:01,180 That solves the heat equation. 608 00:48:05,610 --> 00:48:11,770 It's not a lot of fun to plug that into the heat equation, 609 00:48:11,770 --> 00:48:13,910 but it's possible, right? 610 00:48:13,910 --> 00:48:17,380 The x derivative, the time derivative 611 00:48:17,380 --> 00:48:19,010 is going to be messy. 612 00:48:19,010 --> 00:48:20,260 It'll have two terms. 613 00:48:20,260 --> 00:48:23,400 The x derivative will have two terms and they'll agree. 614 00:48:27,550 --> 00:48:31,150 The notes will give one way to do the integral 615 00:48:31,150 --> 00:48:31,990 and get that answer. 616 00:48:37,370 --> 00:48:40,390 You see that that integral, it's -- 617 00:48:40,390 --> 00:48:52,510 integrals with e to the minus k squared in them are impossible 618 00:48:52,510 --> 00:48:57,360 on a finite interval, but here we're going all the way from 619 00:48:57,360 --> 00:49:00,050 minus infinity to infinity, which you might think makes 620 00:49:00,050 --> 00:49:04,640 the problem harder, but actually it makes it a great deal easier 621 00:49:04,640 --> 00:49:09,810 and we can get an explicit answer, a beautiful answer. 622 00:49:09,810 --> 00:49:15,340 So we learn that the solution to the heat equation, 623 00:49:15,340 --> 00:49:22,180 coming from a point source, is a bell-shaped Gaussian curve that 624 00:49:22,180 --> 00:49:26,570 gets wider and wider as t increases, 625 00:49:26,570 --> 00:49:29,010 but I guess you would want to look to see, 626 00:49:29,010 --> 00:49:32,890 what happens if t comes down to 0? 627 00:49:32,890 --> 00:49:38,220 Does that really approximate -- I meant to say, 628 00:49:38,220 --> 00:49:44,130 does it really converge to -- this should, as t goes to 0, 629 00:49:44,130 --> 00:49:52,030 this should go to the delta function, and in some way, 630 00:49:52,030 --> 00:49:52,960 it does. 631 00:49:52,960 --> 00:49:54,600 In some way, it does. 632 00:49:54,600 --> 00:49:57,810 It's wonderful. 633 00:49:57,810 --> 00:50:05,520 The delta function, of course, is 0 away from the origin. 634 00:50:05,520 --> 00:50:08,840 So why does this approach 0 away from the origin? 635 00:50:08,840 --> 00:50:11,070 Suppose x is 1. 636 00:50:11,070 --> 00:50:12,310 Suppose x is 1. 637 00:50:12,310 --> 00:50:19,890 Then do you see this thing going to 0 as t goes to 0? 638 00:50:19,890 --> 00:50:20,910 Look what's happening. 639 00:50:20,910 --> 00:50:26,600 As t goes to 0, this part is blowing up, but kind of weakly. 640 00:50:26,600 --> 00:50:29,630 That's not a disastrous blowup. 641 00:50:29,630 --> 00:50:34,290 Compared to this e to the minus -- let's say 1 over 4t. 642 00:50:34,290 --> 00:50:40,450 As t goes to 0, that's e to a very negative exponent. 643 00:50:40,450 --> 00:50:42,630 That's going to 0 very fast, much 644 00:50:42,630 --> 00:50:45,200 faster than this is going to 0. 645 00:50:45,200 --> 00:50:48,640 If you like to think of l'Hopital's rule or ratio 646 00:50:48,640 --> 00:50:53,180 or something, this quantity is going to 0 way 647 00:50:53,180 --> 00:50:56,500 faster than this one is, and the result 648 00:50:56,500 --> 00:51:03,100 is 0, except at the one point x equals 0, where this is 1. 649 00:51:08,140 --> 00:51:12,040 The fact that the total amount of heat stays at 1 650 00:51:12,040 --> 00:51:17,590 tells us that the delta function is the limit there. 651 00:51:20,350 --> 00:51:27,180 Today was the heat equation, continuous case, 652 00:51:27,180 --> 00:51:30,950 with these explicit answers. 653 00:51:30,950 --> 00:51:36,570 Then next time is -- tomorrow, I guess -- is the heat equation, 654 00:51:36,570 --> 00:51:39,400 finite differences. 655 00:51:39,400 --> 00:51:43,050 Again, we'll have several difference methods 656 00:51:43,050 --> 00:51:46,330 and to compare them would be terrific. 657 00:51:49,080 --> 00:51:53,200 Please think about that, comparison with the heat 658 00:51:53,200 --> 00:51:57,290 equation and/or what I was saying 659 00:51:57,290 --> 00:52:00,960 at the beginning of class, a deeper look 660 00:52:00,960 --> 00:52:04,970 at the comparison for the wave equation. 661 00:52:04,970 --> 00:52:11,150 See you tomorrow for difference equations for this problem. 662 00:52:11,150 --> 00:52:12,400 Thanks.