1 00:00:01,520 --> 00:00:03,890 The following content is provided under a Creative 2 00:00:03,890 --> 00:00:05,280 Commons license. 3 00:00:05,280 --> 00:00:07,520 Your support will help MIT OpenCourseWare 4 00:00:07,520 --> 00:00:11,610 continue to offer high-quality educational resources for free. 5 00:00:11,610 --> 00:00:14,150 To make a donation or to view additional materials 6 00:00:14,150 --> 00:00:18,080 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:18,080 --> 00:00:19,320 at ocw.mit.edu. 8 00:00:24,440 --> 00:00:27,500 WILLIAM GREEN, JR: All right, let's get going. 9 00:00:27,500 --> 00:00:32,490 So today, I'll say a few more words about PDEs, 10 00:00:32,490 --> 00:00:34,490 and then we'll leave that topic for a while. 11 00:00:34,490 --> 00:00:36,156 I think I'll actually come back and have 12 00:00:36,156 --> 00:00:39,530 a little lecture about that right before Thanksgiving, 13 00:00:39,530 --> 00:00:42,140 for those of you still around. 14 00:00:42,140 --> 00:00:44,110 And then we'll start talking about probability, 15 00:00:44,110 --> 00:00:47,000 and then that will lead into several lectures 16 00:00:47,000 --> 00:00:50,930 about models versus data, which is a very important topic 17 00:00:50,930 --> 00:00:54,080 for all of you who either plan to generate data 18 00:00:54,080 --> 00:00:57,290 or plan to generate models during your stay here, 19 00:00:57,290 --> 00:00:59,689 which probably is everybody. 20 00:00:59,689 --> 00:01:01,230 So we'll talk about that for a while. 21 00:01:03,830 --> 00:01:06,765 So PDEs. 22 00:01:06,765 --> 00:01:09,530 I guess the first comment is, homework 7, have any of you 23 00:01:09,530 --> 00:01:10,608 looked at this yet? 24 00:01:10,608 --> 00:01:11,922 AUDIENCE: [INTERPOSING VOICES] 25 00:01:11,922 --> 00:01:13,372 [LAUGHTER] 26 00:01:13,372 --> 00:01:14,871 WILLIAM GREEN, JR: Not a single one. 27 00:01:14,871 --> 00:01:16,344 AUDIENCE: [INAUDIBLE] 28 00:01:16,344 --> 00:01:19,781 [LAUGHTER] 29 00:01:22,250 --> 00:01:24,870 WILLIAM GREEN, JR: So homework 7 is the same problem 30 00:01:24,870 --> 00:01:29,280 that Kristin showed in class in the demo for COMSOL, 31 00:01:29,280 --> 00:01:30,880 and I want you to solve it both ways. 32 00:01:30,880 --> 00:01:33,270 So solve it with COMSOL and then solve 33 00:01:33,270 --> 00:01:35,770 it writing your own finite volume code. 34 00:01:35,770 --> 00:01:39,350 And I want to warn you. 35 00:01:39,350 --> 00:01:43,380 This problem has a characteristic length 36 00:01:43,380 --> 00:01:50,950 that's way smaller than the dimensions of the problem. 37 00:01:50,950 --> 00:01:54,270 And so in principle, you might need 38 00:01:54,270 --> 00:01:57,510 to use an incredibly fine mesh to resolve 39 00:01:57,510 --> 00:01:59,540 the gradients in the problem. 40 00:01:59,540 --> 00:02:03,600 So just remember, in case you haven't looked at it, 41 00:02:03,600 --> 00:02:05,670 the problem is we have a drug patch. 42 00:02:05,670 --> 00:02:07,770 It has some concentration of the drug. 43 00:02:07,770 --> 00:02:11,960 The drug is diffusing slowly out of the patch into the flow, 44 00:02:11,960 --> 00:02:15,720 and we have some flow here like that. 45 00:02:15,720 --> 00:02:18,342 And the characteristic length is at the-- 46 00:02:18,342 --> 00:02:20,950 this is a velocity boundary layer. 47 00:02:20,950 --> 00:02:23,670 So the velocity in the x-direction 48 00:02:23,670 --> 00:02:33,520 is equal to y times something, dv dy, I guess. 49 00:02:33,520 --> 00:02:37,590 This is some number, and so this has units of-- 50 00:02:40,180 --> 00:02:45,780 what is that-- per second, so like a strain rate, OK? 51 00:02:45,780 --> 00:02:51,210 And the diffusion here is controlled by diffusivity D, 52 00:02:51,210 --> 00:02:55,690 and that has units of, say, centimeter squared per second. 53 00:02:55,690 --> 00:03:04,710 And so the D over dvx dy, this thing 54 00:03:04,710 --> 00:03:10,350 gives a characteristic length squared, 55 00:03:10,350 --> 00:03:13,840 which is sort of the natural length scale of this problem. 56 00:03:13,840 --> 00:03:17,182 And the problem is that for the drug molecule, 57 00:03:17,182 --> 00:03:18,015 it's a big molecule. 58 00:03:18,015 --> 00:03:20,390 It has a very small diffusivity. 59 00:03:20,390 --> 00:03:23,740 And so therefore, this is a really tiny ratio, 60 00:03:23,740 --> 00:03:25,750 and so the L is very small. 61 00:03:25,750 --> 00:03:29,400 And similarly, if you look at it from the point 62 00:03:29,400 --> 00:03:31,800 of view in the x-direction, the Peclet number 63 00:03:31,800 --> 00:03:33,417 is really gigantic. 64 00:03:33,417 --> 00:03:36,000 And so both of those will tell you that you have to watch out, 65 00:03:36,000 --> 00:03:38,125 there might be very sharp gradients in the problem. 66 00:03:38,125 --> 00:03:41,400 And if you just think of it physically, right over here 67 00:03:41,400 --> 00:03:44,189 we think the concentration's 0, somewhere over here. 68 00:03:44,189 --> 00:03:46,230 And all of a sudden right here, the concentration 69 00:03:46,230 --> 00:03:48,600 is going to be close to the concentration in the patch. 70 00:03:48,600 --> 00:03:49,980 So there's almost a discontinuity 71 00:03:49,980 --> 00:03:51,730 in the concentration. 72 00:03:51,730 --> 00:03:55,032 So there's a really sharp gradient on the upstream edge. 73 00:03:55,032 --> 00:03:57,240 And then something funky is going to happen down here 74 00:03:57,240 --> 00:03:58,070 at the end of the patch, too. 75 00:03:58,070 --> 00:04:00,660 It won't be quite as abrupt, but could be pretty strange. 76 00:04:03,210 --> 00:04:04,370 All right, so you got it? 77 00:04:04,370 --> 00:04:04,870 OK. 78 00:04:07,546 --> 00:04:09,420 And in the problem, we want you to figure out 79 00:04:09,420 --> 00:04:12,590 the drug diffusing all the way over to here somewhere, 80 00:04:12,590 --> 00:04:14,010 way far over there. 81 00:04:14,010 --> 00:04:17,670 And so you may need quite a few mesh points in the y-direction 82 00:04:17,670 --> 00:04:19,330 as well. 83 00:04:19,330 --> 00:04:19,829 All right. 84 00:04:19,829 --> 00:04:24,690 And this kind of problem, this is a very simple case, right? 85 00:04:24,690 --> 00:04:26,970 There's no reactions. 86 00:04:26,970 --> 00:04:28,725 The velocity's just in one direction, 87 00:04:28,725 --> 00:04:30,414 and this is not a very hard case. 88 00:04:30,414 --> 00:04:31,830 But you'll see it's actually still 89 00:04:31,830 --> 00:04:33,910 pretty tricky to get the right solution. 90 00:04:33,910 --> 00:04:36,660 So don't just believe what the code tells you. 91 00:04:36,660 --> 00:04:38,580 Just run COMSOL and just-- 92 00:04:38,580 --> 00:04:40,860 don't believe it's showing the truth. 93 00:04:40,860 --> 00:04:43,770 And don't believe you just write down some finite volumes 94 00:04:43,770 --> 00:04:45,045 that you'll get the truth. 95 00:04:45,045 --> 00:04:47,170 So mess around with it and try to convince yourself 96 00:04:47,170 --> 00:04:48,090 it's really converged, and you really 97 00:04:48,090 --> 00:04:49,423 have the real physical solution. 98 00:04:51,532 --> 00:04:52,990 Because we expect a sharp gradient, 99 00:04:52,990 --> 00:04:54,660 say, in the upstream edge, you might 100 00:04:54,660 --> 00:04:58,590 want to play with using a finer mesh in the x-direction 101 00:04:58,590 --> 00:05:02,350 here than you would down here, because down here presumably 102 00:05:02,350 --> 00:05:04,560 the gradients in x-direction are much smaller. 103 00:05:04,560 --> 00:05:08,490 So you don't have to use square finite volumes. 104 00:05:08,490 --> 00:05:09,960 You could use rectangles. 105 00:05:09,960 --> 00:05:11,005 Yes? 106 00:05:11,005 --> 00:05:12,380 AUDIENCE: I don't understand what 107 00:05:12,380 --> 00:05:15,736 you have written [INAUDIBLE] as vx equal y dvx dy. 108 00:05:15,736 --> 00:05:16,736 WILLIAM GREEN, JR: Yeah. 109 00:05:16,736 --> 00:05:18,680 AUDIENCE: So what-- 110 00:05:18,680 --> 00:05:21,096 WILLIAM GREEN, JR: So that's because the velocity-- the vx 111 00:05:21,096 --> 00:05:27,490 is 0 at the wall, and the velocity increases with y. 112 00:05:27,490 --> 00:05:30,770 So vx increases the further you get from y. 113 00:05:30,770 --> 00:05:34,870 This is y equals 0, always going up that way. 114 00:05:34,870 --> 00:05:37,930 As you can increase the height, the flow gets faster. 115 00:05:37,930 --> 00:05:40,330 And that's typical, because you have a no-slip boundary 116 00:05:40,330 --> 00:05:43,330 condition at the wall, right? 117 00:05:43,330 --> 00:05:46,681 Is that OK, or did I misunderstand your question? 118 00:05:46,681 --> 00:05:49,680 Is that good? 119 00:05:49,680 --> 00:05:50,180 OK? 120 00:05:50,180 --> 00:05:51,950 AUDIENCE: So y is a constant. 121 00:05:51,950 --> 00:05:53,270 WILLIAM GREEN, JR: Yeah, in this particular problem 122 00:05:53,270 --> 00:05:55,720 this is just a number that we tell you in the problem. 123 00:05:55,720 --> 00:05:58,539 AUDIENCE: [INAUDIBLE] 124 00:05:58,539 --> 00:05:59,580 WILLIAM GREEN, JR: Right. 125 00:05:59,580 --> 00:06:01,246 If you had a flow in a cylindrical pipe, 126 00:06:01,246 --> 00:06:02,260 it wouldn't be-- 127 00:06:02,260 --> 00:06:03,140 wouldn't be a number. 128 00:06:03,140 --> 00:06:06,807 Be more complicated, yeah, all right? 129 00:06:06,807 --> 00:06:09,390 So this is-- I mean, again, this is like the simplest you got. 130 00:06:09,390 --> 00:06:11,099 It's only 2D. 131 00:06:11,099 --> 00:06:11,890 It's really simple. 132 00:06:11,890 --> 00:06:13,465 But you're going to see here that even here you 133 00:06:13,465 --> 00:06:14,631 could have a lot of trouble. 134 00:06:14,631 --> 00:06:16,360 And if you just don't think about it-- 135 00:06:16,360 --> 00:06:17,560 the computer will give you an answer. 136 00:06:17,560 --> 00:06:19,680 Whatever-- you put in some finite difference equations 137 00:06:19,680 --> 00:06:21,429 or finite element equations, finite volume 138 00:06:21,429 --> 00:06:23,542 equations, fsolve, whatever, it's 139 00:06:23,542 --> 00:06:25,250 going to solve and give you some numbers. 140 00:06:25,250 --> 00:06:26,350 It doesn't mean it has any relation 141 00:06:26,350 --> 00:06:27,350 to the physical reality. 142 00:06:27,350 --> 00:06:29,860 So this is a problem to really pay attention 143 00:06:29,860 --> 00:06:33,230 to whether you're really converged. 144 00:06:33,230 --> 00:06:35,142 All right. 145 00:06:35,142 --> 00:06:39,330 And so what I suggest you do in this problem is go 146 00:06:39,330 --> 00:06:42,415 through a sequence where you vary-- 147 00:06:42,415 --> 00:06:45,040 the real problem wants you to do this all the way out to-- this 148 00:06:45,040 --> 00:06:47,237 is 1 centimeter. 149 00:06:47,237 --> 00:06:49,320 But I suggest you instead solve a simpler problem, 150 00:06:49,320 --> 00:06:51,194 where you put the-- here's a simpler problem. 151 00:06:54,490 --> 00:07:02,330 Put your boundary right here, really close, and then 152 00:07:02,330 --> 00:07:03,470 solve that problem. 153 00:07:03,470 --> 00:07:07,650 You won't need as many mesh points across 154 00:07:07,650 --> 00:07:09,150 to get from here to here. 155 00:07:09,150 --> 00:07:10,140 And this should be-- 156 00:07:10,140 --> 00:07:12,420 this is-- suppose you choose this 157 00:07:12,420 --> 00:07:16,420 is c equal 0 boundary condition for this wall, 158 00:07:16,420 --> 00:07:19,840 then this should be an upper bound. 159 00:07:19,840 --> 00:07:22,540 Because if you put an absorbing layer here, 160 00:07:22,540 --> 00:07:25,930 it should drive the diffusion faster, right? 161 00:07:25,930 --> 00:07:30,356 So as you increase this distance-- 162 00:07:30,356 --> 00:07:32,260 let's call it little h-- 163 00:07:32,260 --> 00:07:34,697 as you increase little h, you should 164 00:07:34,697 --> 00:07:36,280 converge to the true solution that you 165 00:07:36,280 --> 00:07:39,252 want sort of from above. 166 00:07:39,252 --> 00:07:41,641 Does that makes sense? 167 00:07:41,641 --> 00:07:43,072 Yeah? 168 00:07:43,072 --> 00:07:45,230 Is this OK? 169 00:07:45,230 --> 00:07:46,730 All right. 170 00:07:46,730 --> 00:07:50,330 And similarly, you can vary the mesh, 171 00:07:50,330 --> 00:07:53,666 how big your boxes are, say, in delta x and delta y. 172 00:07:53,666 --> 00:07:55,040 And again, for each of those, you 173 00:07:55,040 --> 00:07:58,070 could think about how should things converge. 174 00:07:58,070 --> 00:07:59,690 And so look and see if it's actually 175 00:07:59,690 --> 00:08:02,516 converging the way you think it should be converging, right? 176 00:08:06,460 --> 00:08:08,589 Any more questions about this? 177 00:08:08,589 --> 00:08:10,630 OK, so this problem might-- this homework problem 178 00:08:10,630 --> 00:08:13,119 might look like a MATLAB coding problem. 179 00:08:13,119 --> 00:08:14,910 It has MATLAB coding, but it's not really-- 180 00:08:14,910 --> 00:08:16,237 that's not really what it is. 181 00:08:16,237 --> 00:08:17,070 It's really like a-- 182 00:08:17,070 --> 00:08:20,113 it's a conceptual problem about what you're doing. 183 00:08:20,113 --> 00:08:22,879 All right. 184 00:08:22,879 --> 00:08:26,020 All right, in this problem, I want you to use finite volumes. 185 00:08:26,020 --> 00:08:28,020 So let's talk about finite volumes for a minute. 186 00:08:28,020 --> 00:08:33,890 So finite volumes is to imagine that we have little control 187 00:08:33,890 --> 00:08:38,880 volumes, and each one of them has a little propeller in it, 188 00:08:38,880 --> 00:08:43,200 stirs it up, like little CSTRs. 189 00:08:43,200 --> 00:08:45,670 And so we do it just like you did back in your intro ChemE 190 00:08:45,670 --> 00:08:48,820 class and mass/energy balances a million years ago. 191 00:08:48,820 --> 00:08:51,640 You know that you have some flow coming in here, 192 00:08:51,640 --> 00:08:54,120 and maybe some flow going out there. 193 00:08:54,120 --> 00:08:56,895 And maybe you have some flux come in here 194 00:08:56,895 --> 00:08:59,370 and maybe something out there. 195 00:08:59,370 --> 00:09:02,400 And you can add up all the flows in and all the flows out, 196 00:09:02,400 --> 00:09:05,350 and then that-- 197 00:09:05,350 --> 00:09:08,750 the net of all these fluxes has got 198 00:09:08,750 --> 00:09:10,560 to be equal to the accumulation. 199 00:09:10,560 --> 00:09:12,480 And if we're doing a steady-state problem, 200 00:09:12,480 --> 00:09:15,600 then there's no time derivative, so the accumulation term 201 00:09:15,600 --> 00:09:16,662 should be 0. 202 00:09:16,662 --> 00:09:18,120 And you did a lot of these problems 203 00:09:18,120 --> 00:09:19,920 a long time ago, right? 204 00:09:19,920 --> 00:09:21,296 OK, so you just do it like that. 205 00:09:21,296 --> 00:09:23,920 The only problem is now we have a million of these little boxes 206 00:09:23,920 --> 00:09:25,003 all coupled to each other. 207 00:09:25,003 --> 00:09:27,290 So you get one equation for each box. 208 00:09:27,290 --> 00:09:30,189 And in this problem, we're going to-- 209 00:09:30,189 --> 00:09:31,980 when you do this method, what people assume 210 00:09:31,980 --> 00:09:33,646 is that you have a uniform concentration 211 00:09:33,646 --> 00:09:35,100 sort of across here or the number 212 00:09:35,100 --> 00:09:37,740 you use as the average of the concentration in the cell 213 00:09:37,740 --> 00:09:38,830 as [INAUDIBLE]. 214 00:09:38,830 --> 00:09:42,959 And so it's not really exactly realistic. 215 00:09:42,959 --> 00:09:44,500 So that's where the approximation is. 216 00:09:44,500 --> 00:09:45,720 What you're doing at the boundaries 217 00:09:45,720 --> 00:09:47,550 is very realistic, because you're actually computing 218 00:09:47,550 --> 00:09:48,930 the fluxes across control volumes 219 00:09:48,930 --> 00:09:50,880 is exactly the way you should do it. 220 00:09:50,880 --> 00:09:55,320 So there's different methods, right, finite element, 221 00:09:55,320 --> 00:09:57,204 finite difference, finite volume. 222 00:09:57,204 --> 00:09:58,620 The nice thing about finite volume 223 00:09:58,620 --> 00:10:00,660 is you're really treating exactly what's 224 00:10:00,660 --> 00:10:04,750 happening across the boundaries of the mesh area, the mesh 225 00:10:04,750 --> 00:10:06,079 volume. 226 00:10:06,079 --> 00:10:08,120 And we'll find that a lot of ChemE problems, this 227 00:10:08,120 --> 00:10:09,369 is how people prefer to do it. 228 00:10:13,380 --> 00:10:17,610 And because you're treating the fluxes exactly, 229 00:10:17,610 --> 00:10:26,522 if you have your mesh volume sitting on the wall 230 00:10:26,522 --> 00:10:28,022 or on top of the drug patch, suppose 231 00:10:28,022 --> 00:10:32,380 if we're sitting right on top of the drug patch here. 232 00:10:32,380 --> 00:10:34,600 Then if you're sitting-- 233 00:10:34,600 --> 00:10:35,650 first, let's do a wall. 234 00:10:35,650 --> 00:10:37,730 Suppose you're sitting on an impermeable wall, 235 00:10:37,730 --> 00:10:46,360 then we just know that the flux here will be 0 if it's a wall. 236 00:10:46,360 --> 00:10:47,450 So that's easy. 237 00:10:47,450 --> 00:10:48,247 No flux here. 238 00:10:48,247 --> 00:10:50,330 So we only have to worry about this one, this one, 239 00:10:50,330 --> 00:10:51,750 and this one. 240 00:10:51,750 --> 00:10:54,280 That one's not doing anything. 241 00:10:54,280 --> 00:10:57,170 This case, if you say in the drug patch there is a flux, 242 00:10:57,170 --> 00:10:59,350 stuff's coming in and you'll need 243 00:10:59,350 --> 00:11:02,180 to figure out how to write that boundary condition. 244 00:11:02,180 --> 00:11:06,100 So the boundary condition as written is that C, the drug, 245 00:11:06,100 --> 00:11:11,200 is equal to some number, C drug, whatever is in the patch. 246 00:11:11,200 --> 00:11:14,270 But that's not so easy to impose here. 247 00:11:14,270 --> 00:11:16,010 And so there's two ways to look at it. 248 00:11:16,010 --> 00:11:20,110 One way is people compute this flux by considering-- 249 00:11:23,225 --> 00:11:26,451 suppose I know this is C drug here. 250 00:11:26,451 --> 00:11:28,340 I'm trying to really figure out what's 251 00:11:28,340 --> 00:11:31,200 the average concentration here. 252 00:11:31,200 --> 00:11:33,470 And so one way to compute this is 253 00:11:33,470 --> 00:11:43,020 to say it's the diffusivity times C drug minus C 254 00:11:43,020 --> 00:11:50,620 the middle over delta y over 2. 255 00:11:50,620 --> 00:11:52,350 That would be the flux. 256 00:11:52,350 --> 00:11:54,060 So that's one way to look at it. 257 00:11:54,060 --> 00:11:57,830 Another way people look at it is they draw 258 00:11:57,830 --> 00:11:59,998 what they call a ghost volume. 259 00:12:03,140 --> 00:12:06,980 And so here, here's my C that I care about, C middle. 260 00:12:12,310 --> 00:12:13,296 Here's C ghost. 261 00:12:17,120 --> 00:12:18,680 And here is the line between them. 262 00:12:18,680 --> 00:12:20,450 Now, I can use the same equation here 263 00:12:20,450 --> 00:12:22,640 that they would have used before. 264 00:12:22,640 --> 00:12:25,730 But I don't know what C ghost is, because there's 265 00:12:25,730 --> 00:12:26,520 no real cell here. 266 00:12:26,520 --> 00:12:27,590 This is below the patch. 267 00:12:27,590 --> 00:12:30,350 Here's the patch. 268 00:12:30,350 --> 00:12:32,660 But imagine the patch is not there for a second, 269 00:12:32,660 --> 00:12:35,660 and I write down the same equation I would have here. 270 00:12:35,660 --> 00:12:41,730 And the flux diffusively would have been D C ghost minus C 271 00:12:41,730 --> 00:12:46,440 middle over delta y. 272 00:12:46,440 --> 00:12:49,220 That's what you would have written as the diffusive flux. 273 00:12:49,220 --> 00:12:51,285 And I don't know what C ghost is. 274 00:12:51,285 --> 00:12:52,660 So now, I have to think about how 275 00:12:52,660 --> 00:12:55,040 do I estimate what C ghost is. 276 00:12:55,040 --> 00:12:59,420 I can say, well, let's do a linear interpolation 277 00:12:59,420 --> 00:13:02,420 from this concentration to that concentration. 278 00:13:02,420 --> 00:13:10,520 So let's say that the C boundary is equal to C 279 00:13:10,520 --> 00:13:15,120 ghost, the average of these two, plus C mid over 2. 280 00:13:17,695 --> 00:13:19,820 That's what we got if we did a linear interpolation 281 00:13:19,820 --> 00:13:22,324 between these two guys to figure out what it is here. 282 00:13:22,324 --> 00:13:23,490 But here we know what it is. 283 00:13:23,490 --> 00:13:25,350 We know what a C boundary is. 284 00:13:25,350 --> 00:13:27,620 That's the concentration of the drug patch 285 00:13:27,620 --> 00:13:29,676 so that we can solve for what c ghost is. 286 00:13:29,676 --> 00:13:32,160 AUDIENCE: How do you know what C middle is? 287 00:13:32,160 --> 00:13:34,512 WILLIAM GREEN, JR: C middle is the unknown. 288 00:13:34,512 --> 00:13:35,970 That's what we're going to compute. 289 00:13:35,970 --> 00:13:38,428 We just want an equation that involves C middle, because we 290 00:13:38,428 --> 00:13:39,595 have c middle as an unknown. 291 00:13:39,595 --> 00:13:41,344 We need an equation the involves C middle, 292 00:13:41,344 --> 00:13:42,585 just like we would for-- 293 00:13:42,585 --> 00:13:43,260 if we have a-- 294 00:13:46,874 --> 00:13:50,050 If we have finite volume that is in the interior somewhere, 295 00:13:50,050 --> 00:13:53,790 we have c of this grid point, Cij. 296 00:13:53,790 --> 00:13:55,691 We just want equations that involve Cij. 297 00:13:55,691 --> 00:13:57,690 But we need an equation that somehow connects it 298 00:13:57,690 --> 00:13:58,620 to the boundary conditions. 299 00:13:58,620 --> 00:13:59,120 Yeah. 300 00:13:59,120 --> 00:14:01,710 AUDIENCE: When would you use that second [INAUDIBLE] 301 00:14:01,710 --> 00:14:04,959 if you know C boundary [INAUDIBLE]?? 302 00:14:04,959 --> 00:14:06,000 WILLIAM GREEN, JR: Right. 303 00:14:06,000 --> 00:14:08,610 And actually, I think if you do it this way, in this case, 304 00:14:08,610 --> 00:14:10,361 you get the same formula. 305 00:14:10,361 --> 00:14:11,360 You're running out of C. 306 00:14:11,360 --> 00:14:15,168 AUDIENCE: So when would you use the C ghost? 307 00:14:15,168 --> 00:14:18,230 WILLIAM GREEN, JR: The C ghost thing is 308 00:14:18,230 --> 00:14:22,020 handy when these conditions-- 309 00:14:22,020 --> 00:14:24,477 actually, in the finite volumes, this is it. 310 00:14:24,477 --> 00:14:25,810 I don't think you need to do it. 311 00:14:25,810 --> 00:14:27,260 Maybe if you had a flow, velocity flow here. 312 00:14:27,260 --> 00:14:27,500 I don't know. 313 00:14:27,500 --> 00:14:28,500 But you won't in a wall. 314 00:14:28,500 --> 00:14:33,780 So I don't know if, in the finite difference method, 315 00:14:33,780 --> 00:14:37,140 you can use those ghost points as well to do the flux gutter 316 00:14:37,140 --> 00:14:37,916 conditions. 317 00:14:37,916 --> 00:14:39,540 And that's often useful to do the ghost 318 00:14:39,540 --> 00:14:42,710 thing for if you have a symmetry-imposed flux boundary 319 00:14:42,710 --> 00:14:44,471 condition. 320 00:14:44,471 --> 00:14:44,970 Yeah. 321 00:14:44,970 --> 00:14:48,456 AUDIENCE: [INAUDIBLE] 322 00:14:50,362 --> 00:14:51,820 WILLIAM GREEN, JR: That's the flux. 323 00:14:51,820 --> 00:14:53,528 The flux is coming from across this wall. 324 00:14:53,528 --> 00:14:55,660 And we'll have to add that with the flux coming 325 00:14:55,660 --> 00:14:57,320 this way and the flux coming this way 326 00:14:57,320 --> 00:15:00,580 and the flux coming this way to get our total flux, which 327 00:15:00,580 --> 00:15:07,923 is going to net out to 0 instead of C. Is that all right? 328 00:15:07,923 --> 00:15:10,190 But the other ones, you all know how to write them? 329 00:15:10,190 --> 00:15:12,225 They're just velocity flows. 330 00:15:12,225 --> 00:15:14,250 The nice thing about the finite volume method 331 00:15:14,250 --> 00:15:22,560 is that when you're trying to consider the velocity, 332 00:15:22,560 --> 00:15:25,865 the velocity that matters is actually the velocity here. 333 00:15:25,865 --> 00:15:29,940 It's the flux that couples the two finite values together. 334 00:15:29,940 --> 00:15:31,860 So your velocity is being evaluated halfway 335 00:15:31,860 --> 00:15:36,180 between the two mesh point centers. 336 00:15:36,180 --> 00:15:38,760 This turns out to make the whole procedure more numerically 337 00:15:38,760 --> 00:15:41,250 stable. 338 00:15:41,250 --> 00:15:44,400 You compute the flux by, say, the difference 339 00:15:44,400 --> 00:15:46,130 between these two. 340 00:15:46,130 --> 00:15:50,660 And you're implicitly evaluating right at halfway between. 341 00:15:50,660 --> 00:15:53,000 Other methods, like finite difference, 342 00:15:53,000 --> 00:15:56,240 you're trying to get the velocity or the flux 343 00:15:56,240 --> 00:15:59,700 at the same point here. 344 00:15:59,700 --> 00:16:01,305 And it doesn't really make much sense, 345 00:16:01,305 --> 00:16:03,930 from the point of view of trying to compute how much material's 346 00:16:03,930 --> 00:16:07,210 close to here, to use the velocity right there. 347 00:16:07,210 --> 00:16:10,770 And so when you work out equations, and particularly 348 00:16:10,770 --> 00:16:13,365 the equations that involve pressure, 349 00:16:13,365 --> 00:16:17,340 so suppose you try to discretize the Navier-Stokes equations 350 00:16:17,340 --> 00:16:20,470 and you have a pressure gradient that's driving the flow, 351 00:16:20,470 --> 00:16:22,820 then you have to figure out where are you 352 00:16:22,820 --> 00:16:25,165 going to evaluate the pressures and where are you going 353 00:16:25,165 --> 00:16:26,120 to evaluate the velocities. 354 00:16:26,120 --> 00:16:28,286 And when you try to evaluate them at the same point, 355 00:16:28,286 --> 00:16:31,090 it turns out that you get numerically unstable problems. 356 00:16:31,090 --> 00:16:33,010 But if you do it by this funny volume method, 357 00:16:33,010 --> 00:16:34,385 then it just works out naturally. 358 00:16:34,385 --> 00:16:35,810 It's fine. 359 00:16:35,810 --> 00:16:37,490 And then you need special methods, 360 00:16:37,490 --> 00:16:39,554 if you're going to try to do it where you have 361 00:16:39,554 --> 00:16:41,970 the velocity of the mesh at the same point as the pressure 362 00:16:41,970 --> 00:16:42,990 mesh. 363 00:16:42,990 --> 00:16:44,460 You'll notice in most of the problems we give you, 364 00:16:44,460 --> 00:16:45,585 we just leave pressure out. 365 00:16:45,585 --> 00:16:48,420 We try to rewrite the equations so no pressure ever appears. 366 00:16:48,420 --> 00:16:50,003 And that's because pressure in general 367 00:16:50,003 --> 00:16:55,080 is a problem, because you can have acoustic waves physically. 368 00:16:55,080 --> 00:16:57,647 And if you do the equations, which allow for acoustic waves, 369 00:16:57,647 --> 00:16:59,730 you'll get them in the numerical solution as well. 370 00:16:59,730 --> 00:17:01,380 But usually, we don't care about that. 371 00:17:01,380 --> 00:17:04,770 So you have sound waves racing around your solution, 372 00:17:04,770 --> 00:17:06,849 and that causes a lot of trouble numerically. 373 00:17:06,849 --> 00:17:09,060 So a lot of times, people rewrite the equations 374 00:17:09,060 --> 00:17:12,984 to try to remove the pressure from the equation. 375 00:17:12,984 --> 00:17:14,900 So you write down the Navier-Stokes equations. 376 00:17:14,900 --> 00:17:16,807 You guys did this transport. 377 00:17:16,807 --> 00:17:19,140 Maybe you'll study that today in the class, in the test. 378 00:17:19,140 --> 00:17:19,681 I don't know. 379 00:17:19,681 --> 00:17:22,790 Anyway, there's a pressure term if you just write naturally. 380 00:17:22,790 --> 00:17:25,910 But oftentimes, you can remove that by an equation of state, 381 00:17:25,910 --> 00:17:26,780 for example. 382 00:17:26,780 --> 00:17:28,470 And then you can get rid of it. 383 00:17:28,470 --> 00:17:31,932 And that turns out to be better from the numerical solution. 384 00:17:31,932 --> 00:17:33,380 All right. 385 00:17:33,380 --> 00:17:33,880 Yes. 386 00:17:33,880 --> 00:17:35,060 AUDIENCE: I have a question. 387 00:17:35,060 --> 00:17:37,410 So you said that for this problem, 388 00:17:37,410 --> 00:17:39,165 [INAUDIBLE] was very small. 389 00:17:39,165 --> 00:17:44,667 So that means that these finite volume cells [INAUDIBLE] you 390 00:17:44,667 --> 00:17:45,950 have to do a lot of them. 391 00:17:45,950 --> 00:17:49,648 [INAUDIBLE] gets around this by having a variable volume. 392 00:17:49,648 --> 00:17:52,681 Do we have to address this on that lab that 393 00:17:52,681 --> 00:17:55,396 have some variable volume? 394 00:17:55,396 --> 00:17:57,190 WILLIAM GREEN, JR: OK, so from the point 395 00:17:57,190 --> 00:18:00,570 of view of writing a code, it's a lot easier 396 00:18:00,570 --> 00:18:03,720 to write it with fixed mesh because all equations 397 00:18:03,720 --> 00:18:05,200 look exactly the same. 398 00:18:05,200 --> 00:18:08,320 So I suggest you start that way. 399 00:18:08,320 --> 00:18:13,160 And what you do, if you use a very small value of each, 400 00:18:13,160 --> 00:18:16,090 then I think you'll be able solve it, no problem. 401 00:18:16,090 --> 00:18:18,260 You'll have enough mesh. 402 00:18:18,260 --> 00:18:21,390 Then, once you figure out how to do 403 00:18:21,390 --> 00:18:23,340 that, now you might be able to see, 404 00:18:23,340 --> 00:18:25,116 OK, can my solver solve this? 405 00:18:25,116 --> 00:18:27,240 And then that gets into another question, actually. 406 00:18:27,240 --> 00:18:29,910 What solver are you going to use? 407 00:18:29,910 --> 00:18:34,760 So any ideas about this problem? 408 00:18:34,760 --> 00:18:37,170 AUDIENCE: [INAUDIBLE] 409 00:18:37,170 --> 00:18:40,380 WILLIAM GREEN, JR: So you could use fsolve But I'm telling you, 410 00:18:40,380 --> 00:18:41,480 you're going to have to use a lot of mesh points. 411 00:18:41,480 --> 00:18:42,740 That means that fsolve's going to have to solve 412 00:18:42,740 --> 00:18:43,698 for a lot of variables. 413 00:18:43,698 --> 00:18:45,770 AUDIENCE: 414 00:18:45,770 --> 00:18:47,800 WILLIAM GREEN, JR: Backslash it might be. 415 00:18:47,800 --> 00:18:52,920 So the key thing, the nice thing about this problem 416 00:18:52,920 --> 00:18:56,030 is it's a linear differential equation. 417 00:18:56,030 --> 00:18:59,040 There's no nonlinear term today. 418 00:18:59,040 --> 00:19:01,670 So when you rewrite the equations 419 00:19:01,670 --> 00:19:04,290 of the finite volumes, it's all going 420 00:19:04,290 --> 00:19:07,890 to be linear in the unknowns. 421 00:19:07,890 --> 00:19:10,260 And what else is nice about this problem, when you use 422 00:19:10,260 --> 00:19:12,720 local finite volumes as your-- 423 00:19:12,720 --> 00:19:14,340 It's going to be super-sparse. 424 00:19:14,340 --> 00:19:17,922 So the matrix that comes in is going to be really sparse. 425 00:19:17,922 --> 00:19:20,130 And so you'll want to use some method that can handle 426 00:19:20,130 --> 00:19:23,610 gigantic sparse matrices. 427 00:19:23,610 --> 00:19:25,226 So you wrote a code like that earlier, 428 00:19:25,226 --> 00:19:26,600 so that would be one possibility. 429 00:19:26,600 --> 00:19:29,550 If you know how to use the right flags in MATLAB 430 00:19:29,550 --> 00:19:32,559 to help their built-in solvers handle sparsity, 431 00:19:32,559 --> 00:19:33,600 then that should be good. 432 00:19:33,600 --> 00:19:35,558 If you just ask it to solve it by dense method, 433 00:19:35,558 --> 00:19:37,340 by, like, LEU or something, you're 434 00:19:37,340 --> 00:19:38,923 going to have lot trouble, once you've 435 00:19:38,923 --> 00:19:41,040 put your mesh points in there. 436 00:19:41,040 --> 00:19:42,240 But you can just experiment. 437 00:19:42,240 --> 00:19:43,260 Try bigger and bigger matrices. 438 00:19:43,260 --> 00:19:45,265 And then at some point, if you have backslash, 439 00:19:45,265 --> 00:19:48,530 it will give you a warning or something, unless you tell it 440 00:19:48,530 --> 00:19:51,842 that you're sparse. 441 00:19:51,842 --> 00:19:53,674 All right? 442 00:19:53,674 --> 00:19:56,100 Any more questions that about this? 443 00:19:56,100 --> 00:19:58,350 How would people solve it do you think professionally? 444 00:19:58,350 --> 00:20:01,747 Suppose I was doing a problem like this in 3D instead of 2D. 445 00:20:01,747 --> 00:20:02,830 How would people solve it? 446 00:20:02,830 --> 00:20:03,955 What solver would they use? 447 00:20:03,955 --> 00:20:05,881 AUDIENCE: [INAUDIBLE] 448 00:20:05,881 --> 00:20:07,130 WILLIAM GREEN, JR: Not fsolve. 449 00:20:07,130 --> 00:20:07,745 No. 450 00:20:07,745 --> 00:20:09,417 AUDIENCE: [INAUDIBLE] gradient. 451 00:20:09,417 --> 00:20:12,000 WILLIAM GREEN, JR: Yeah, so they would use conjugate gradient. 452 00:20:12,000 --> 00:20:18,410 So probably-- I think it's called this, BiCGSTAB. 453 00:20:18,410 --> 00:20:19,940 That's the program that we would use 454 00:20:19,940 --> 00:20:23,570 if you have a really, really gigantic sparse matrix. 455 00:20:23,570 --> 00:20:25,370 So that's the conjugate gradient. 456 00:20:25,370 --> 00:20:29,459 And Professor Swan talked about, the advantage 457 00:20:29,459 --> 00:20:31,250 of that is you never have to actually store 458 00:20:31,250 --> 00:20:33,050 the whole matrix. 459 00:20:33,050 --> 00:20:35,390 You only need to evaluate the matrix elements, 460 00:20:35,390 --> 00:20:36,914 and then you can throw them away. 461 00:20:36,914 --> 00:20:38,580 And so if you have a very sparse matrix, 462 00:20:38,580 --> 00:20:40,360 that's pretty cheap to do. 463 00:20:40,360 --> 00:20:42,507 So it's a really good code. 464 00:20:42,507 --> 00:20:44,340 I think in this 2D problem, you can probably 465 00:20:44,340 --> 00:20:45,270 get away with other solvers. 466 00:20:45,270 --> 00:20:45,960 You don't have to use this. 467 00:20:45,960 --> 00:20:47,418 But this is a definite possibility. 468 00:20:47,418 --> 00:20:49,560 This is a built-in MATLAB program as well. 469 00:20:49,560 --> 00:20:53,310 Be warned, though, this is an iterative solver. 470 00:20:53,310 --> 00:20:56,005 It's not just going to be one solve, boom. 471 00:20:56,005 --> 00:20:57,130 And It might have troubles. 472 00:20:59,660 --> 00:21:04,330 So you might want to go with the other ones, but anyway. 473 00:21:04,330 --> 00:21:05,540 May I ask you a question? 474 00:21:05,540 --> 00:21:07,081 How about, do you need initial guess? 475 00:21:12,133 --> 00:21:12,930 What do you think? 476 00:21:12,930 --> 00:21:13,702 AUDIENCE: Depends. 477 00:21:13,702 --> 00:21:15,410 WILLIAM GREEN, JR: Depends on the solver. 478 00:21:15,410 --> 00:21:16,960 So if you solve it with backslash, 479 00:21:16,960 --> 00:21:19,070 do you need an initial guess? 480 00:21:19,070 --> 00:21:22,610 If you can solve it with fsolve, do you have to initial guess? 481 00:21:22,610 --> 00:21:24,230 If you can solve it via BiCGSTAB, 482 00:21:24,230 --> 00:21:26,532 do you have to use initial guess? 483 00:21:26,532 --> 00:21:29,328 AUDIENCE: Yes. 484 00:21:29,328 --> 00:21:30,871 WILLIAM GREEN, JR: Yes. 485 00:21:30,871 --> 00:21:31,370 OK. 486 00:21:31,370 --> 00:21:33,510 So then you have to think about how you really 487 00:21:33,510 --> 00:21:34,676 get your initial guess, too. 488 00:21:34,676 --> 00:21:39,010 So this is things to think about. 489 00:21:39,010 --> 00:21:39,510 All right. 490 00:21:43,680 --> 00:21:45,730 What else to tell you about? 491 00:21:45,730 --> 00:21:50,120 One last thing about PDEs, and we'll 492 00:21:50,120 --> 00:21:54,020 come back to this later, so far we haven't done really 493 00:21:54,020 --> 00:21:56,330 anything that's very time-dependent. 494 00:21:56,330 --> 00:22:00,290 But a lot of real world PDEs have a time dependent in them. 495 00:22:00,290 --> 00:22:02,160 And there's is a very important concept, 496 00:22:02,160 --> 00:22:03,470 a thing called the CFL number. 497 00:22:06,230 --> 00:22:09,230 And this is named after a 1928 paper, 498 00:22:09,230 --> 00:22:10,730 and I'll write the guys' names down. 499 00:22:21,090 --> 00:22:23,700 And what they showed was that, if you're 500 00:22:23,700 --> 00:22:27,300 trying to solve the PDE system, where 501 00:22:27,300 --> 00:22:32,470 you're discretizing in both x and time, 502 00:22:32,470 --> 00:22:35,820 that you have a number that they defined 503 00:22:35,820 --> 00:22:39,630 as delta t times the velocity and the extraction 504 00:22:39,630 --> 00:22:41,920 divided by delta x. 505 00:22:41,920 --> 00:22:43,810 So that's a dimensionless number. 506 00:22:43,810 --> 00:22:46,560 So that's a CFL number. 507 00:22:46,560 --> 00:22:47,940 You see a lot of papers that will 508 00:22:47,940 --> 00:22:49,800 say what CFL number they used. 509 00:22:49,800 --> 00:22:52,620 What that means is the ratio of their time mesh compared 510 00:22:52,620 --> 00:22:54,850 to their space mesh. 511 00:22:54,850 --> 00:23:00,020 And conceptually, let's think about what's happening here. 512 00:23:00,020 --> 00:23:02,020 So suppose we have a flow flowing 513 00:23:02,020 --> 00:23:06,610 in an upwards direction, and we have a bunch 514 00:23:06,610 --> 00:23:08,794 of little finite volumes. 515 00:23:11,960 --> 00:23:14,780 So we've discretized the delta x already. 516 00:23:14,780 --> 00:23:18,250 And this is x. 517 00:23:18,250 --> 00:23:20,770 And there's a flow here. 518 00:23:20,770 --> 00:23:23,207 And I've already decided, somehow, 519 00:23:23,207 --> 00:23:24,540 what length scale I want to use. 520 00:23:24,540 --> 00:23:26,150 So I've decided my delta x. 521 00:23:26,150 --> 00:23:29,430 And now, I'm trying to figure out what delta t I should use. 522 00:23:29,430 --> 00:23:32,180 Now, from the point of view of saving CPU time 523 00:23:32,180 --> 00:23:34,670 I want the delta to be as giant as possible, 524 00:23:34,670 --> 00:23:37,400 because I want to be able to zoom along or predict 525 00:23:37,400 --> 00:23:40,350 for long periods of time what's going to happen in my system. 526 00:23:40,350 --> 00:23:42,009 But if I make delta t really large, 527 00:23:42,009 --> 00:23:43,300 let's think about what happens. 528 00:23:43,300 --> 00:23:51,980 Suppose I choose delta t to be 10 times delta x divided by u. 529 00:23:51,980 --> 00:23:53,940 So it means that in my one time step, 530 00:23:53,940 --> 00:23:57,289 I have some guess or some current value 531 00:23:57,289 --> 00:23:59,330 of the concentrations in all these finite values. 532 00:24:01,840 --> 00:24:08,960 And then I wait through a time step that's 533 00:24:08,960 --> 00:24:12,320 10 times delta x over ux. 534 00:24:12,320 --> 00:24:14,830 So I had some stuff that was here. 535 00:24:14,830 --> 00:24:18,320 Where is that going to be 10 times later? 536 00:24:18,320 --> 00:24:20,877 10 time steps later. 537 00:24:20,877 --> 00:24:21,710 10 blocks up, right? 538 00:24:21,710 --> 00:24:26,140 So it's going to be, like, way up here somewhere. 539 00:24:26,140 --> 00:24:29,680 And so what's going to happen there 540 00:24:29,680 --> 00:24:34,980 is that my numerical methods are all computing stuff locally 541 00:24:34,980 --> 00:24:36,860 from the spatial derivatives. 542 00:24:36,860 --> 00:24:39,860 But it's crazy if, between my time steps, 543 00:24:39,860 --> 00:24:42,140 this stuff completely left the picture. 544 00:24:42,140 --> 00:24:44,726 It's already convected all the way off the screen. 545 00:24:44,726 --> 00:24:46,850 And some new stuff, which was way down here before, 546 00:24:46,850 --> 00:24:48,624 is now the stuff that's here. 547 00:24:48,624 --> 00:24:50,880 Should be there if I was physical. 548 00:24:50,880 --> 00:24:54,120 Numerically, who knows what will happen if you try to do this. 549 00:24:54,120 --> 00:24:56,130 But it won't be good. 550 00:24:56,130 --> 00:24:59,040 So the condition is that you need 551 00:24:59,040 --> 00:25:03,060 this number to be less than 1, or same order of magnitude 552 00:25:03,060 --> 00:25:06,081 as 1, and you try to make this much bigger than 1, 553 00:25:06,081 --> 00:25:08,080 then you're doing something crazy because you're 554 00:25:08,080 --> 00:25:13,210 convecting stuff over multiple mesh points. 555 00:25:13,210 --> 00:25:16,649 And so that turns out to be a very serious limitation if you 556 00:25:16,649 --> 00:25:18,190 try to do simulations for, let's say, 557 00:25:18,190 --> 00:25:21,070 a reacting flow for a long period of time, 558 00:25:21,070 --> 00:25:23,480 because you might have to use a really tiny delta t. 559 00:25:23,480 --> 00:25:27,010 And then people have developed all different fancy methods 560 00:25:27,010 --> 00:25:28,720 to try to get around that. 561 00:25:28,720 --> 00:25:32,170 But if you just do the obvious things to do, 562 00:25:32,170 --> 00:25:33,805 you'll always run into this limitation. 563 00:25:33,805 --> 00:25:37,970 Then you need to choose the time steps small. 564 00:25:37,970 --> 00:25:43,190 And also, it's bad, because as you make delta x smaller, which 565 00:25:43,190 --> 00:25:45,780 improves your accuracy, You'll have to make 566 00:25:45,780 --> 00:25:47,720 your delta t's smaller, too. 567 00:25:47,720 --> 00:25:50,690 But of course, making delta x smaller increases your CPU time 568 00:25:50,690 --> 00:25:53,360 because you have more finite volumes to compute. 569 00:25:53,360 --> 00:25:55,040 And then you'll also have to make double t smaller, which 570 00:25:55,040 --> 00:25:55,910 means you'll have to do more time steps, too. 571 00:25:55,910 --> 00:25:58,040 So it's even like a double whammy. 572 00:25:58,040 --> 00:26:01,400 So getting more accuracy is going to really cost you badly. 573 00:26:01,400 --> 00:26:05,520 And so this another reason why people used to always 574 00:26:05,520 --> 00:26:06,862 refer to color fluid dynamics. 575 00:26:06,862 --> 00:26:08,820 You can make a pretty picture, but it might not 576 00:26:08,820 --> 00:26:09,935 be physical at all. 577 00:26:09,935 --> 00:26:12,060 Because you can make it solve equations that maybe, 578 00:26:12,060 --> 00:26:13,470 for example, didn't impose this, then 579 00:26:13,470 --> 00:26:14,970 who knows what kind of crazy stuff you'll get. 580 00:26:14,970 --> 00:26:16,050 You'll got something. 581 00:26:16,050 --> 00:26:18,000 It'll compute something, but it may have no relation 582 00:26:18,000 --> 00:26:18,833 to the real problem. 583 00:26:23,104 --> 00:26:24,770 I think that's all I was say about PDEs. 584 00:26:24,770 --> 00:26:26,811 Are there any questions about PDEs before I start 585 00:26:26,811 --> 00:26:28,128 talking about probability? 586 00:26:30,811 --> 00:26:31,810 You got it totally down. 587 00:26:31,810 --> 00:26:34,018 I'm looking forward to some really awesome solutions. 588 00:26:34,018 --> 00:26:34,887 How about that? 589 00:26:44,940 --> 00:26:46,090 Just one last comment. 590 00:26:46,090 --> 00:26:48,550 If you decide you wanted to do adaptive meshing 591 00:26:48,550 --> 00:26:53,380 and you want to change your mesh size, 592 00:26:53,380 --> 00:26:56,369 you can choose measures like this if you want. 593 00:26:56,369 --> 00:26:57,910 And you can even do things like this, 594 00:26:57,910 --> 00:26:58,940 where you have a bigger mesh, and then 595 00:26:58,940 --> 00:27:00,731 maybe have two smaller meshes underneath it 596 00:27:00,731 --> 00:27:03,040 in the next trial. 597 00:27:03,040 --> 00:27:05,120 So you can just have stuff flowing here, 598 00:27:05,120 --> 00:27:08,557 stuff flowing here stuff flowing there. 599 00:27:08,557 --> 00:27:10,390 So you can do all kinds of crazy stuff like. 600 00:27:10,390 --> 00:27:13,870 This can really help improve the accuracy of the solution a lot. 601 00:27:13,870 --> 00:27:16,300 But it's, I would say, very prone to bugs. 602 00:27:16,300 --> 00:27:18,220 So if you do this, be really careful 603 00:27:18,220 --> 00:27:19,240 and don't do it too often, I would say. 604 00:27:19,240 --> 00:27:20,260 You might have a few boundaries where 605 00:27:20,260 --> 00:27:22,870 you do something funky like that to change that mesh size. 606 00:27:22,870 --> 00:27:24,480 But don't go crazy with it. 607 00:27:24,480 --> 00:27:25,650 [INAUDIBLE] is smart. 608 00:27:25,650 --> 00:27:27,900 It has a really nice way of doing the meshing for you. 609 00:27:27,900 --> 00:27:32,170 So that's its advantage, that somebody very carefully coded 610 00:27:32,170 --> 00:27:34,660 how to handle this kind of stuff in a general case. 611 00:27:34,660 --> 00:27:36,160 But if you guys are doing it for the first time, 612 00:27:36,160 --> 00:27:37,260 it might not be so good. 613 00:27:41,330 --> 00:27:42,590 So that's enough of PDEs. 614 00:27:42,590 --> 00:27:45,040 Let's talk about probability. 615 00:28:09,040 --> 00:28:13,750 So probability is everywhere, except in undergraduate ChemE 616 00:28:13,750 --> 00:28:14,500 homework problems. 617 00:28:17,200 --> 00:28:20,142 So when you do problems as an undergraduate, 618 00:28:20,142 --> 00:28:21,600 they always had some nice solution. 619 00:28:21,600 --> 00:28:25,050 It was 2 pi, it was 3.0. 620 00:28:25,050 --> 00:28:27,580 Everything was, like, deterministic, is definite. 621 00:28:27,580 --> 00:28:29,182 The grader could go through. 622 00:28:29,182 --> 00:28:30,265 Oh, no, you're off by 0.1. 623 00:28:30,265 --> 00:28:33,820 It couldn't possibly be right. 624 00:28:33,820 --> 00:28:35,050 That's, like, not reality. 625 00:28:35,050 --> 00:28:37,300 So any time you actually make a measurement, 626 00:28:37,300 --> 00:28:38,855 you always had measurement noise. 627 00:28:38,855 --> 00:28:40,480 And if you try to repeat a measurement, 628 00:28:40,480 --> 00:28:42,340 you don't get the same result. So that's, 629 00:28:42,340 --> 00:28:45,630 like, completely different than an undergraduate problem. 630 00:28:45,630 --> 00:28:47,120 But this is the reality. 631 00:28:47,120 --> 00:28:51,480 So the reality is the world is, like, not so nice as you think. 632 00:28:51,480 --> 00:28:53,191 But actually, it's even more fundamental. 633 00:28:53,191 --> 00:28:54,690 It's nothing about-- I mean, there's 634 00:28:54,690 --> 00:28:56,440 one problem about how good an experimental 635 00:28:56,440 --> 00:28:59,550 those people are, and how fancy an apparatus 636 00:28:59,550 --> 00:29:03,240 you bought that can make things exactly reproducible. 637 00:29:03,240 --> 00:29:06,720 But even if you do that perfectly, the equations we 638 00:29:06,720 --> 00:29:10,590 use really don't correspond to the real physical reality. 639 00:29:10,590 --> 00:29:12,765 So we always use the continuum equations. 640 00:29:12,765 --> 00:29:16,680 You guys probably are studying them a lot in 1040 and 1050, 641 00:29:16,680 --> 00:29:19,314 especially 1050, I guess. 642 00:29:19,314 --> 00:29:20,730 But those equations are really all 643 00:29:20,730 --> 00:29:24,330 derived from averages over ensembles 644 00:29:24,330 --> 00:29:26,190 or little finite volumes or something 645 00:29:26,190 --> 00:29:29,760 if you look at the derivation of the equations. 646 00:29:29,760 --> 00:29:33,830 And reality is that the world is full of molecules. 647 00:29:33,830 --> 00:29:38,160 And so they're all wiggling around. 648 00:29:38,160 --> 00:29:39,930 And if you look in a little finite volume, 649 00:29:39,930 --> 00:29:41,280 you look right now, you'll see that there's 650 00:29:41,280 --> 00:29:42,520 27 molecules in there. 651 00:29:42,520 --> 00:29:44,690 If you look a second later, there might be 28. 652 00:29:44,690 --> 00:29:46,770 Then a little later, maybe 26. 653 00:29:46,770 --> 00:29:49,770 It's always fluctuating around. 654 00:29:49,770 --> 00:29:52,860 But according to our average equations that we use, 655 00:29:52,860 --> 00:29:56,805 like in the Navier-Stokes equations, it always 27.3. 656 00:29:56,805 --> 00:29:58,680 But of course, there's not 0.3 of a molecule. 657 00:29:58,680 --> 00:30:00,980 So, I mean, explicitly, it's the average 658 00:30:00,980 --> 00:30:03,750 is what we're computing, and the reality 659 00:30:03,750 --> 00:30:06,520 is fluctuating around the edges. 660 00:30:06,520 --> 00:30:08,250 Same thing in thermo. 661 00:30:08,250 --> 00:30:11,490 We say that such-and-such has a certain amount of energy. 662 00:30:11,490 --> 00:30:14,970 But you guys have some [INAUDIBLE] already, yes? 663 00:30:14,970 --> 00:30:17,250 So you saw that's not true? 664 00:30:17,250 --> 00:30:19,180 So really, all that's saying is that's, like, 665 00:30:19,180 --> 00:30:20,660 the probability, the average. 666 00:30:20,660 --> 00:30:24,112 If you've had many, many ensembles that 667 00:30:24,112 --> 00:30:26,070 were exactly the same and you average them all, 668 00:30:26,070 --> 00:30:28,194 you get some number and that's your average energy. 669 00:30:28,194 --> 00:30:30,105 But for any actual realization, it 670 00:30:30,105 --> 00:30:31,730 has some different value of the energy. 671 00:30:35,380 --> 00:30:37,680 And it's even worse than that. 672 00:30:37,680 --> 00:30:40,362 That's because we have a lot of particles. 673 00:30:40,362 --> 00:30:42,570 You can even go down to, like, the microscopic level, 674 00:30:42,570 --> 00:30:44,629 where you have one molecule. 675 00:30:44,629 --> 00:30:46,670 And you calculate things about that, it turns out 676 00:30:46,670 --> 00:30:48,340 you have to use the Schrodinger equation for that. 677 00:30:48,340 --> 00:30:49,480 And the Schrodinger equation explicitly 678 00:30:49,480 --> 00:30:50,725 only gives you probability densities. 679 00:30:50,725 --> 00:30:52,270 So it just tells you the probability 680 00:30:52,270 --> 00:30:53,800 the molecule might be somewhere, the electron 681 00:30:53,800 --> 00:30:56,110 might be somewhere, the energy might be something. 682 00:30:56,110 --> 00:30:58,240 But it's not actually whether it really is. 683 00:30:58,240 --> 00:31:00,430 It's just saying a probability distribution. 684 00:31:00,430 --> 00:31:02,638 And every time you do the experiment on the molecule, 685 00:31:02,638 --> 00:31:04,090 you get a different result. 686 00:31:04,090 --> 00:31:07,190 Now, this is super-annoying, but it's the way life is. 687 00:31:07,190 --> 00:31:09,190 Einstein got so annoyed, he has a famous saying, 688 00:31:09,190 --> 00:31:10,606 and it's "God does not play dice." 689 00:31:10,606 --> 00:31:13,250 He was, like, just completely annoyed at these equations. 690 00:31:13,250 --> 00:31:16,300 But it's the way it is. 691 00:31:16,300 --> 00:31:20,980 So the reality is that things, all we know about, really, 692 00:31:20,980 --> 00:31:22,500 are probability distributions. 693 00:31:22,500 --> 00:31:24,730 In most of our work, in our lives, 694 00:31:24,730 --> 00:31:27,799 we always talk about, like, the mean or the median. 695 00:31:27,799 --> 00:31:29,590 And we're talking as if it's a real number. 696 00:31:29,590 --> 00:31:32,470 But really, it's always some distribution. 697 00:31:32,470 --> 00:31:34,840 So it's time, I guess, you're in graduate school, 698 00:31:34,840 --> 00:31:36,680 it's time to, like, face up to this. 699 00:31:36,680 --> 00:31:38,138 And that's what we're going to talk 700 00:31:38,138 --> 00:31:39,826 about for the next week or two. 701 00:31:43,695 --> 00:31:46,774 AUDIENCE: [INAUDIBLE] 702 00:31:46,774 --> 00:31:48,190 WILLIAM GREEN, JR: This also makes 703 00:31:48,190 --> 00:31:49,270 it makes you wonder what you're doing 704 00:31:49,270 --> 00:31:50,600 when you make a measurement. 705 00:31:50,600 --> 00:31:53,769 So if you make a measurement, first of all, the fact 706 00:31:53,769 --> 00:31:55,560 that when you measure something repeatedly, 707 00:31:55,560 --> 00:31:58,270 you're not going to get the same number, that's alarming. 708 00:31:58,270 --> 00:32:00,640 Because I want to say I'm 5 foot 9", 709 00:32:00,640 --> 00:32:03,305 this should be pretty common, I'm always 5 foot 9". 710 00:32:03,305 --> 00:32:05,680 But actually, if you measure me multiple times, sometimes 711 00:32:05,680 --> 00:32:07,870 you'll get 5' 9 and 1/4" Some people will get 5' 712 00:32:07,870 --> 00:32:13,450 8 and 3/4" So it might make you worry, did I change? 713 00:32:13,450 --> 00:32:17,620 Did I grow between the measurements? 714 00:32:17,620 --> 00:32:19,300 So that's one issue. 715 00:32:23,680 --> 00:32:31,035 Because our experiments are not repeatable 716 00:32:31,035 --> 00:32:32,660 and we get different numbers every time 717 00:32:32,660 --> 00:32:35,414 we make a measurement, then we have a big problem. 718 00:32:35,414 --> 00:32:36,830 Somebody says, well, I really want 719 00:32:36,830 --> 00:32:38,720 to know how tall Professor Green is. 720 00:32:38,720 --> 00:32:41,299 I've always wondered, how tall is he? 721 00:32:41,299 --> 00:32:43,090 And everybody's told me a different number. 722 00:32:43,090 --> 00:32:44,465 And when you go measure it again, 723 00:32:44,465 --> 00:32:45,860 you get a different number again. 724 00:32:45,860 --> 00:32:48,380 What's going on? 725 00:32:48,380 --> 00:32:49,970 And so you'll have to then-- then we 726 00:32:49,970 --> 00:32:51,740 have, like, a concept that there is 727 00:32:51,740 --> 00:32:54,170 a true height of Professor Green and we just 728 00:32:54,170 --> 00:32:56,160 don't know what it is. 729 00:32:56,160 --> 00:32:57,950 And then we'll try maybe to make repeated 730 00:32:57,950 --> 00:33:01,637 measurements of my height, and then maybe take the average. 731 00:33:01,637 --> 00:33:03,220 That would be the obvious thing to do. 732 00:33:03,220 --> 00:33:04,952 And we take the average and report that. 733 00:33:04,952 --> 00:33:06,910 We'll tell the boss, we'll lie to him, say, oh, 734 00:33:06,910 --> 00:33:08,395 Professor Green's 5 foot 9". 735 00:33:08,395 --> 00:33:10,520 When really, we never actually measured 5' foot 9". 736 00:33:10,520 --> 00:33:14,355 Every time we measured, it was 5' 9 and 1/8", 5' 8 and 3/4". 737 00:33:14,355 --> 00:33:15,980 Every time, it was something different. 738 00:33:15,980 --> 00:33:17,470 But we just say, OK, it's 5' 9". 739 00:33:17,470 --> 00:33:19,400 And the boss, he doesn't want to know about all this complexity, 740 00:33:19,400 --> 00:33:20,733 anyway, so he just believes you. 741 00:33:20,733 --> 00:33:22,460 So it takes your average number. 742 00:33:22,460 --> 00:33:27,290 But you know that you're not really sure I'm exactly 5' 9" 743 00:33:27,290 --> 00:33:30,560 And so you have a probability distribution, 744 00:33:30,560 --> 00:33:32,280 and you're doing your best guess. 745 00:33:32,280 --> 00:33:34,310 And in fact, if you're honest to your boss, 746 00:33:34,310 --> 00:33:35,170 you'll give him an error bar. 747 00:33:35,170 --> 00:33:37,211 You'll say he's 5' 9", plus or minus 1/2 an inch. 748 00:33:39,980 --> 00:33:41,657 And that way, what you're saying is 749 00:33:41,657 --> 00:33:43,865 you're pretty sure the true height of Professor Green 750 00:33:43,865 --> 00:33:44,990 is somewhere in that range. 751 00:33:47,340 --> 00:33:48,630 Is this OK? 752 00:33:48,630 --> 00:33:49,260 Yeah. 753 00:33:49,260 --> 00:33:52,760 Now it might be that I'm actually changing height. 754 00:33:52,760 --> 00:33:55,010 I get a good night's rest, I lie down for a long time. 755 00:33:55,010 --> 00:33:55,820 Maybe when I stretch out a little bit. 756 00:33:55,820 --> 00:33:58,195 When I stand up in front of lecture here for a long time, 757 00:33:58,195 --> 00:33:59,005 I'm shrinking. 758 00:33:59,005 --> 00:34:00,380 My vertebrae are being compressed 759 00:34:00,380 --> 00:34:01,421 by standing here so long. 760 00:34:01,421 --> 00:34:03,680 So it's, like, a combination of things. 761 00:34:03,680 --> 00:34:05,870 One is your measurement system is not perfect, 762 00:34:05,870 --> 00:34:09,040 and one is that I actually might be fluctuating. 763 00:34:09,040 --> 00:34:10,800 I had a big breakfast, I'm growing. 764 00:34:13,310 --> 00:34:14,859 So is it true with everything? 765 00:34:14,859 --> 00:34:16,400 Every experiment you do is like this, 766 00:34:16,400 --> 00:34:19,639 that there is a real fluctuation of the real, physical apparatus 767 00:34:19,639 --> 00:34:22,340 of the thing that you're trying to measure because mostly, 768 00:34:22,340 --> 00:34:24,340 things we're trying to measure have fluctuations 769 00:34:24,340 --> 00:34:25,159 intrinsically. 770 00:34:25,159 --> 00:34:28,570 And then on top of that, your measurement device 771 00:34:28,570 --> 00:34:30,590 is fluctuating, which means-- and then 772 00:34:30,590 --> 00:34:32,298 the combination is what you're measuring. 773 00:34:32,298 --> 00:34:35,270 It gives you fluctuation. 774 00:34:35,270 --> 00:34:36,949 If you have a very nice instrument, 775 00:34:36,949 --> 00:34:38,719 the fluctuation of your instrument 776 00:34:38,719 --> 00:34:41,239 is smaller than the fluctuation in the real system 777 00:34:41,239 --> 00:34:42,830 and you'll go down to the limit. 778 00:34:42,830 --> 00:34:44,000 Anybody with a really good instrument 779 00:34:44,000 --> 00:34:45,920 should measure approximately the same probability distribution, 780 00:34:45,920 --> 00:34:47,544 which is actually the real fluctuation. 781 00:34:47,544 --> 00:34:48,760 My height, for example. 782 00:34:48,760 --> 00:34:50,385 So if you bought a laser interferometer 783 00:34:50,385 --> 00:34:53,389 and mounted a mirror on my head, and measured my height 784 00:34:53,389 --> 00:34:55,130 to the wavelength of light, you're 785 00:34:55,130 --> 00:34:57,080 pretty sure that it's pretty good. 786 00:34:57,080 --> 00:34:58,880 It's within a wavelength of light. 787 00:34:58,880 --> 00:35:00,796 So the error bar there is just due to the fact 788 00:35:00,796 --> 00:35:02,620 that I slouch sometimes. 789 00:35:02,620 --> 00:35:03,450 Is that OK? 790 00:35:07,300 --> 00:35:09,650 So let's talk about some basic things about probability. 791 00:35:09,650 --> 00:35:13,850 So we're always saying there's a probability of an event. 792 00:35:19,710 --> 00:35:21,500 And so we want to give a number. 793 00:35:21,500 --> 00:35:23,570 So for example, I'm flipping coins. 794 00:35:23,570 --> 00:35:26,360 I flip a penny, it could be heads or tails. 795 00:35:26,360 --> 00:35:31,902 I'll say the probability of heads 796 00:35:31,902 --> 00:35:35,950 is approximately equal to 1/2. 797 00:35:35,950 --> 00:35:42,230 So I flipped the coin, and if you flip the coin 100 times, 798 00:35:42,230 --> 00:35:43,880 you might expect to see 50 heads. 799 00:35:43,880 --> 00:35:47,600 Now, it could be 49 heads, it could be 51 heads. 800 00:35:47,600 --> 00:35:50,060 So you have to worry about, like, exactly how precisely you 801 00:35:50,060 --> 00:35:50,560 know it. 802 00:35:50,560 --> 00:35:52,750 But you think it's something like a half. 803 00:35:52,750 --> 00:35:55,700 Now, just to warn you, I actually 804 00:35:55,700 --> 00:35:58,830 didn't specify any more significant figures here, 805 00:35:58,830 --> 00:36:00,750 and it might be really hard to figure out what 806 00:36:00,750 --> 00:36:02,312 those significant figures are. 807 00:36:02,312 --> 00:36:04,270 And this is related to the measurement problem. 808 00:36:04,270 --> 00:36:07,620 So we think that a coin has about a 50/50 chance 809 00:36:07,620 --> 00:36:08,880 of being heads or tails. 810 00:36:08,880 --> 00:36:10,700 But if you really wanted to prove it, 811 00:36:10,700 --> 00:36:13,090 that might be really hard to do. 812 00:36:13,090 --> 00:36:15,268 You can have joint probabilities. 813 00:36:20,890 --> 00:36:27,640 So suppose I have a penny and I have a dime. 814 00:36:27,640 --> 00:36:30,430 And I try to think, if I flipped them both, what could happen? 815 00:36:30,430 --> 00:36:33,194 I could have that they both come up heads. 816 00:36:33,194 --> 00:36:35,360 I could have this guy come up heads, this guy tails. 817 00:36:35,360 --> 00:36:38,470 This guy tails, this heads, tails. 818 00:36:38,470 --> 00:36:40,504 So there's, like, four possible outcomes, 819 00:36:40,504 --> 00:36:42,420 and we think they all have about approximately 820 00:36:42,420 --> 00:36:43,815 equal probabilities. 821 00:36:43,815 --> 00:36:45,940 So the probability of any of these things happening 822 00:36:45,940 --> 00:36:46,773 should be about 1/4. 823 00:36:49,900 --> 00:36:59,560 So you can write the probability of event 1 and event 2. 824 00:37:02,320 --> 00:37:04,330 So this would be, for example, the probability 825 00:37:04,330 --> 00:37:08,180 that I got heads for penny and heads for dime, 826 00:37:08,180 --> 00:37:09,850 and I think that this is about 1/4. 827 00:37:19,276 --> 00:37:32,802 Now, I could also say the probability of heads, 828 00:37:32,802 --> 00:37:37,620 and heads is equal to the probability of heads 829 00:37:37,620 --> 00:37:45,090 for the penny times the probability of heads 830 00:37:45,090 --> 00:37:53,090 for the dime if I got heads for the penny. 831 00:37:53,090 --> 00:37:58,860 Now, if these two coin flips are completely uncorrelated, 832 00:37:58,860 --> 00:38:02,310 then the probability of heads on the dime and heads on the penny 833 00:38:02,310 --> 00:38:02,830 is the same. 834 00:38:02,830 --> 00:38:04,955 It's just the probability of the heads on the dime. 835 00:38:04,955 --> 00:38:06,390 So they don't matter. 836 00:38:06,390 --> 00:38:09,992 But many things that we'll study are correlated. 837 00:38:09,992 --> 00:38:11,700 That the probability of something happens 838 00:38:11,700 --> 00:38:13,650 depends on whether something else happened. 839 00:38:17,320 --> 00:38:19,780 So this kind of expression is very important. 840 00:38:19,780 --> 00:38:21,080 Now, this is just an equality. 841 00:38:21,080 --> 00:38:24,070 It's like a definition of what these are, right? 842 00:38:24,070 --> 00:38:26,320 And I'll just notice you can write that the other way 843 00:38:26,320 --> 00:38:26,830 around. 844 00:38:26,830 --> 00:38:31,550 So it's the probability of heads on the dime 845 00:38:31,550 --> 00:38:34,780 times the probability of heads on the penny. 846 00:38:41,486 --> 00:38:43,950 This is OK? 847 00:38:43,950 --> 00:38:46,250 So these two guys are equal to each other, 848 00:38:46,250 --> 00:38:48,860 and you can rearrange that equation any way you want. 849 00:38:48,860 --> 00:38:50,570 And we'll come back to a very famous way 850 00:38:50,570 --> 00:38:51,611 to rewrite that equation. 851 00:38:51,611 --> 00:38:54,320 It's called Bayes' theorem, and that turns out 852 00:38:54,320 --> 00:38:57,486 to be really important in model versus data comparisons. 853 00:39:02,450 --> 00:39:07,100 Instead of doing AND, do OR. 854 00:39:07,100 --> 00:39:10,420 So maybe you can say, then, what's the probability 855 00:39:10,420 --> 00:39:13,350 that I see at least one head? 856 00:39:19,240 --> 00:39:22,910 So I flip my two coins, and I have the probability of, 857 00:39:22,910 --> 00:39:24,382 I see at least one head. 858 00:39:28,520 --> 00:39:30,935 So we know we intuitively the answer is 3/4. 859 00:39:33,500 --> 00:39:36,260 But let's try to think of where does that really come from. 860 00:39:41,340 --> 00:39:42,684 So-- 861 00:39:42,684 --> 00:39:44,492 [HIGH-PITCHED SOUND] 862 00:39:44,492 --> 00:39:45,400 What is that? 863 00:39:50,874 --> 00:39:51,870 Sorry. 864 00:39:51,870 --> 00:39:54,900 Really threw me there. 865 00:39:54,900 --> 00:39:57,400 So probability of at least one head, 866 00:39:57,400 --> 00:40:02,685 it's not equal to the probability of head 867 00:40:02,685 --> 00:40:07,656 for the penny plus the probability of head 868 00:40:07,656 --> 00:40:13,130 for the dime, because we know this is really 3/4, 869 00:40:13,130 --> 00:40:15,220 and this is 1/2, this is 1/2. 870 00:40:15,220 --> 00:40:19,190 You add them up, 1/2 plus 1/2 does not equal to 3/4. 871 00:40:19,190 --> 00:40:22,890 So be careful. 872 00:40:22,890 --> 00:40:26,000 There's a lot of things you can say quickly that are not true. 873 00:40:28,940 --> 00:40:33,230 So anyway, you really have to consider the whole thing. 874 00:40:33,230 --> 00:40:36,304 And in the best case, if you can enumerate 875 00:40:36,304 --> 00:40:38,720 what's going to happen, it's very simple to add up things. 876 00:40:38,720 --> 00:40:41,380 Otherwise, you have to be very careful with the algebra 877 00:40:41,380 --> 00:40:43,506 to make sure you add all things correctly. 878 00:40:52,840 --> 00:40:55,000 Let's see at least what this should be equal to. 879 00:40:55,000 --> 00:40:56,890 So this should be equal to the probability 880 00:40:56,890 --> 00:41:03,900 that a head on a penny times the probability 881 00:41:03,900 --> 00:41:18,570 that I have head for the dime if I had a head for the penny 882 00:41:18,570 --> 00:41:23,696 plus probability of the tail for the dime 883 00:41:23,696 --> 00:41:30,244 or for the penny plus the probability that I 884 00:41:30,244 --> 00:41:39,450 have for the dime and then times something like this, too. 885 00:41:44,050 --> 00:41:46,810 And in a case like this, where I'm summing 886 00:41:46,810 --> 00:41:48,070 over all of the possibilities. 887 00:41:48,070 --> 00:41:49,540 So in this case, I'm either going 888 00:41:49,540 --> 00:41:50,740 to get a head for the dime or a tail for the dime. 889 00:41:50,740 --> 00:41:52,281 It's not going to balance on its end. 890 00:41:52,281 --> 00:41:54,760 I'm assuming that that chance is 0. 891 00:41:54,760 --> 00:42:00,636 Then these two things just add up to 1. 892 00:42:00,636 --> 00:42:03,044 Is that all right? 893 00:42:03,044 --> 00:42:04,960 It's really saying the probability of the dime 894 00:42:04,960 --> 00:42:09,590 will do something if I have a head for the penny. 895 00:42:09,590 --> 00:42:11,580 Is this all right? 896 00:42:11,580 --> 00:42:14,610 So you want to practice doing little algebra things like this 897 00:42:14,610 --> 00:42:16,068 to make sure you know how to do it. 898 00:42:20,500 --> 00:42:21,000 Yes? 899 00:42:21,000 --> 00:42:21,200 No? 900 00:42:21,200 --> 00:42:21,700 Maybe? 901 00:42:28,240 --> 00:42:30,518 Let's see what else I've got here. 902 00:42:49,748 --> 00:42:50,724 AUDIENCE: Professor. 903 00:42:50,724 --> 00:42:51,640 WILLIAM GREEN, JR: Yes 904 00:42:51,640 --> 00:42:54,340 AUDIENCE: What you just wrote, [INAUDIBLE] 905 00:42:54,340 --> 00:42:56,381 WILLIAM GREEN, JR: Yeah, what's the correct thing 906 00:42:56,381 --> 00:42:57,232 to write in here? 907 00:43:06,940 --> 00:43:07,940 What is the right thing? 908 00:43:12,833 --> 00:43:13,499 AUDIENCE: Tails. 909 00:43:32,300 --> 00:43:33,300 WILLIAM GREEN, JR: Yeah. 910 00:43:33,300 --> 00:43:34,130 So it's tricky. 911 00:43:34,130 --> 00:43:34,630 Yeah. 912 00:43:34,630 --> 00:43:40,521 AUDIENCE: The probability [INAUDIBLE] 913 00:43:40,521 --> 00:43:42,270 WILLIAM GREEN, JR: Yeah, it's the easy way 914 00:43:42,270 --> 00:43:44,320 to do it, for this case. 915 00:43:44,320 --> 00:43:46,367 And so there's, like, a lot of-- 916 00:43:46,367 --> 00:43:48,700 for some cases, it might be easier to write it this way. 917 00:43:48,700 --> 00:43:50,074 In some cases, write it that way. 918 00:43:50,074 --> 00:43:54,060 It depends on how many different options there are. 919 00:43:54,060 --> 00:43:58,665 So anyway, I'm just trying to warn you by writing this out. 920 00:43:58,665 --> 00:44:00,540 It's like, you might write down stuff quickly 921 00:44:00,540 --> 00:44:01,920 without thinking about it. 922 00:44:01,920 --> 00:44:03,360 And it's easy to double count. 923 00:44:03,360 --> 00:44:05,850 Like for example, if you put the other term in here, 924 00:44:05,850 --> 00:44:06,850 you double count. 925 00:44:06,850 --> 00:44:10,890 Because you already have, they had head, 926 00:44:10,890 --> 00:44:12,640 you already had the head case here. 927 00:44:21,830 --> 00:44:25,515 Yeah, maybe-- Did I write the-- 928 00:44:25,515 --> 00:44:27,890 I'll just write the base theorem down the way you usually 929 00:44:27,890 --> 00:44:29,370 see it. 930 00:44:29,370 --> 00:44:31,520 So this is the general expression, 931 00:44:31,520 --> 00:44:33,470 which is always true. 932 00:44:33,470 --> 00:44:43,970 The base theorem way to write it is the probability of A given B 933 00:44:43,970 --> 00:44:53,714 is equal to the probability of B given A times the probability 934 00:44:53,714 --> 00:44:59,490 of A over the probability of B. 935 00:44:59,490 --> 00:45:06,724 And that's just rearranging this equality. 936 00:45:06,724 --> 00:45:07,390 Rearrange again. 937 00:45:09,970 --> 00:45:14,007 And we'll come back to this with the situation 938 00:45:14,007 --> 00:45:16,090 that's like, what's the probability that Professor 939 00:45:16,090 --> 00:45:20,440 Green is 5' 9", given our measurements, 940 00:45:20,440 --> 00:45:23,650 is related to the probability that if Professor Green was 5' 941 00:45:23,650 --> 00:45:27,300 9", we would have made the measurements we got. 942 00:45:27,300 --> 00:45:30,510 So this is like that way to invert that statement. 943 00:45:39,780 --> 00:45:47,355 And if the thing that's here is exclusive, 944 00:45:47,355 --> 00:45:49,690 it means there's, like, many possible things that 945 00:45:49,690 --> 00:45:50,934 could happen. 946 00:45:50,934 --> 00:45:53,240 This is the probability that one of them happened. 947 00:45:53,240 --> 00:45:54,660 There's a lot of other things that could have happened. 948 00:45:54,660 --> 00:45:56,090 For instance, like heads and tails, it's either heads 949 00:45:56,090 --> 00:45:56,700 or it's tails. 950 00:45:56,700 --> 00:45:57,610 It's exclusive. 951 00:45:57,610 --> 00:46:06,730 If it's like that, you could rewrite that probability of B 952 00:46:06,730 --> 00:46:19,150 is equal to probability of Aj, probability of B given Aj 953 00:46:19,150 --> 00:46:21,940 summed over j. 954 00:46:21,940 --> 00:46:25,210 This is something, whatever A measurement 955 00:46:25,210 --> 00:46:29,700 it is, if it ends up with B, that's probability B. 956 00:46:29,700 --> 00:46:31,910 Is that all right? 957 00:46:31,910 --> 00:46:34,650 So you can put that into the denominator here. 958 00:46:34,650 --> 00:46:36,440 You can substitute that in so you 959 00:46:36,440 --> 00:46:41,633 can rewrite this as probability of Ai 960 00:46:41,633 --> 00:46:50,142 given B is equal to the probability of B given Ai 961 00:46:50,142 --> 00:46:54,600 times the probability of Ai divided 962 00:46:54,600 --> 00:47:06,722 by the sum of the probability of Aj [INAUDIBLE] Aj. 963 00:47:11,710 --> 00:47:14,112 And this is the form that you'll normally see based here. 964 00:47:20,870 --> 00:47:23,370 A lot of times, we have a continuous variable instead 965 00:47:23,370 --> 00:47:25,910 of discrete events like this. 966 00:47:25,910 --> 00:47:28,320 And so then we talk about probability distributions. 967 00:47:31,240 --> 00:47:33,980 And so instead of having a sum there, 968 00:47:33,980 --> 00:47:36,310 we might have an integral. 969 00:47:36,310 --> 00:47:42,400 And this is a topic that also is quite confusing to many people. 970 00:47:46,060 --> 00:47:51,956 So suppose I had a Maxwell-Boltzmann distribution. 971 00:47:51,956 --> 00:47:56,710 And I have, like, the probability density 972 00:47:56,710 --> 00:48:00,420 of having a certain velocity in the extraction instead 973 00:48:00,420 --> 00:48:02,440 of the particle. 974 00:48:02,440 --> 00:48:05,760 And so that's going to be something like e 975 00:48:05,760 --> 00:48:12,834 to the negative 1/2 mvx squared over keT divided by something. 976 00:48:15,663 --> 00:48:17,246 And maybe it actually is [INAUDIBLE].. 977 00:48:17,246 --> 00:48:18,080 I'm not sure. 978 00:48:18,080 --> 00:48:19,730 Maybe there's a vx here. 979 00:48:19,730 --> 00:48:20,900 Something like that. 980 00:48:20,900 --> 00:48:22,435 So you have an expression that you 981 00:48:22,435 --> 00:48:24,470 get for [INAUDIBLE] for probability density. 982 00:48:24,470 --> 00:48:25,970 Now, what does this mean? 983 00:48:25,970 --> 00:48:28,550 We want this thing to be the integral 984 00:48:28,550 --> 00:48:34,377 of P of vx dvx over from negative infinity to infinity. 985 00:48:34,377 --> 00:48:35,710 We want this to equal something. 986 00:48:35,710 --> 00:48:37,910 What do we want this to equal? 987 00:48:37,910 --> 00:48:39,120 1. 988 00:48:39,120 --> 00:48:42,176 So that means that the units of this, this 989 00:48:42,176 --> 00:48:44,709 is units of centimeters per second, 990 00:48:44,709 --> 00:48:45,750 what's the units of this? 991 00:48:45,750 --> 00:48:49,630 AUDIENCE: [INAUDIBLE] 992 00:48:51,120 --> 00:48:53,370 WILLIAM GREEN, JR: Centimeters per second now minus 1. 993 00:48:53,370 --> 00:48:57,860 It's, like, it's per the unit to this 994 00:48:57,860 --> 00:49:00,190 to get a dimensionless number there. 995 00:49:00,190 --> 00:49:05,506 So this has units of seconds per centimeter, 996 00:49:05,506 --> 00:49:07,880 which probably none of you thought until I just said that 997 00:49:07,880 --> 00:49:09,550 to you. 998 00:49:09,550 --> 00:49:14,030 So probability densities are tricky, 999 00:49:14,030 --> 00:49:17,679 and they always have to be multiplied by a delta. 1000 00:49:17,679 --> 00:49:19,220 When I talk about this, I really need 1001 00:49:19,220 --> 00:49:23,190 to talk about P of vx, delta vx. 1002 00:49:23,190 --> 00:49:25,670 I need to have something here to make this look 1003 00:49:25,670 --> 00:49:27,470 like a probability again. 1004 00:49:27,470 --> 00:49:29,390 And so the issue is that the probability 1005 00:49:29,390 --> 00:49:32,354 that the velocity is exactly something is, like, 0. 1006 00:49:32,354 --> 00:49:33,770 It's really the probability that's 1007 00:49:33,770 --> 00:49:37,630 in a certain range, plus or minus something. 1008 00:49:37,630 --> 00:49:39,145 Then you get a nonzero probability. 1009 00:49:43,372 --> 00:49:44,830 There's another quantity you'll see 1010 00:49:44,830 --> 00:49:49,030 a lot called the cumulative probability distribution. 1011 00:49:49,030 --> 00:49:50,460 Let's see, what letter do I use? 1012 00:49:53,880 --> 00:49:56,650 Call it F. And this would be like the integral 1013 00:49:56,650 --> 00:50:03,634 from negative infinity to vx prime, or vx of P over vx 1014 00:50:03,634 --> 00:50:07,330 prime, dvx prime. 1015 00:50:07,330 --> 00:50:09,880 And this is the probability that the particle 1016 00:50:09,880 --> 00:50:11,830 has vx less than something. 1017 00:50:11,830 --> 00:50:19,492 So this is F is equal to the probability that vx-- 1018 00:50:19,492 --> 00:50:21,620 let's call this vx star-- 1019 00:50:21,620 --> 00:50:26,520 vx is less than or equal to vx star. 1020 00:50:26,520 --> 00:50:28,520 And that can be quite an important property. 1021 00:50:28,520 --> 00:50:32,236 So for example, you're designing a supersonic nozzle. 1022 00:50:32,236 --> 00:50:34,110 You want to know what gas molecules are going 1023 00:50:34,110 --> 00:50:36,152 to come out at a certain speed. 1024 00:50:36,152 --> 00:50:37,860 You really need to know that probability. 1025 00:50:37,860 --> 00:50:40,565 How many of them are going to be bigger than that speed, how 1026 00:50:40,565 --> 00:50:43,320 many less than that speed? 1027 00:50:43,320 --> 00:50:47,562 So these are two different ways to express a similar thing. 1028 00:50:47,562 --> 00:50:49,020 This is, like, the probably that it 1029 00:50:49,020 --> 00:50:51,550 does have that speed within a certain range. 1030 00:50:51,550 --> 00:50:54,240 This is the probability that it has anything less than 1031 00:50:54,240 --> 00:50:55,680 or equal to that speed. 1032 00:50:55,680 --> 00:50:58,020 And in a completely different way, this is an integral. 1033 00:50:58,020 --> 00:51:02,640 This has units of dimensionless. 1034 00:51:02,640 --> 00:51:06,400 This has units of per velocity. 1035 00:51:06,400 --> 00:51:07,950 All right? 1036 00:51:07,950 --> 00:51:10,860 All right, we'll pick up more of this on Monday.