1 00:00:01,540 --> 00:00:03,910 The following content is provided under a Creative 2 00:00:03,910 --> 00:00:05,300 Commons license. 3 00:00:05,300 --> 00:00:07,510 Your support will help MIT OpenCourseWare 4 00:00:07,510 --> 00:00:11,600 continue to offer high quality educational resources for free. 5 00:00:11,600 --> 00:00:14,140 To make a donation or to view additional materials 6 00:00:14,140 --> 00:00:18,100 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:18,100 --> 00:00:20,200 at ocw.mit.edu. 8 00:00:23,500 --> 00:00:26,680 WILLIAM GREEN JR: All right today, I 9 00:00:26,680 --> 00:00:34,060 would like to do a Kinetic Monte Carlo example with you in class 10 00:00:34,060 --> 00:00:37,600 and, also, talk a little bit about the connection 11 00:00:37,600 --> 00:00:42,580 between the master equations, master equation solution, 12 00:00:42,580 --> 00:00:46,354 the normal kinetic equations we use, and the-- 13 00:00:46,354 --> 00:00:47,770 how you handle these trajectories, 14 00:00:47,770 --> 00:00:50,950 you'll get how to Kinetic Monte Carlo. 15 00:00:50,950 --> 00:00:53,740 All right, so let's just pick a simple example. 16 00:00:57,100 --> 00:00:58,730 As we mentioned, in the real world, 17 00:00:58,730 --> 00:01:01,630 it's pretty easy for these examples 18 00:01:01,630 --> 00:01:04,150 to get completely out of hand, because the number 19 00:01:04,150 --> 00:01:07,300 of possible states can be so gigantic. 20 00:01:07,300 --> 00:01:10,540 Let's all do a really super, super simple one here. 21 00:01:10,540 --> 00:01:12,970 To try to keep that underhand, not worry about that. 22 00:01:12,970 --> 00:01:15,590 When you do the real problems, that will be a major issue-- 23 00:01:15,590 --> 00:01:19,330 is if he number of states get out of hand. 24 00:01:19,330 --> 00:01:21,640 So the simple example I'm gonna do 25 00:01:21,640 --> 00:01:24,704 is a real one from inside your body. 26 00:01:24,704 --> 00:01:26,245 So inside your body, you have a thing 27 00:01:26,245 --> 00:01:28,720 called low density lipoprotein. 28 00:01:28,720 --> 00:01:35,470 And there's little vesicles of fat, lipids, inside your body, 29 00:01:35,470 --> 00:01:38,260 actually, in your blood vessels. 30 00:01:38,260 --> 00:01:40,390 And these are bad. 31 00:01:40,390 --> 00:01:45,100 If you go to the doctor, they measure your LDL and your HDL. 32 00:01:45,100 --> 00:01:46,765 And if your LDL number is too high 33 00:01:46,765 --> 00:01:48,890 then they yell at you for eating too much fat food. 34 00:01:48,890 --> 00:01:51,410 And they make you exercise and stuff like that. 35 00:01:51,410 --> 00:01:54,484 This has happened to me, so I know. 36 00:01:54,484 --> 00:01:56,650 And there's a reason for this, is because the LDL is 37 00:01:56,650 --> 00:01:58,990 susceptible to oxidation. 38 00:01:58,990 --> 00:02:02,710 And if too many of those lipid molecules peroxidize, 39 00:02:02,710 --> 00:02:07,110 it causes inflammation in your blood vessels. 40 00:02:07,110 --> 00:02:08,680 And that can cause your blood vessels 41 00:02:08,680 --> 00:02:10,300 to constrict and stuff that eventually 42 00:02:10,300 --> 00:02:12,254 can lead to heart attacks. 43 00:02:12,254 --> 00:02:13,920 And so that's why your doctor is alarmed 44 00:02:13,920 --> 00:02:16,030 if you have too much LDL, because you have 45 00:02:16,030 --> 00:02:19,450 a lot more material available that could be oxidized, 46 00:02:19,450 --> 00:02:20,357 that could kill you. 47 00:02:20,357 --> 00:02:22,690 There's actually a really complicated, interesting story 48 00:02:22,690 --> 00:02:26,170 about what vitamin E does in the LDL, 49 00:02:26,170 --> 00:02:28,144 and how it interacts with vitamin C. 50 00:02:28,144 --> 00:02:29,560 And if you take my kinetics class, 51 00:02:29,560 --> 00:02:31,060 I'll tell you about that. 52 00:02:31,060 --> 00:02:33,700 But we'll do the simplest case now. 53 00:02:33,700 --> 00:02:36,310 There's no vitamin E, there's nobody Vitamin C. You just have 54 00:02:36,310 --> 00:02:39,120 some lipid, and it's oxidizing. 55 00:02:39,120 --> 00:02:40,880 And let's model what's happening. 56 00:02:40,880 --> 00:02:44,950 So what you have is a little bubble of fat. 57 00:02:44,950 --> 00:02:47,510 So out here is water. 58 00:02:47,510 --> 00:02:51,190 And here's my fat which I'll politely call lipid. 59 00:02:51,190 --> 00:02:54,690 That sounds like not quite as fat, if you call it lipid, 60 00:02:54,690 --> 00:02:55,190 slimy. 61 00:02:58,060 --> 00:03:03,190 And the lipid is susceptible to attack by this reaction. 62 00:03:03,190 --> 00:03:05,870 So if I have some peroxy radical, 63 00:03:05,870 --> 00:03:09,460 and I have the lipid molecules, which are some hydrocarbon, 64 00:03:09,460 --> 00:03:16,000 they can react and make peroxide plus a radical. 65 00:03:16,000 --> 00:03:18,940 And in your blood vessels, if you're not 66 00:03:18,940 --> 00:03:22,600 under the water or being killed, you have a lot of oxygen. 67 00:03:22,600 --> 00:03:25,580 And so the carbon set of radicals 68 00:03:25,580 --> 00:03:28,660 you form immediately react with oxygen 69 00:03:28,660 --> 00:03:32,410 to make the peroxy radical back. 70 00:03:32,410 --> 00:03:34,912 And so the net process-- 71 00:03:34,912 --> 00:03:36,370 we can kind of combine these steps, 72 00:03:36,370 --> 00:03:38,821 because this is super fast. 73 00:03:38,821 --> 00:03:41,525 So it's like a microsecond times scale. 74 00:03:41,525 --> 00:03:43,650 For that to happen in your body, because the oxygen 75 00:03:43,650 --> 00:03:45,920 concentration is so high in the blood. 76 00:03:45,920 --> 00:03:55,090 And so this reaction is really roo, plus RAH, plus O2, 77 00:03:55,090 --> 00:03:57,930 to rooh, plus roo. 78 00:03:57,930 --> 00:04:00,700 So the radical is just catalyzing 79 00:04:00,700 --> 00:04:04,600 the oxidation of your lipid into the peroxide. 80 00:04:04,600 --> 00:04:08,650 When this level gets too high, then your body will detect it. 81 00:04:08,650 --> 00:04:11,414 There's an inflation, and you'll have all kinds of trouble. 82 00:04:11,414 --> 00:04:14,310 OK, so we like to understand this. 83 00:04:14,310 --> 00:04:15,844 Now, these vesicles are very small, 84 00:04:15,844 --> 00:04:17,260 so there's a probability you might 85 00:04:17,260 --> 00:04:19,510 have only a very, very, small number of radicals in there. 86 00:04:19,510 --> 00:04:21,218 Also, your body has a lot of antioxidants 87 00:04:21,218 --> 00:04:24,310 in it, like vitamin C and vitamin E and some other ones 88 00:04:24,310 --> 00:04:25,210 too. 89 00:04:25,210 --> 00:04:27,790 And the antioxidants are trying to get rid of radicals. 90 00:04:27,790 --> 00:04:30,370 So the number of radicals you'd expect the concentration-- 91 00:04:30,370 --> 00:04:32,430 background concentration is very tiny. 92 00:04:32,430 --> 00:04:33,895 And because of that, this is tiny 93 00:04:33,895 --> 00:04:35,690 and the concentration is tiny. 94 00:04:35,690 --> 00:04:38,860 So the concentration times the volume might also be tiny. 95 00:04:38,860 --> 00:04:42,100 So the total number of radicals might be very, very small. 96 00:04:42,100 --> 00:04:43,852 And so therefore, you might need to worry 97 00:04:43,852 --> 00:04:45,310 about the stochastic kinetics being 98 00:04:45,310 --> 00:04:48,110 different than the continuum kinetics. 99 00:04:48,110 --> 00:04:50,140 OK, so that's the idea. 100 00:04:50,140 --> 00:04:55,510 Now, on top of that, you also have a lot 101 00:04:55,510 --> 00:04:58,220 of these vesicles in your body. 102 00:04:58,220 --> 00:05:02,525 So you might be able to somehow work up some continuum model, 103 00:05:02,525 --> 00:05:03,150 treat them all. 104 00:05:03,150 --> 00:05:04,860 And in fact, I think that's what people did originally, is 105 00:05:04,860 --> 00:05:07,318 they just said well, let's take the total amount of LDL you 106 00:05:07,318 --> 00:05:09,241 got in your body and do a continuum model. 107 00:05:09,241 --> 00:05:10,740 But as you will see, it's different, 108 00:05:10,740 --> 00:05:12,619 because the fact that the vesicles are small, 109 00:05:12,619 --> 00:05:14,660 each one might only have, say, one radical in it. 110 00:05:14,660 --> 00:05:16,826 And that will actually behave quite differently than 111 00:05:16,826 --> 00:05:18,470 if you had a lot of radicals. 112 00:05:18,470 --> 00:05:21,640 All right so, this is the kinetics, 113 00:05:21,640 --> 00:05:25,230 and the oxygen is almost always high concentration, 114 00:05:25,230 --> 00:05:28,200 so I'm not going to worry about that. 115 00:05:28,200 --> 00:05:32,190 And I'm going to assume that we're not going let your lipid 116 00:05:32,190 --> 00:05:35,860 oxidize so much that the amount of lipid changes significantly. 117 00:05:35,860 --> 00:05:38,640 So let's just, for now, we can just ignore this. 118 00:05:38,640 --> 00:05:40,620 OK, maybe later we might go back and figure out 119 00:05:40,620 --> 00:05:42,744 how you'd account for the fact that these cells are 120 00:05:42,744 --> 00:05:45,480 being consumed, which would change the rates a little bit. 121 00:05:45,480 --> 00:05:47,780 So we'll just assume that concentration is constant. 122 00:05:47,780 --> 00:05:49,760 So you have a tiny amount of radicals. 123 00:05:49,760 --> 00:05:52,490 And if you had the radicals in your vesicle, 124 00:05:52,490 --> 00:05:55,650 they're creating roh. 125 00:05:55,650 --> 00:05:59,550 And you see, the ro is catalytic. 126 00:05:59,550 --> 00:06:01,600 And so what we're gonna see is basically 127 00:06:01,600 --> 00:06:04,040 D. If you did it in classical kinetics, 128 00:06:04,040 --> 00:06:07,895 you'd write DR dt this is basically 129 00:06:07,895 --> 00:06:10,912 equals some constant times roo. 130 00:06:15,330 --> 00:06:17,070 And then, I lumped these concentrations 131 00:06:17,070 --> 00:06:18,960 into this constant. 132 00:06:18,960 --> 00:06:23,700 [INAUDIBLE] That all right? 133 00:06:23,700 --> 00:06:27,400 All right, so that's the import process. 134 00:06:27,400 --> 00:06:29,490 We also have another important process, 135 00:06:29,490 --> 00:06:32,910 is that if you get two radicals in there, 136 00:06:32,910 --> 00:06:35,470 and they bump into each other, they can kill each other off. 137 00:06:35,470 --> 00:06:37,740 So two peroxy radicals can combine and make 138 00:06:37,740 --> 00:06:39,657 stable molecules. 139 00:06:39,657 --> 00:06:41,990 And we don't care what stable molecules they really are. 140 00:06:41,990 --> 00:06:43,380 What's important is that they get rid of the radicals, 141 00:06:43,380 --> 00:06:45,200 because the radicals are catalyzing 142 00:06:45,200 --> 00:06:48,930 the unfavorable oxidation. 143 00:06:48,930 --> 00:06:52,340 In this program I started writing, I called this k3. 144 00:06:52,340 --> 00:06:55,692 This one is k4, reaction four. 145 00:06:55,692 --> 00:06:57,150 There's two other things happening. 146 00:06:57,150 --> 00:06:59,145 Out here, I had some peroxy radicals. 147 00:06:59,145 --> 00:07:01,080 They're floating around the water. 148 00:07:01,080 --> 00:07:03,150 Some of them might go into my lipid. 149 00:07:03,150 --> 00:07:05,060 I'll call that process K1. 150 00:07:05,060 --> 00:07:08,059 There's some time constant, which new radicals arrive. 151 00:07:08,059 --> 00:07:09,600 And then, I also have the possibility 152 00:07:09,600 --> 00:07:11,700 these guys could diffuse out. 153 00:07:11,700 --> 00:07:13,740 So I call that k2. 154 00:07:13,740 --> 00:07:16,050 And k1, I'll just treat as a constant. 155 00:07:16,050 --> 00:07:18,560 So as soon as a background concentration radicals 156 00:07:18,560 --> 00:07:23,500 that's constant, and so this is a sum-- every 10 seconds 157 00:07:23,500 --> 00:07:26,550 or something, a radical arrives in a vesicle. 158 00:07:26,550 --> 00:07:30,250 And this will depend on the concentration, 159 00:07:30,250 --> 00:07:32,810 the number of ro's. 160 00:07:32,810 --> 00:07:35,220 So the more you have inside here, the faster 161 00:07:35,220 --> 00:07:37,935 the rate which they go out. 162 00:07:37,935 --> 00:07:39,270 That all right? 163 00:07:39,270 --> 00:07:40,807 And this just mass transfer. 164 00:07:40,807 --> 00:07:42,640 But from the point of view of the equations, 165 00:07:42,640 --> 00:07:45,160 it doesn't care if it's mass transfer or chemical reaction. 166 00:07:45,160 --> 00:07:47,010 They arrive in the same way. 167 00:07:47,010 --> 00:07:50,196 All right, so that's the system. 168 00:07:50,196 --> 00:07:51,350 And so let's look at the-- 169 00:07:51,350 --> 00:07:52,680 I should try to write the MATLAB code for this. 170 00:07:52,680 --> 00:07:55,240 And maybe, we can try to finish this together in class. 171 00:07:55,240 --> 00:07:57,990 So I have four processes-- 172 00:07:57,990 --> 00:07:59,910 arrival of new radical, diffusion 173 00:07:59,910 --> 00:08:04,560 of the radical and the vesicle, reaction 174 00:08:04,560 --> 00:08:08,940 to make the peroxide, and self-destruction 175 00:08:08,940 --> 00:08:12,090 of the radicals. 176 00:08:12,090 --> 00:08:14,136 And I wrote down what each of these does. 177 00:08:14,136 --> 00:08:16,510 So the first one increases the number of radicals by one. 178 00:08:16,510 --> 00:08:19,010 The second one gets rid of a radical 179 00:08:19,010 --> 00:08:21,202 because it's diffused away. 180 00:08:21,202 --> 00:08:23,160 The third one increases the amount of peroxide. 181 00:08:23,160 --> 00:08:24,743 The last one gets rid of two radicals. 182 00:08:28,770 --> 00:08:32,039 So we're going to try to compute a trajectory by the Kinetic 183 00:08:32,039 --> 00:08:34,580 Monte Carlo method. 184 00:08:34,580 --> 00:08:37,669 And trajectory is going to be some time 185 00:08:37,669 --> 00:08:40,230 points, the number of radicals at that time 186 00:08:40,230 --> 00:08:43,320 point, the number of peroxides I have at that time point. 187 00:08:43,320 --> 00:08:46,130 And as I run, I'm going to get many, many, different time 188 00:08:46,130 --> 00:08:46,630 points. 189 00:08:46,630 --> 00:08:48,050 And each one will have a different number of radicals 190 00:08:48,050 --> 00:08:49,830 or a different number of peroxides. 191 00:08:49,830 --> 00:08:51,350 And that's what I want to compute. 192 00:08:51,350 --> 00:08:53,766 And then, at the end, after I have trajectories like that, 193 00:08:53,766 --> 00:08:56,690 big tables of these things, I want to somehow put it together 194 00:08:56,690 --> 00:08:59,420 to figure out on average what happened or something, 195 00:08:59,420 --> 00:09:00,922 try to understand it. 196 00:09:05,870 --> 00:09:09,350 And so let's see, so my inputs are the initial numbers 197 00:09:09,350 --> 00:09:15,710 of radicals and peroxides in the vesicle, the vector of rate 198 00:09:15,710 --> 00:09:18,530 coefficients, the max amount of time I want 199 00:09:18,530 --> 00:09:20,290 to run the trajectory for-- 200 00:09:20,290 --> 00:09:23,970 not clock time, but time in the simulation. 201 00:09:23,970 --> 00:09:27,260 So it's like how many microseconds or milliseconds 202 00:09:27,260 --> 00:09:29,520 or seconds I look at my lipid protein 203 00:09:29,520 --> 00:09:31,110 and see what it's doing. 204 00:09:31,110 --> 00:09:33,080 And the maximum number of steps, because I 205 00:09:33,080 --> 00:09:35,000 don't want to get a trajectory list that's 206 00:09:35,000 --> 00:09:37,970 10 to the ninth long, because over a while, my memory, 207 00:09:37,970 --> 00:09:41,270 my computer would cause me trouble. 208 00:09:41,270 --> 00:09:43,727 So here they are, all the setups. 209 00:09:43,727 --> 00:09:44,810 Everything is fine so far. 210 00:09:50,960 --> 00:09:51,911 So here's the loop. 211 00:09:54,620 --> 00:09:58,850 So the outermost loop is just to keep track of how many steps 212 00:09:58,850 --> 00:10:03,080 we have, which is going to be the number of entries we 213 00:10:03,080 --> 00:10:05,350 have in the trajectory table. 214 00:10:05,350 --> 00:10:08,440 And the second one is really-- 215 00:10:08,440 --> 00:10:10,120 what we care about-- is well, the time 216 00:10:10,120 --> 00:10:12,121 is less than the maximum time of the simulation. 217 00:10:12,121 --> 00:10:14,161 First, we want to figure out the time [INAUDIBLE] 218 00:10:14,161 --> 00:10:15,640 until something happens. 219 00:10:15,640 --> 00:10:17,620 So following Joe Scott's notes, we 220 00:10:17,620 --> 00:10:20,290 compute this quantity called A, which 221 00:10:20,290 --> 00:10:23,560 is the sum of all the rates. 222 00:10:23,560 --> 00:10:26,860 And that's equal to the rate of the first process. 223 00:10:26,860 --> 00:10:29,110 And then, they're in the second process, which depends 224 00:10:29,110 --> 00:10:30,666 on the number of radicals. 225 00:10:30,666 --> 00:10:32,040 And the rate of the third process 226 00:10:32,040 --> 00:10:33,700 all depends on the radicals. 227 00:10:33,700 --> 00:10:35,200 And the rate of the fourth process, 228 00:10:35,200 --> 00:10:37,491 which is a number radicals times the number of radicals 229 00:10:37,491 --> 00:10:38,520 minus one. 230 00:10:38,520 --> 00:10:43,210 Now k4 has to have units of per second. 231 00:10:43,210 --> 00:10:48,730 But bi-molecular rates would normally have units of volume 232 00:10:48,730 --> 00:10:50,650 per second, per mole even-- 233 00:10:50,650 --> 00:10:52,580 volume is per molecule per second. 234 00:10:52,580 --> 00:10:56,300 And so that k4 has to really be a normal kind 235 00:10:56,300 --> 00:10:58,160 of k divided by the volume. 236 00:10:58,160 --> 00:10:59,910 And we're going to have to figure out what 237 00:10:59,910 --> 00:11:01,810 to do about that in a minute. 238 00:11:01,810 --> 00:11:06,460 And then, we do the formula to get the-- 239 00:11:06,460 --> 00:11:09,310 Gillespie's formula for how to sample 240 00:11:09,310 --> 00:11:12,120 from an exponential decay, as good as that is. 241 00:11:14,880 --> 00:11:18,160 So Gillespie thinks that the probability that something 242 00:11:18,160 --> 00:11:22,780 is going to happen, or the probability, the time, 243 00:11:22,780 --> 00:11:25,760 until the next thing happens is going as e 244 00:11:25,760 --> 00:11:30,560 to the negative a times t. 245 00:11:30,560 --> 00:11:34,000 So we're trying to sample from e to the negative, a, t. 246 00:11:34,000 --> 00:11:38,140 And that's what that crazy log of the random number is doing-- 247 00:11:38,140 --> 00:11:40,270 it's sampling from that distribution. 248 00:11:45,190 --> 00:11:48,270 And so we get a [INAUDIBLE] that how long we've 249 00:11:48,270 --> 00:11:50,700 waited from the time the last thing happened 250 00:11:50,700 --> 00:11:51,950 until the next thing happened. 251 00:11:54,602 --> 00:11:56,310 And now, we have to figure what happened. 252 00:11:56,310 --> 00:11:57,860 So there's four different processes 253 00:11:57,860 --> 00:11:58,995 that could have happened. 254 00:11:58,995 --> 00:12:00,700 A radical could have arrived. 255 00:12:00,700 --> 00:12:02,229 A radical could have left. 256 00:12:02,229 --> 00:12:04,520 A radical could have reacted with one of my hydrocarbon 257 00:12:04,520 --> 00:12:06,990 molecules, with one of my lipids, 258 00:12:06,990 --> 00:12:09,860 or the two radicals could have killed each other. 259 00:12:09,860 --> 00:12:13,550 So we list these guys out. 260 00:12:13,550 --> 00:12:16,580 A is the sum of all those processes. 261 00:12:16,580 --> 00:12:18,836 P1 is the probability that the first process happened, 262 00:12:18,836 --> 00:12:19,960 that a new radical arrives. 263 00:12:19,960 --> 00:12:24,920 So it's going to be the k for the first step, divided by a. 264 00:12:24,920 --> 00:12:27,230 That one was zero water, because it's 265 00:12:27,230 --> 00:12:29,070 subterfuging it from outside. 266 00:12:29,070 --> 00:12:30,530 So it's just a k of 1. 267 00:12:34,040 --> 00:12:36,791 Probably the second step is k2 times n rad. 268 00:12:36,791 --> 00:12:39,290 That's the rate of the second step divided by the total rate 269 00:12:39,290 --> 00:12:40,645 of all the processes. 270 00:12:40,645 --> 00:12:42,020 And I'm going to add that onto p1 271 00:12:42,020 --> 00:12:47,160 to make a vector of possible things that could happen. 272 00:12:47,160 --> 00:12:51,890 So I'm picking a random number from zero to one. 273 00:12:51,890 --> 00:12:54,007 And I want to make a little bar. 274 00:12:54,007 --> 00:12:56,090 Here's the probability the first process happened. 275 00:12:56,090 --> 00:12:58,590 And here's the probability that the second process happened. 276 00:12:58,590 --> 00:13:01,200 And here's the probability the third process happened. 277 00:13:01,200 --> 00:13:02,450 And here's the probability the fourth process happened. 278 00:13:02,450 --> 00:13:04,529 I know that these guys have to add up to one, 279 00:13:04,529 --> 00:13:06,320 because I computed that something happened. 280 00:13:09,142 --> 00:13:11,950 And so I'm going to try to compare my random number 281 00:13:11,950 --> 00:13:16,250 from zero to one to these breaks and sort it out into these four 282 00:13:16,250 --> 00:13:20,290 possibilities, and then figure out which thing happened. 283 00:13:20,290 --> 00:13:24,960 OK, so this is the second step of Gillespie's algorithm. 284 00:13:24,960 --> 00:13:28,250 All right, so maybe you guys can help me finish the code here. 285 00:13:28,250 --> 00:13:30,806 If you want to go to Broadway in Chicago, you can go there. 286 00:13:35,530 --> 00:13:38,230 So I need to write the next one. 287 00:13:38,230 --> 00:13:40,820 So p3 is equal p2 plus what? 288 00:13:47,070 --> 00:13:50,834 So step three is-- 289 00:13:50,834 --> 00:13:53,214 sorry? 290 00:13:53,214 --> 00:13:54,166 Say again. 291 00:13:54,166 --> 00:13:56,070 AUDIENCE: [INAUDIBLE] 292 00:14:05,570 --> 00:14:09,390 WILLIAM GREEN JR: All right, that's enough, right? 293 00:14:12,110 --> 00:14:14,910 So now, I get to choose a random number, 294 00:14:14,910 --> 00:14:19,490 so, say, x is equal to rand. 295 00:14:19,490 --> 00:14:29,210 And then, I have to say if x is less than p1, than something. 296 00:14:29,210 --> 00:14:32,220 What's it gonna be? 297 00:14:32,220 --> 00:14:33,630 Then step number one happened. 298 00:14:33,630 --> 00:14:39,660 So that means that n rad is equal to n rad plus one, 299 00:14:39,660 --> 00:14:41,580 so one radical transported in. 300 00:14:44,490 --> 00:14:48,305 If x is less than p2-- 301 00:14:53,020 --> 00:14:57,265 [INAUDIBLE] Is that good? 302 00:14:57,265 --> 00:14:59,060 AUDIENCE: [INAUDIBLE] 303 00:14:59,060 --> 00:15:00,560 WILLIAM GREEN JR: [INAUDIBLE] space. 304 00:15:00,560 --> 00:15:01,060 Thank you. 305 00:15:03,920 --> 00:15:04,670 What happens here? 306 00:15:04,670 --> 00:15:08,690 So this is b, n rad is equal to n rad minus one? 307 00:15:08,690 --> 00:15:11,190 AUDIENCE: [INAUDIBLE] 308 00:15:11,889 --> 00:15:14,430 WILLIAM GREEN JR: I think they also take care of that, right? 309 00:15:17,265 --> 00:15:18,215 Is this right? 310 00:15:22,970 --> 00:15:28,500 X is less than p3, than nroh. 311 00:15:38,300 --> 00:15:40,970 Else and rand. 312 00:15:45,227 --> 00:15:46,650 Does that look right? 313 00:15:46,650 --> 00:15:49,898 Do I need an end? 314 00:15:49,898 --> 00:15:50,832 AUDIENCE: Semi-colon. 315 00:15:50,832 --> 00:15:52,040 WILLIAM GREEN JR: Semi-colon. 316 00:15:52,040 --> 00:15:54,170 Semi-colon, thank you. 317 00:15:54,170 --> 00:15:55,690 That would be really bad. 318 00:15:55,690 --> 00:15:57,830 All right, yes, Ziggy? 319 00:15:57,830 --> 00:15:59,306 AUDIENCE: So in the first problem, 320 00:15:59,306 --> 00:16:04,429 you have step size longer than that [INAUDIBLE] size. 321 00:16:04,429 --> 00:16:05,970 WILLIAM GREEN JR: So that's not good. 322 00:16:05,970 --> 00:16:07,270 It should be less than. 323 00:16:07,270 --> 00:16:07,770 Thank you. 324 00:16:11,990 --> 00:16:15,035 Any more bugs? 325 00:16:15,035 --> 00:16:17,874 AUDIENCE: I think you need spaces after the brackets. 326 00:16:18,374 --> 00:16:21,899 WILLIAM GREEN JR: Spaces after the brackets-- where? 327 00:16:21,899 --> 00:16:22,440 Is that here? 328 00:16:22,440 --> 00:16:24,187 AUDIENCE: [INAUDIBLE] 329 00:16:24,187 --> 00:16:26,020 WILLIAM GREEN JR: [INAUDIBLE] separate line. 330 00:16:26,020 --> 00:16:27,600 AUDIENCE: [INAUDIBLE] 331 00:16:29,917 --> 00:16:31,250 WILLIAM GREEN JR: I can do that. 332 00:16:31,250 --> 00:16:32,080 It's easier to read anyway. 333 00:16:32,080 --> 00:16:32,840 So that's good. 334 00:16:32,840 --> 00:16:34,165 I definitely agree with that. 335 00:16:34,165 --> 00:16:35,497 [INTERPOSING VOICES] 336 00:16:35,497 --> 00:16:36,830 WILLIAM GREEN JR: Is that right? 337 00:16:36,830 --> 00:16:37,740 AUDIENCE: Yeah. 338 00:16:40,930 --> 00:16:42,310 WILLIAM GREEN JR: You like this? 339 00:16:42,310 --> 00:16:44,685 With all these [INAUDIBLE] sets, I don't need any n's, is 340 00:16:44,685 --> 00:16:45,310 that right? 341 00:16:45,310 --> 00:16:47,690 [INAUDIBLE] after the other like that, no problem. 342 00:16:47,690 --> 00:16:48,690 Just one end at the end. 343 00:16:48,690 --> 00:16:49,900 [INTERPOSING VOICES] 344 00:16:50,005 --> 00:16:51,255 WILLIAM GREEN JR: That's good. 345 00:16:55,975 --> 00:16:57,350 All right, so we're OK with this? 346 00:16:57,350 --> 00:16:58,641 We think this is going to work? 347 00:16:58,641 --> 00:17:00,300 AUDIENCE: [INAUDIBLE] 348 00:17:02,140 --> 00:17:05,741 [INTERPOSING VOICES] 349 00:17:05,741 --> 00:17:07,240 WILLIAM GREEN JR: All right, so now, 350 00:17:07,240 --> 00:17:10,020 we've computed what's going to happen. 351 00:17:10,020 --> 00:17:13,280 Now, we need to store results somehow. 352 00:17:13,280 --> 00:17:18,589 So I'm gonna say trajectory is equal to-- 353 00:17:18,589 --> 00:17:20,324 or trajectory of steps-- 354 00:17:24,430 --> 00:17:25,784 so step was zeros. 355 00:17:25,784 --> 00:17:28,329 Now, step is one. 356 00:17:28,329 --> 00:17:30,119 [INAUDIBLE] step is one, to start with. 357 00:17:30,119 --> 00:17:31,616 [INTERPOSING VOICES] 358 00:17:47,650 --> 00:17:49,233 WILLIAM GREEN JR: Does this look good? 359 00:17:53,721 --> 00:17:55,220 They had only commas, is that right? 360 00:17:55,220 --> 00:17:56,332 No commas? 361 00:17:56,332 --> 00:17:58,737 AUDIENCE: [INAUDIBLE] 362 00:18:04,234 --> 00:18:06,150 WILLIAM GREEN JR: All right, one step is zero. 363 00:18:06,150 --> 00:18:08,663 I already have the first line filled in here. 364 00:18:08,663 --> 00:18:10,595 [INTERPOSING VOICES] 365 00:18:16,020 --> 00:18:17,400 WILLIAM GREEN JR: Is that good? 366 00:18:17,400 --> 00:18:18,060 We'll see. 367 00:18:18,060 --> 00:18:22,131 I don't know if it's OK or not, but I'll believe you. 368 00:18:22,131 --> 00:18:23,880 All right, so right now, we have a program 369 00:18:23,880 --> 00:18:26,420 that maybe or maybe not might actually compute something. 370 00:18:26,420 --> 00:18:27,350 Is that right? 371 00:18:27,350 --> 00:18:29,280 OK, now, we to figure out-- 372 00:18:29,280 --> 00:18:31,840 are we going to run this program? 373 00:18:31,840 --> 00:18:33,952 So we need an initial. 374 00:18:33,952 --> 00:18:35,528 So any suggestions? 375 00:18:35,528 --> 00:18:37,520 [INTERPOSING VOICES] 376 00:18:43,632 --> 00:18:45,840 WILLIAM GREEN JR: All right, so let's do an initial-- 377 00:18:45,840 --> 00:18:51,262 how about n rad is equal to 1 and nroh is equal to 0. 378 00:18:51,262 --> 00:18:52,880 Is that OK? 379 00:18:52,880 --> 00:18:56,250 We're cool with that? 380 00:18:56,250 --> 00:18:57,960 And how about k? 381 00:18:57,960 --> 00:18:59,840 So we need a vector of k's. 382 00:19:02,920 --> 00:19:04,345 Yup? 383 00:19:04,345 --> 00:19:06,481 AUDIENCE: For your line 18, I think 384 00:19:06,481 --> 00:19:09,095 that's just the [INAUDIBLE] 385 00:19:11,960 --> 00:19:13,374 WILLIAM GREEN JR: Yes, thank you. 386 00:19:22,550 --> 00:19:25,070 Yes? 387 00:19:25,070 --> 00:19:29,430 All right, so let's think about what's reasonable for the k's. 388 00:19:29,430 --> 00:19:32,180 So I think we can make the k for this stuff diffusing 389 00:19:32,180 --> 00:19:35,862 in very, very small. 390 00:19:35,862 --> 00:19:36,570 So I don't know-- 391 00:19:36,570 --> 00:19:41,350 [INAUDIBLE] make a small, 1e minus 5 something. 392 00:19:41,350 --> 00:19:44,050 Isn't that small-- only once an hour. 393 00:19:44,050 --> 00:19:47,660 You think it might be a little too small? 394 00:19:47,660 --> 00:19:51,920 And then, the next one is how fast do things diffuse out? 395 00:19:51,920 --> 00:19:56,820 Now, what's that going to physically depend on? 396 00:19:56,820 --> 00:20:00,936 It should be something like the diffusion. 397 00:20:00,936 --> 00:20:03,480 Diffusion [INAUDIBLE] get back to the wall, 398 00:20:03,480 --> 00:20:05,310 back to the outside. 399 00:20:05,310 --> 00:20:06,090 So it should be-- 400 00:20:09,610 --> 00:20:12,307 by one radical in here, what's the average time for it 401 00:20:12,307 --> 00:20:13,140 to diffuse back out? 402 00:20:17,460 --> 00:20:18,420 Any ideas? 403 00:20:22,270 --> 00:20:26,030 So if it does, say, just a random walk, maybe-- 404 00:20:26,030 --> 00:20:30,910 then you say that delta x squared is like d times tt. 405 00:20:34,760 --> 00:20:36,700 OK, so delta x squared, maybe make 406 00:20:36,700 --> 00:20:41,260 this like the radius of our lipid vesicle, 407 00:20:41,260 --> 00:20:47,050 so that delta t is like r squared over d. 408 00:20:47,050 --> 00:20:50,200 Seems like a reasonable scaling. 409 00:20:50,200 --> 00:20:56,690 And we actually want to rate, so we want the other way around. 410 00:20:56,690 --> 00:21:00,490 So k2 is going to be something like d over r squared. 411 00:21:03,880 --> 00:21:07,301 All right, so we need to pick a size of our LDL vesicles. 412 00:21:07,301 --> 00:21:08,800 I don't actually know what they are. 413 00:21:08,800 --> 00:21:10,500 I used to know this, but I don't remember. 414 00:21:10,500 --> 00:21:11,874 Anybody want to make a guess, how 415 00:21:11,874 --> 00:21:14,390 big is a vesicle inside your blood vessel? 416 00:21:18,262 --> 00:21:19,714 [INTERPOSING VOICES] 417 00:21:19,714 --> 00:21:20,690 AUDIENCE: Micron. 418 00:21:20,690 --> 00:21:22,520 WILLIAM GREEN JR: Micron, OK. 419 00:21:22,520 --> 00:21:23,710 So let's pick a mircron. 420 00:21:23,710 --> 00:21:29,530 So let's say r is equal to 10 to the minus 6 meters. 421 00:21:29,530 --> 00:21:34,410 What's a diffusion constant in liquid phase? 422 00:21:34,410 --> 00:21:35,410 [INAUDIBLE] 423 00:21:36,173 --> 00:21:38,105 AUDIENCE: [INAUDIBLE] 424 00:21:38,799 --> 00:21:41,090 WILLIAM GREEN JR: [INAUDIBLE] meter squared per second. 425 00:21:41,090 --> 00:21:41,756 OK, so feasible. 426 00:21:41,756 --> 00:21:43,628 [INTERPOSING VOICES] 427 00:21:43,714 --> 00:21:45,880 WILLIAM GREEN JR: Anybody know if it's meter squared 428 00:21:45,880 --> 00:21:48,230 or centimeter squared? 429 00:21:48,230 --> 00:21:49,085 What? 430 00:21:49,085 --> 00:21:50,225 [INTERPOSING VOICES] 431 00:21:50,725 --> 00:21:51,500 WILLIAM GREEN JR: You guys did the one of the drug. 432 00:21:51,500 --> 00:21:52,220 What was the drugs one? 433 00:21:52,220 --> 00:21:54,803 Was it 10 to the minus 6, meter squared or centimeter squared? 434 00:21:54,803 --> 00:21:55,886 [INTERPOSING VOICES] 435 00:21:56,415 --> 00:21:57,790 WILLIAM GREEN JR: Meters squared. 436 00:21:57,790 --> 00:22:02,260 OK, so for a light, smaller molecule, it's reasonable. 437 00:22:04,990 --> 00:22:09,110 So this number should be something like 10 438 00:22:09,110 --> 00:22:11,045 to the minus 5, divided by 10 to the minus 12, 439 00:22:11,045 --> 00:22:12,555 so something like 10 to the 7. 440 00:22:24,180 --> 00:22:24,950 1, 8, and 7. 441 00:22:28,050 --> 00:22:34,805 All right, now for the reaction, roo plus RH, 442 00:22:34,805 --> 00:22:36,920 we can go look it up on the [INAUDIBLE].. 443 00:22:36,920 --> 00:22:38,750 They'll have a list of reactions like that. 444 00:22:41,565 --> 00:22:44,140 For now, let's just guess. 445 00:22:44,140 --> 00:22:45,570 And so let's say that k3-- 446 00:22:48,920 --> 00:22:53,210 k of roo plus rh-- 447 00:22:53,210 --> 00:22:56,240 these guys typically have 8 factors of 10 448 00:22:56,240 --> 00:23:00,080 to the eighth leaders per mole second. 449 00:23:00,080 --> 00:23:02,600 And they have ea's, about 15-- 450 00:23:05,660 --> 00:23:09,565 15 k cals per mole over rt. 451 00:23:11,949 --> 00:23:13,990 OK so now, we need to figure out how to turn this 452 00:23:13,990 --> 00:23:17,210 into the k3 we want. 453 00:23:17,210 --> 00:23:20,410 Now, the k3 we want is really-- 454 00:23:23,160 --> 00:23:24,560 K3 is like this-- 455 00:23:30,060 --> 00:23:33,370 times the concentration of the rh, 456 00:23:33,370 --> 00:23:36,750 because we took the rh out of the problem, 457 00:23:36,750 --> 00:23:41,490 because we want this to have units of per second. 458 00:23:41,490 --> 00:23:42,810 Is that right? 459 00:23:45,492 --> 00:23:51,260 And this is in units of volume per meters 460 00:23:51,260 --> 00:23:55,410 cubed per mole second. 461 00:23:55,410 --> 00:23:58,750 And this would be moles per meter cubed. 462 00:23:58,750 --> 00:24:02,180 And so it's per second, which looks right. 463 00:24:02,180 --> 00:24:05,014 OK so now, we need to have-- 464 00:24:05,014 --> 00:24:06,430 I understand we have a calculator? 465 00:24:06,430 --> 00:24:09,830 We can try to calculate this number for room temperature. 466 00:24:09,830 --> 00:24:14,470 And this does not mean room temperature is r time t-- 467 00:24:14,470 --> 00:24:16,310 actually for body temperature. 468 00:24:16,310 --> 00:24:21,754 And the concentration of hydrocarbon-- 469 00:24:21,754 --> 00:24:23,920 it's actually the number of h's, because every h can 470 00:24:23,920 --> 00:24:26,050 be attacked in a hydrocarbon. 471 00:24:26,050 --> 00:24:33,970 So you typically have densities of 0.8 grams 472 00:24:33,970 --> 00:24:35,890 per centimeter cubed. 473 00:24:35,890 --> 00:24:36,770 It's for organic. 474 00:24:39,760 --> 00:24:50,680 And you typically have two h atoms 475 00:24:50,680 --> 00:24:54,950 per 14 grams of ch2 groups, because you only 476 00:24:54,950 --> 00:24:56,600 see h2 groups in there. 477 00:24:59,570 --> 00:25:04,480 S two h atoms. 478 00:25:04,480 --> 00:25:07,670 And then, if we're going to try to keep moles here, 479 00:25:07,670 --> 00:25:18,434 we need 6 times 10 to the 23rd atoms per mole. 480 00:25:22,092 --> 00:25:23,800 All right, and this is centimeters cubed, 481 00:25:23,800 --> 00:25:27,486 but this one has leaders, so I need 10 482 00:25:27,486 --> 00:25:31,099 to the 3 centimeters cubed [INAUDIBLE].. 483 00:25:31,099 --> 00:25:33,640 So again, verifying what your high school teacher taught you, 484 00:25:33,640 --> 00:25:36,370 that the first thing is to learn units. 485 00:25:36,370 --> 00:25:40,690 [INAUDIBLE] 486 00:25:40,690 --> 00:25:44,690 So we take all these numbers. 487 00:25:44,690 --> 00:25:50,077 This is the RH, and this is the k. 488 00:25:50,077 --> 00:25:51,660 And we can multiply them all together, 489 00:25:51,660 --> 00:25:53,690 and we should get something reasonable, maybe. 490 00:25:53,690 --> 00:25:57,230 And since we have MATLAB we can make it do it for us. 491 00:25:57,230 --> 00:26:01,020 So let's just do that. 492 00:26:01,020 --> 00:26:02,360 So I think it's-- 493 00:26:02,360 --> 00:26:06,580 you have to help me, I can't read this very well. 494 00:26:06,580 --> 00:26:15,260 1ea star exponential, [INAUDIBLE] 15,000, 495 00:26:15,260 --> 00:26:26,950 slash 1.987 times-- what's body temperature? 496 00:26:26,950 --> 00:26:29,520 40ec you told me? 497 00:26:29,520 --> 00:26:31,774 So it's 310 Kelvin maybe-- 498 00:26:34,310 --> 00:26:40,550 times all these numbers, 0.8 times 2. 499 00:26:55,369 --> 00:26:56,410 Divide by 10 to the 23rd. 500 00:27:04,150 --> 00:27:05,090 More factors in there. 501 00:27:15,270 --> 00:27:19,035 OK, so 5 times 10 to the minus 25. 502 00:27:19,035 --> 00:27:20,160 We think we got this right? 503 00:27:34,573 --> 00:27:37,058 AUDIENCE: [INAUDIBLE] 504 00:27:42,890 --> 00:27:44,810 WILLIAM GREEN JR: But I want to get moles, 505 00:27:44,810 --> 00:27:47,810 because I have this in moles-- 506 00:27:47,810 --> 00:27:49,230 it's [INAUDIBLE]. 507 00:27:55,340 --> 00:27:58,461 Three times mole [INAUDIBLE] This 508 00:27:58,461 --> 00:27:59,960 is really mole of [INAUDIBLE] atoms. 509 00:28:09,090 --> 00:28:12,650 OK, so we'll try and see what happens. 510 00:28:12,650 --> 00:28:13,860 So 5 times 7 minus 25. 511 00:28:13,860 --> 00:28:18,640 It does seem pretty small, so we have a problem. 512 00:28:18,640 --> 00:28:22,210 And then the last reaction-- 513 00:28:22,210 --> 00:28:24,891 those reactions are typically 10 to the fifth, liters per mole 514 00:28:24,891 --> 00:28:25,390 second. 515 00:28:30,830 --> 00:28:34,150 This is for a recombination of peroxy radicals. 516 00:28:34,150 --> 00:28:40,300 So now, we have to get rid of the volume unit. 517 00:28:40,300 --> 00:28:41,380 This is for roo-- 518 00:28:41,380 --> 00:28:52,740 sorry, [INAUDIBLE] Yeah? 519 00:28:52,740 --> 00:28:53,360 Yes, question? 520 00:28:53,360 --> 00:28:55,815 AUDIENCE: [INAUDIBLE] 521 00:29:10,927 --> 00:29:12,760 WILLIAM GREEN JR: One mole per [INAUDIBLE].. 522 00:29:12,760 --> 00:29:15,735 Very good-- that's right, because [INAUDIBLE] that's 523 00:29:15,735 --> 00:29:16,360 just two atoms. 524 00:29:16,360 --> 00:29:20,470 It's actually two moles. 525 00:29:20,470 --> 00:29:22,105 Yes? 526 00:29:22,105 --> 00:29:23,480 That would change the [INAUDIBLE] 527 00:29:23,480 --> 00:29:27,590 Only a factor of 10 to the 23rd. 528 00:29:27,590 --> 00:29:29,040 So we'll get back. 529 00:29:29,040 --> 00:29:29,770 Thank you. 530 00:29:34,320 --> 00:29:41,449 Area 0.3, somewhere like it. 531 00:29:41,449 --> 00:29:42,990 OK, so now let's go do the same thing 532 00:29:42,990 --> 00:29:46,230 with this one, ro plus roo. 533 00:29:46,230 --> 00:29:51,800 So typically these reactions, the normal way they're written 534 00:29:51,800 --> 00:29:56,090 are numbers that are about 10 to 5th meters per mole second, 535 00:29:56,090 --> 00:29:58,066 for two radicals recombining. 536 00:30:02,250 --> 00:30:07,115 So now, I need to figure out how can I change the volume here. 537 00:30:07,115 --> 00:30:09,240 And the thing that is key is that I know the volume 538 00:30:09,240 --> 00:30:12,340 of this lipid particle. 539 00:30:12,340 --> 00:30:14,550 So what I really want is this. 540 00:30:14,550 --> 00:30:22,080 My k4 is going to be equal to normal k, divided 541 00:30:22,080 --> 00:30:28,530 by the volume of the reactor, because the rate we 542 00:30:28,530 --> 00:30:31,570 would write normally, which would be droodt-- 543 00:30:37,800 --> 00:30:42,510 it would be like negative 2k roo plus roo, 544 00:30:42,510 --> 00:30:49,280 times the moles, the concentration of roo squared. 545 00:30:49,280 --> 00:30:50,797 This how we would normally write it. 546 00:30:53,460 --> 00:30:56,282 And so we have to have the-- 547 00:30:56,282 --> 00:30:57,240 this unit is all right. 548 00:30:57,240 --> 00:31:00,710 So this is the volume of the reactor. 549 00:31:00,710 --> 00:31:05,820 So we were having nroo over v, so we 550 00:31:05,820 --> 00:31:11,180 might need Avogadro's number over here, because the rate 551 00:31:11,180 --> 00:31:13,250 here is in moles. 552 00:31:13,250 --> 00:31:15,635 But now, we are going to do single molecules. 553 00:31:15,635 --> 00:31:16,135 Yeah? 554 00:31:16,135 --> 00:31:21,470 AUDIENCE: Do you ever actually use k4 in calculations? 555 00:31:21,470 --> 00:31:23,000 WILLIAM GREEN JR: Yeah, for a. 556 00:31:23,000 --> 00:31:25,680 I think an a is there. 557 00:31:25,680 --> 00:31:28,060 Good question. 558 00:31:28,060 --> 00:31:32,450 All right, so we think this should 559 00:31:32,450 --> 00:31:34,931 be like a volume per molecule or something 560 00:31:34,931 --> 00:31:36,680 like that, for one molecule. 561 00:31:36,680 --> 00:31:41,870 So this should be k4, should be 10 562 00:31:41,870 --> 00:31:47,750 to the 5th, meters per mole second, 563 00:31:47,750 --> 00:31:50,780 divided by 4/3 pi r cubed. 564 00:31:54,920 --> 00:32:00,730 And then, we need a mole-- 565 00:32:00,730 --> 00:32:04,255 [INAUDIBLE] 23rd molecules. 566 00:32:04,255 --> 00:32:05,630 And we're gonna have to make sure 567 00:32:05,630 --> 00:32:07,338 that the leaders and these guys match up, 568 00:32:07,338 --> 00:32:10,815 which is not going to be so easy. 569 00:32:10,815 --> 00:32:14,160 You might use 10 to the minus 6 meters. 570 00:32:14,160 --> 00:32:16,590 This is going to be meters cubed, 571 00:32:16,590 --> 00:32:21,936 so I need 10 to the 3 liters per liter cubed. 572 00:32:24,600 --> 00:32:27,780 And I think that will all work out to be per second. 573 00:32:27,780 --> 00:32:28,620 So let's try it. 574 00:32:28,620 --> 00:32:39,540 So this would be 10 to the 5th over 4/3 pi is about 4-- 575 00:32:39,540 --> 00:32:44,560 10 to the negative 18, 6 times 10 to the 23rd. 576 00:32:50,810 --> 00:32:55,090 So all the big ones cancel each other out, is a 1 over 24. 577 00:33:02,450 --> 00:33:03,940 Oh, I lost it. 578 00:33:03,940 --> 00:33:05,570 That's bad. 579 00:33:05,570 --> 00:33:12,167 OK, so one over 24,000. 580 00:33:12,167 --> 00:33:14,000 It's a lot easier to do with a lot of people 581 00:33:14,000 --> 00:33:15,682 checking your work. 582 00:33:15,682 --> 00:33:17,140 All right, so four times n minus 5. 583 00:33:24,750 --> 00:33:26,450 So this is what we think k is. 584 00:33:29,794 --> 00:33:30,710 Anything else we need. 585 00:33:30,710 --> 00:33:32,870 We need a t-max, you want to guess the time? 586 00:33:35,650 --> 00:33:37,840 You want to wait? 587 00:33:37,840 --> 00:33:40,230 The time for the main reaction, the time constant 588 00:33:40,230 --> 00:33:44,150 is like seconds, right? 589 00:33:44,150 --> 00:33:48,460 So if we made 1,000 seconds, a lot of stuff 590 00:33:48,460 --> 00:33:50,830 is going to happen, right? 591 00:33:50,830 --> 00:33:55,260 So maybe 1,000 seconds will be OK for t-max. 592 00:33:55,260 --> 00:33:56,562 So let's try this all. 593 00:33:59,945 --> 00:34:01,547 Where's the main function. 594 00:34:14,969 --> 00:34:17,219 The main function-- 595 00:34:17,219 --> 00:34:22,489 [INAUDIBLE] my n initial was simple 1, 0. 596 00:34:28,780 --> 00:34:52,230 And k, which was decided was 1e minus 5, [INAUDIBLE],, 2.3, 4e, 597 00:34:52,230 --> 00:34:54,489 25. 598 00:34:54,489 --> 00:34:58,067 Now, if you just look at these rates for a second, 599 00:34:58,067 --> 00:35:00,150 I think you can see a problem we're going to have. 600 00:35:05,077 --> 00:35:06,493 How many steps are we going to do? 601 00:35:06,493 --> 00:35:09,331 I don't know. 602 00:35:09,331 --> 00:35:13,900 10,000. 603 00:35:13,900 --> 00:35:15,970 The time scales here-- 604 00:35:15,970 --> 00:35:18,580 this 27 is pretty fast. 605 00:35:18,580 --> 00:35:20,622 So the stuff is going to diffuse out of there, 606 00:35:20,622 --> 00:35:22,663 because it's going to disappear, and then nothing 607 00:35:22,663 --> 00:35:23,210 is gonna happen. 608 00:35:23,210 --> 00:35:23,709 Yeah? 609 00:35:23,709 --> 00:35:26,000 AUDIENCE: [INAUDIBLE] 610 00:35:28,330 --> 00:35:30,870 WILLIAM GREEN JR: Centimeters squared, I thought so, yeah. 611 00:35:30,870 --> 00:35:35,880 Thank you, so we think this is 10 to the minus 9. 612 00:35:35,880 --> 00:35:42,800 So this is actually [INAUDIBLE] lower, is that right? 613 00:35:44,955 --> 00:35:46,330 We're still gonna have a problem. 614 00:35:46,330 --> 00:35:48,480 But it's not quite bad [INAUDIBLE] problem. 615 00:35:48,480 --> 00:35:49,230 So let's fix that. 616 00:35:54,190 --> 00:35:56,470 Um, so I think our problem is that the 1e minus 5 617 00:35:56,470 --> 00:35:58,270 is actually too slow. 618 00:35:58,270 --> 00:36:04,580 So radicals are diffusing in from outside at some rate, 619 00:36:04,580 --> 00:36:07,120 and it's got to be a rate so that if there 620 00:36:07,120 --> 00:36:10,180 was no reaction, basically, the concentrations of the stuff 621 00:36:10,180 --> 00:36:13,045 here and here might be about the same, same order of magnitude, 622 00:36:13,045 --> 00:36:15,170 of the stuff that dissolved in the water, dissolved 623 00:36:15,170 --> 00:36:16,637 in the lipid. 624 00:36:16,637 --> 00:36:18,470 Maybe a couple of [INAUDIBLE] are different, 625 00:36:18,470 --> 00:36:20,630 but not a million times different. 626 00:36:20,630 --> 00:36:27,860 And so we need to have the rate of this stuff coming in 627 00:36:27,860 --> 00:36:29,720 to be something reasonable, that's 628 00:36:29,720 --> 00:36:32,180 going to be consistent with having a chance of having 629 00:36:32,180 --> 00:36:33,770 some radical in there. 630 00:36:33,770 --> 00:36:36,200 So now we to guess what we think the real outside world 631 00:36:36,200 --> 00:36:38,360 radical concentration is. 632 00:36:38,360 --> 00:36:41,000 So maybe-- I don't know, what? 633 00:36:41,000 --> 00:36:44,400 1e minus 10 moles per liter? 634 00:36:44,400 --> 00:36:46,100 1e minus 6 moles per liter? 635 00:36:46,100 --> 00:36:47,297 I don't know. 636 00:36:47,297 --> 00:36:48,130 Any biologists here? 637 00:36:48,130 --> 00:36:50,505 Do you know how many free radicals you have in your body? 638 00:36:50,505 --> 00:36:52,634 AUDIENCE: [INAUDIBLE] 639 00:36:53,015 --> 00:36:54,890 WILLIAM GREEN JR: They can measure it, right? 640 00:36:54,890 --> 00:36:57,052 So it can't be zero. 641 00:36:57,052 --> 00:36:58,760 People talk about reactive oxygen species 642 00:36:58,760 --> 00:37:01,622 in your body, ROS. 643 00:37:01,622 --> 00:37:04,080 Yes, so I don't know what it is, 10 to the minus 6, maybe-- 644 00:37:04,080 --> 00:37:07,270 10 to the minus 8. 645 00:37:07,270 --> 00:37:10,740 So we had the number for-- 646 00:37:10,740 --> 00:37:14,770 1e3 e3 is for going out from the-- 647 00:37:20,290 --> 00:37:32,710 we have that rate leaving is 1e3 per second times the number 648 00:37:32,710 --> 00:37:35,600 in there divided by the volume, really. 649 00:37:35,600 --> 00:37:40,330 Well, it's times the number, that's the rate that's leaving. 650 00:37:40,330 --> 00:37:45,665 But we would think of this as a k. 651 00:37:47,387 --> 00:37:49,220 I don't know how to think of this, actually. 652 00:37:49,220 --> 00:37:52,240 But for sure, the volume matters. 653 00:37:52,240 --> 00:37:58,990 So in order for us to compute this, we use the r squared. 654 00:37:58,990 --> 00:38:01,530 Now, another way you look at this is say well, 655 00:38:01,530 --> 00:38:05,228 is diffusion times the gradient in the concentration? 656 00:38:05,228 --> 00:38:07,100 AUDIENCE: [INAUDIBLE] 657 00:38:08,980 --> 00:38:14,510 WILLIAM GREEN JR: [INAUDIBLE] 658 00:38:14,510 --> 00:38:15,420 Well, it's OK. 659 00:38:15,420 --> 00:38:17,270 They would live in their little tiny thing for a millisecond, 660 00:38:17,270 --> 00:38:17,940 and then they diffuse out. 661 00:38:17,940 --> 00:38:19,815 I think that actually sounds very reasonable. 662 00:38:19,815 --> 00:38:21,080 It's only a micron. 663 00:38:21,080 --> 00:38:22,642 It's a very tiny, little thing. 664 00:38:22,642 --> 00:38:24,725 So the question is how do we complete the reverse? 665 00:38:27,940 --> 00:38:33,970 So if we have stuff outside, and suppose we didn't have anything 666 00:38:33,970 --> 00:38:36,656 inside, we'd have some rate of diffusion of the radical 667 00:38:36,656 --> 00:38:37,780 from the outside coming in. 668 00:38:44,640 --> 00:38:45,910 How do we think about it? 669 00:38:45,910 --> 00:38:47,660 It's really got to be the inverse of this. 670 00:38:47,660 --> 00:38:50,110 So if we think the time constant is 671 00:38:50,110 --> 00:38:54,220 10 to the minus 3-- a millisecond to come out, 672 00:38:54,220 --> 00:38:56,790 it's probably about a millisecond to come in. 673 00:38:56,790 --> 00:38:58,200 I don't know. 674 00:38:58,200 --> 00:39:02,430 You think it's got to maintain whatever initial concentration 675 00:39:02,430 --> 00:39:05,420 we put there, one per volume, then 676 00:39:05,420 --> 00:39:06,750 it's got to be about the same. 677 00:39:06,750 --> 00:39:08,870 So this can't be as tiny as 10 to the minus 5. 678 00:39:13,150 --> 00:39:17,380 So if we take the average concentration as one, 679 00:39:17,380 --> 00:39:20,080 then this should 10 to the 3, I think. 680 00:39:20,080 --> 00:39:22,230 If we think the average concentration is 10, 681 00:39:22,230 --> 00:39:23,560 then it should be 10 to the 4. 682 00:39:23,560 --> 00:39:25,960 If we think the average concentration this 100, 683 00:39:25,960 --> 00:39:27,480 then it should be 10 to the five. 684 00:39:27,480 --> 00:39:28,990 So let's try 10 to the 3. 685 00:39:35,120 --> 00:39:38,780 So every millisecond, something comes in or goes out, 686 00:39:38,780 --> 00:39:42,690 some radical comes in and out. 687 00:39:42,690 --> 00:39:44,900 You guys buy this? 688 00:39:44,900 --> 00:39:47,505 Would you defend this to your boss? 689 00:39:47,505 --> 00:39:49,980 You can blame it on Professor Green. 690 00:39:49,980 --> 00:39:51,470 All right, here goes nothing. 691 00:39:51,470 --> 00:39:53,626 Do you think it's going to work? 692 00:39:53,626 --> 00:39:55,578 [LAUGHTER] 693 00:39:56,554 --> 00:40:01,319 Aww, aww, line 29. 694 00:40:01,319 --> 00:40:01,860 What's wrong? 695 00:40:07,572 --> 00:40:09,000 What's wrong with that? 696 00:40:11,870 --> 00:40:12,906 Parentheses off? 697 00:40:12,906 --> 00:40:17,485 AUDIENCE: [INAUDIBLE] 698 00:40:17,485 --> 00:40:19,860 WILLIAM GREEN JR: Maybe I didn't save the latest version, 699 00:40:19,860 --> 00:40:21,094 let's try again. 700 00:40:25,070 --> 00:40:26,640 Ah, I didn't say the latest version. 701 00:40:26,640 --> 00:40:27,746 That's what it is. 702 00:40:31,052 --> 00:40:32,010 Now, here goes nothing. 703 00:40:38,910 --> 00:40:39,940 That [INAUDIBLE] help. 704 00:40:39,940 --> 00:40:41,100 Leave me alone. 705 00:40:41,100 --> 00:40:47,800 All right, trajectory, the first column 706 00:40:47,800 --> 00:40:51,260 is the times, so it uses the x-axis. 707 00:40:51,260 --> 00:40:57,170 And the last column is the oxidation, the products. 708 00:40:57,170 --> 00:40:59,003 So let's see if anything peroxidized or not. 709 00:41:08,758 --> 00:41:10,754 [LAUGHTER] 710 00:41:13,249 --> 00:41:15,245 [INTERPOSING VOICES] 711 00:41:32,963 --> 00:41:35,529 WILLIAM GREEN JR: Oh, it should have all the zeros, right? 712 00:41:35,529 --> 00:41:37,570 So how can we do it when we [INAUDIBLE] that way. 713 00:41:37,570 --> 00:41:39,280 That's really weird. 714 00:41:39,280 --> 00:41:40,250 Try it again. 715 00:41:43,250 --> 00:41:44,870 [INTERPOSING VOICES] 716 00:41:47,810 --> 00:41:52,410 WILLIAM GREEN JR: The time is 2 plus tau. 717 00:41:56,430 --> 00:41:58,780 AUDIENCE: [INAUDIBLE]. 718 00:41:58,780 --> 00:42:01,720 WILLIAM GREEN JR: I guess if you look at the [INAUDIBLE] So 719 00:42:01,720 --> 00:42:02,440 trajectory-- 720 00:42:11,187 --> 00:42:12,520 so it only [INAUDIBLE] 2 points. 721 00:42:12,520 --> 00:42:13,390 That's why it looks like that. 722 00:42:13,390 --> 00:42:15,181 I don't know why it doesn't show the zeros. 723 00:42:15,181 --> 00:42:17,160 Maybe they'll show on top of the origin there. 724 00:42:17,160 --> 00:42:21,116 So why did it only give us two points? 725 00:42:21,116 --> 00:42:22,910 AUDIENCE: [INAUDIBLE] 726 00:42:22,910 --> 00:42:25,550 WILLIAM GREEN JR: Yeah, also-- 727 00:42:25,550 --> 00:42:32,430 seems like a 307 oxidations, but why 307 all of a sudden? 728 00:42:32,430 --> 00:42:34,820 That makes no sense, right-- 729 00:42:34,820 --> 00:42:36,840 because it should be one at a time. 730 00:42:36,840 --> 00:42:40,525 I should be seeing one at a time coming in. 731 00:42:40,525 --> 00:42:42,473 AUDIENCE: [INAUDIBLE] 732 00:42:49,820 --> 00:42:51,570 WILLIAM GREEN JR: Yes, it's very worrying. 733 00:42:51,570 --> 00:42:52,880 I agree, so we have a bug. 734 00:42:55,590 --> 00:42:58,710 So where is our bug. 735 00:42:58,710 --> 00:43:00,010 This is where I need your help. 736 00:43:00,010 --> 00:43:04,460 OK guys, let's figure out why didn't this work. 737 00:43:04,460 --> 00:43:09,940 So I'm storing-- by stepping the steps, they're going up. 738 00:43:09,940 --> 00:43:12,590 Ah, I know what's wrong. 739 00:43:12,590 --> 00:43:15,890 I need this step thing inside the loop here. 740 00:43:15,890 --> 00:43:16,620 So all of this-- 741 00:43:19,390 --> 00:43:21,700 so let's see if I can explain this. 742 00:43:21,700 --> 00:43:25,220 I'm storing them according to the step, 743 00:43:25,220 --> 00:43:28,150 but right now, the wild loop is just zipping around, 744 00:43:28,150 --> 00:43:30,450 and then, it ends at the step and just gets one. 745 00:43:30,450 --> 00:43:32,560 So I'd rather start again. 746 00:43:35,875 --> 00:43:37,226 It's gonna work this time? 747 00:43:39,625 --> 00:43:40,875 You guys don't have any faith. 748 00:43:46,930 --> 00:43:49,150 If people say that scientists and engineers don't 749 00:43:49,150 --> 00:43:52,030 have any faith, I think we have more faith than anybody else. 750 00:43:52,030 --> 00:43:53,863 We believe stuff like this is going to work. 751 00:44:04,460 --> 00:44:06,150 It's doing something now. 752 00:44:06,150 --> 00:44:08,620 Who knows what? 753 00:44:08,620 --> 00:44:10,580 [INTERPOSING VOICES] 754 00:44:22,830 --> 00:44:24,036 WILLIAM GREEN JR: Yup? 755 00:44:24,036 --> 00:44:25,910 AUDIENCE: [INAUDIBLE] time until your arrival 756 00:44:25,910 --> 00:44:29,933 time, 7:15 [INAUDIBLE] 757 00:44:29,933 --> 00:44:32,016 WILLIAM GREEN JR: [INAUDIBLE] is, not good, right? 758 00:44:32,016 --> 00:44:33,310 AUDIENCE: [INAUDIBLE] 759 00:44:34,372 --> 00:44:36,330 WILLIAM GREEN JR: Yeah, it's a very good point. 760 00:44:36,330 --> 00:44:38,308 I have a nested loop that should not be, right? 761 00:44:38,308 --> 00:44:41,800 AUDIENCE: [INAUDIBLE] You don't necessarily 762 00:44:41,800 --> 00:44:43,354 want to sample every arrival time. 763 00:44:43,354 --> 00:44:46,216 You might want to sample [INAUDIBLE] 764 00:44:46,216 --> 00:44:48,124 So you might want to have two. 765 00:44:48,124 --> 00:44:50,520 You don't necessarily want to [INAUDIBLE] every single-- 766 00:44:50,520 --> 00:44:52,925 WILLIAM GREEN JR: Yes, yes, I agree. 767 00:44:52,925 --> 00:44:55,069 AUDIENCE: [INAUDIBLE] 768 00:44:55,069 --> 00:44:57,360 WILLIAM GREEN JR: OK, so let's see how we can fix this. 769 00:44:57,360 --> 00:45:01,910 So we really want-- is it really a jump out? 770 00:45:01,910 --> 00:45:03,574 If the number of steps gets too large, 771 00:45:03,574 --> 00:45:05,490 we just want to jump out, so we want to go to? 772 00:45:05,490 --> 00:45:06,624 What do you think? 773 00:45:06,624 --> 00:45:07,475 [INTERPOSING VOICES] 774 00:45:07,475 --> 00:45:09,350 WILLIAM GREEN JR: Break, that's what we want. 775 00:45:09,350 --> 00:45:11,284 So while is not the correct thing to do here. 776 00:45:11,284 --> 00:45:14,070 AUDIENCE: Why would t [INAUDIBLE].. 777 00:45:14,070 --> 00:45:16,150 WILLIAM GREEN JR: So we're stepping time, 778 00:45:16,150 --> 00:45:17,709 every time we'll do the steps. 779 00:45:17,709 --> 00:45:18,750 And we just want a break. 780 00:45:21,642 --> 00:45:27,096 [INAUDIBLE] step greater than max steps. 781 00:45:27,096 --> 00:45:31,353 AUDIENCE: Why don't you do it with a while loop [INAUDIBLE] 782 00:45:33,729 --> 00:45:35,270 WILLIAM GREEN JR: What happens if you 783 00:45:35,270 --> 00:45:35,980 do a wild loop like that? 784 00:45:35,980 --> 00:45:36,560 Do you guys know? 785 00:45:36,560 --> 00:45:37,101 Does it work? 786 00:45:37,101 --> 00:45:37,935 [INTERPOSING VOICES] 787 00:45:37,935 --> 00:45:39,142 WILLIAM GREEN JR: It'll work. 788 00:45:39,142 --> 00:45:40,176 OK, that's easy. 789 00:45:50,440 --> 00:45:52,679 Double and-- I tired it with and this morning. 790 00:45:52,679 --> 00:45:54,720 It didn't work, so that's why I stopped doing it. 791 00:46:00,040 --> 00:46:02,760 Stuff like that will kill you, doesn't it? 792 00:46:02,760 --> 00:46:05,384 All right, we gotta get rid of one of the ends at the end. 793 00:46:05,384 --> 00:46:07,352 AUDIENCE: [INAUDIBLE] 794 00:46:10,075 --> 00:46:12,450 WILLIAM GREEN JR: I think it's likely to cause a problem, 795 00:46:12,450 --> 00:46:14,279 why it's taking 10 million years. 796 00:46:14,279 --> 00:46:16,820 So really, is there a reason it should be nested loop, right? 797 00:46:16,820 --> 00:46:17,477 Yes. 798 00:46:17,477 --> 00:46:19,425 AUDIENCE: [INAUDIBLE] 799 00:46:30,720 --> 00:46:32,839 WILLIAM GREEN JR: All right, try again. 800 00:46:32,839 --> 00:46:34,691 [INTERPOSING VOICES] 801 00:46:36,095 --> 00:46:38,370 WILLIAM GREEN JR: That's too fast. 802 00:46:38,370 --> 00:46:41,170 Try that again. 803 00:46:41,170 --> 00:46:41,850 That's not good. 804 00:46:44,916 --> 00:46:47,608 See we have a [INAUDIBLE] here. 805 00:46:47,608 --> 00:46:48,390 AUDIENCE: Oh no. 806 00:46:48,390 --> 00:46:53,280 WILLIAM GREEN JR: Oh, jumps to one. 807 00:46:53,280 --> 00:46:56,400 That doesn't look very good. 808 00:46:56,400 --> 00:46:58,171 Try that again. 809 00:46:58,171 --> 00:46:58,670 Boom. 810 00:47:05,890 --> 00:47:07,000 AUDIENCE: Oh! 811 00:47:07,000 --> 00:47:09,208 WILLIAM GREEN JR: Oh, that was pretty interesting, so 812 00:47:09,208 --> 00:47:12,400 much more like what you expect, so that at some time steps, 813 00:47:12,400 --> 00:47:15,700 I have one, two, three, or four, or five radicals 814 00:47:15,700 --> 00:47:18,010 in this vesicle. 815 00:47:18,010 --> 00:47:21,350 I only have one time separate because of the nine. 816 00:47:21,350 --> 00:47:23,800 So I think this actually looks like what I expect. 817 00:47:23,800 --> 00:47:26,670 I should see it jumping up and down, stuff goes in and out, 818 00:47:26,670 --> 00:47:28,852 sometimes it reacts, sometimes it goes away. 819 00:47:28,852 --> 00:47:29,810 So this one is correct. 820 00:47:29,810 --> 00:47:31,860 I don't know what's happened with the other one. 821 00:47:31,860 --> 00:47:32,930 So I'll have to figure out what's 822 00:47:32,930 --> 00:47:33,971 wrong with that equation. 823 00:47:36,990 --> 00:47:39,695 All right, we're almost done time. 824 00:47:39,695 --> 00:47:41,820 Well, I want to talk about for just one minute is-- 825 00:47:41,820 --> 00:47:43,820 what are we gonna do after we have this working? 826 00:47:43,820 --> 00:47:47,420 So we get this working, we have the trajectory, 827 00:47:47,420 --> 00:47:50,130 we really want to run 10,000 trajectories, 828 00:47:50,130 --> 00:47:52,530 because all we're doing is sampling from the probability, 829 00:47:52,530 --> 00:47:55,020 just the distribution of time. 830 00:47:55,020 --> 00:47:57,315 So we need to run zillions of them. 831 00:47:57,315 --> 00:47:58,690 So this whole thing we just wrote 832 00:47:58,690 --> 00:48:02,562 would be inside a loop that runs a lot of different cases, 833 00:48:02,562 --> 00:48:05,020 because every time you run this, because the random number, 834 00:48:05,020 --> 00:48:07,150 you're going to get a different trajectory. 835 00:48:07,150 --> 00:48:10,060 And what you care about is some kind of average behavior. 836 00:48:10,060 --> 00:48:12,190 Or you might want to know what's the percentage 837 00:48:12,190 --> 00:48:14,980 chance that I'm going to have [INAUDIBLE] oxidized and die? 838 00:48:14,980 --> 00:48:17,110 So you might say I want to count what 839 00:48:17,110 --> 00:48:18,610 fraction of the trajectories end up 840 00:48:18,610 --> 00:48:21,620 with number of peroxide greater than some number, that 841 00:48:21,620 --> 00:48:22,840 means I'm dead. 842 00:48:22,840 --> 00:48:25,090 And if that probability is too high, 843 00:48:25,090 --> 00:48:27,057 then I know I'm in big trouble. 844 00:48:27,057 --> 00:48:28,390 So that'd be one possible thing. 845 00:48:28,390 --> 00:48:30,670 You might have whatever objective function you want, 846 00:48:30,670 --> 00:48:34,030 but you need to run a lot to get good statistics for anything. 847 00:48:34,030 --> 00:48:37,000 So you're gonna have to embed this whole calculation 848 00:48:37,000 --> 00:48:38,980 inside a loop, and then, you're going 849 00:48:38,980 --> 00:48:41,160 to get a zillion of these trajectories out. 850 00:48:41,160 --> 00:48:44,290 And you figure out how are you going to analyze them in order 851 00:48:44,290 --> 00:48:46,870 to figure out what you want? 852 00:48:46,870 --> 00:48:52,570 So one way is if you could add the trajectories up-- 853 00:48:52,570 --> 00:48:54,770 so I have a trajectory-- 854 00:48:54,770 --> 00:49:01,380 suppose I have the number roh's versus time. 855 00:49:01,380 --> 00:49:02,860 And I do it once, and I have none. 856 00:49:02,860 --> 00:49:05,443 Then I have one, and then I have two, and then, I wait longer, 857 00:49:05,443 --> 00:49:06,840 and I get three. 858 00:49:06,840 --> 00:49:08,770 And then, I wait longer, I get four. 859 00:49:08,770 --> 00:49:10,340 Whatever, something like that. 860 00:49:10,340 --> 00:49:12,700 That's what it really looks like for one trajectory. 861 00:49:12,700 --> 00:49:14,250 And then, the next time I run it, 862 00:49:14,250 --> 00:49:17,470 it starts in a slightly different time. 863 00:49:17,470 --> 00:49:21,170 And this time it runs longer before something else happens. 864 00:49:21,170 --> 00:49:25,522 And then, it gets here, and then maybe, it goes over here. 865 00:49:25,522 --> 00:49:26,980 And I have a lot of them like that. 866 00:49:26,980 --> 00:49:29,950 I have 10,000 trajectories, all look like that. 867 00:49:29,950 --> 00:49:34,945 So if I could add them, then I can do an average, 868 00:49:34,945 --> 00:49:36,486 to get an average trajectory, so that 869 00:49:36,486 --> 00:49:38,060 would be one possible thing. 870 00:49:38,060 --> 00:49:41,960 Or I might want to histogram, so I might pick one time point. 871 00:49:41,960 --> 00:49:45,420 So like after 20 minutes, I want a histogram 872 00:49:45,420 --> 00:49:47,910 of what this looks like here or here. 873 00:49:51,260 --> 00:49:53,515 One of them has four peroxides, and one of them 874 00:49:53,515 --> 00:49:54,630 has five peroxides. 875 00:49:54,630 --> 00:49:56,400 And then the other 9,999-- 876 00:49:56,400 --> 00:49:58,170 some of the three, some of the whatever. 877 00:49:58,170 --> 00:49:59,320 Yes, question? 878 00:49:59,320 --> 00:50:02,610 AUDIENCE: [INAUDIBLE] 879 00:50:02,610 --> 00:50:04,960 you're not gonna get the same time points-- 880 00:50:04,960 --> 00:50:05,950 WILLIAM GREEN JR: You're not going to get the same time 881 00:50:05,950 --> 00:50:06,825 points, that's right. 882 00:50:06,825 --> 00:50:08,847 So see the first time it stopped, 883 00:50:08,847 --> 00:50:11,430 the first time point was here, the second time, the first time 884 00:50:11,430 --> 00:50:12,610 point was here. 885 00:50:12,610 --> 00:50:14,120 And they'll all be different. 886 00:50:14,120 --> 00:50:15,970 So one is I was asking a few of the students 887 00:50:15,970 --> 00:50:19,300 before the class started, there's 888 00:50:19,300 --> 00:50:20,920 got to be a program in MATLAB that 889 00:50:20,920 --> 00:50:25,420 will let you generate these kind of plots with the flat lines. 890 00:50:25,420 --> 00:50:28,250 Or even a linear interpolation would be OK too. 891 00:50:28,250 --> 00:50:31,382 But you need to have some way to add them up 892 00:50:31,382 --> 00:50:33,090 as continuous functions, because they all 893 00:50:33,090 --> 00:50:34,215 have different time points. 894 00:50:34,215 --> 00:50:38,670 So that's one practical issue about it, 895 00:50:38,670 --> 00:50:41,280 because you want to pick some special time you care about, 896 00:50:41,280 --> 00:50:43,140 and you want to know what does the trajectory say, 897 00:50:43,140 --> 00:50:44,390 what does this trajectory say? 898 00:50:44,390 --> 00:50:46,061 But you actually only have numbers here, 899 00:50:46,061 --> 00:50:48,060 just really you have that number and this number 900 00:50:48,060 --> 00:50:48,726 and this number. 901 00:50:48,726 --> 00:50:50,570 That's all you got. 902 00:50:50,570 --> 00:50:51,374 Yeah? 903 00:50:51,374 --> 00:50:54,138 AUDIENCE: You can plot like a-- an out of time 904 00:50:54,138 --> 00:51:00,507 to get to n amount of roh's and then, that would be [INAUDIBLE] 905 00:51:00,507 --> 00:51:02,590 WILLIAM GREEN JR: OK, so then you plot [INAUDIBLE] 906 00:51:02,590 --> 00:51:04,030 versus time instead, that's right. 907 00:51:04,030 --> 00:51:06,190 So that you just think of what you want. 908 00:51:06,190 --> 00:51:07,810 You're going to have all this trajectory information. 909 00:51:07,810 --> 00:51:09,040 And then you need to figure out what do you want, and then, 910 00:51:09,040 --> 00:51:10,190 what are you going to plot? 911 00:51:10,190 --> 00:51:12,250 And what are you trying to compute? 912 00:51:12,250 --> 00:51:14,410 And you might want to compute not only the number 913 00:51:14,410 --> 00:51:16,720 but the standard deviation of that number, because you don't 914 00:51:16,720 --> 00:51:17,740 know how many trajectories you have 915 00:51:17,740 --> 00:51:19,281 to run before the center of deviation 916 00:51:19,281 --> 00:51:21,920 is narrow enough that you'll be confident with it. 917 00:51:21,920 --> 00:51:24,700 So this is a general problem with this whole approach-- 918 00:51:24,700 --> 00:51:27,130 is that what you're getting out are just 919 00:51:27,130 --> 00:51:28,550 samples of things that happen. 920 00:51:28,550 --> 00:51:29,830 It's just like if you were doing a Monte Carlo, 921 00:51:29,830 --> 00:51:31,990 and you just got some of the energy values 922 00:51:31,990 --> 00:51:34,830 from the hydrogen peroxide calculation you guys did, 923 00:51:34,830 --> 00:51:36,580 you have 47 of those energy values. 924 00:51:36,580 --> 00:51:38,240 What are you going to do with that? 925 00:51:38,240 --> 00:51:39,750 So you have to figure out, how are 926 00:51:39,750 --> 00:51:40,360 you going to take the [INAUDIBLE] 927 00:51:40,360 --> 00:51:41,193 of this calculation. 928 00:51:41,193 --> 00:51:44,740 It's sampling from the real solution, so it should be OK. 929 00:51:44,740 --> 00:51:45,520 But what is it? 930 00:51:45,520 --> 00:51:48,370 How are you going to handle that and use it as a means-- 931 00:51:48,370 --> 00:51:51,070 it's sort of like as if you ran a zillion experiments, 932 00:51:51,070 --> 00:51:53,980 and then, what would you do with all that data? 933 00:51:53,980 --> 00:51:55,765 So that's like issue number one. 934 00:51:55,765 --> 00:52:00,170 Now alternatively, you can rewrite this as the master 935 00:52:00,170 --> 00:52:03,400 equation and solve it as an ODE, in which case, 936 00:52:03,400 --> 00:52:10,420 you'll get explicitly p of each of these ends. 937 00:52:10,420 --> 00:52:17,290 So n rad, nroh time-- 938 00:52:17,290 --> 00:52:18,790 it would be continuous in principle, 939 00:52:18,790 --> 00:52:20,373 but actually, the ODE solver gives you 940 00:52:20,373 --> 00:52:22,580 out random time points also. 941 00:52:22,580 --> 00:52:26,590 So you get a similar kind of thing out from the ODE solver, 942 00:52:26,590 --> 00:52:28,600 except it'll give you probability 943 00:52:28,600 --> 00:52:30,700 for every possible range of these guys. 944 00:52:30,700 --> 00:52:33,283 So if you have one radical, two radicals, three radicals, four 945 00:52:33,283 --> 00:52:35,650 radical, fie radicals, and number of peroxides 946 00:52:35,650 --> 00:52:39,194 from one to 1,000, or however many peroxides you get, 947 00:52:39,194 --> 00:52:40,360 you're going to get numbers. 948 00:52:40,360 --> 00:52:42,651 So you have all these numbers, all these probabilities, 949 00:52:42,651 --> 00:52:43,460 at different times. 950 00:52:43,460 --> 00:52:45,260 Again, what are you going to do with that? 951 00:52:45,260 --> 00:52:48,430 So one thing people do a lot is they would plot, say, 952 00:52:48,430 --> 00:52:55,930 the number of roh's versus time. 953 00:52:55,930 --> 00:52:58,350 So at different time points, compute the average 954 00:52:58,350 --> 00:52:59,640 over all your trajectories. 955 00:52:59,640 --> 00:53:01,140 Were with, if you had this solution, 956 00:53:01,140 --> 00:53:12,054 you can compute that as nrooh, p, nrooh. 957 00:53:12,054 --> 00:53:14,220 So like this, you're gonna have some kind of average 958 00:53:14,220 --> 00:53:15,620 if you do it that way. 959 00:53:15,620 --> 00:53:18,320 And either one are fine, but you have to think of what you want, 960 00:53:18,320 --> 00:53:20,002 and then in both cases, you'll probably be 961 00:53:20,002 --> 00:53:20,860 interested in the dispersion. 962 00:53:20,860 --> 00:53:23,450 So you [INAUDIBLE] want to worry about the n squared too. 963 00:53:23,450 --> 00:53:25,280 We'll talk more about this on Monday. 964 00:53:25,280 --> 00:53:27,360 All right and I posted a homework problem 965 00:53:27,360 --> 00:53:30,230 that was given last year about this, for Kinetic Monte 966 00:53:30,230 --> 00:53:31,400 Carlo for catalysis. 967 00:53:31,400 --> 00:53:34,370 It's used a lot in heterogeneous catalysis. 968 00:53:34,370 --> 00:53:38,300 And if you have extra time, feel free to do the problem. 969 00:53:38,300 --> 00:53:39,870 It's a really good problem. 970 00:53:39,870 --> 00:53:41,870 Those of you who are feeling like you don't have 971 00:53:41,870 --> 00:53:44,244 any extra time, and you're about to kill yourself, please 972 00:53:44,244 --> 00:53:45,559 don't kill yourself. 973 00:53:45,559 --> 00:53:47,100 And instead, just send an email to me 974 00:53:47,100 --> 00:53:49,220 or Professor Swan asking for an extension. 975 00:53:49,220 --> 00:53:50,636 And we can give you some more time 976 00:53:50,636 --> 00:53:52,970 to finish up the homeworks that's due tonight. 977 00:53:52,970 --> 00:53:55,350 All right, talk to you 978 00:53:55,350 --> 00:53:56,900 later.