1 00:00:00,030 --> 00:00:02,400 The following content is provided under a Creative 2 00:00:02,400 --> 00:00:03,780 Commons license. 3 00:00:03,780 --> 00:00:06,020 Your support will help MIT OpenCourseWare 4 00:00:06,020 --> 00:00:10,100 continue to offer high quality educational resources for free. 5 00:00:10,100 --> 00:00:12,670 To make a donation or to view additional materials 6 00:00:12,670 --> 00:00:16,405 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:16,405 --> 00:00:17,030 at ocw.mit.edu. 8 00:00:25,897 --> 00:00:26,480 PROFESSOR: OK. 9 00:00:26,480 --> 00:00:29,700 So let's start. 10 00:00:29,700 --> 00:00:31,330 So first of all, it looks like there 11 00:00:31,330 --> 00:00:35,510 are many questions regarding the reading and homework. 12 00:00:35,510 --> 00:00:41,220 So if possible, I like to answer some of your more [INAUDIBLE] 13 00:00:41,220 --> 00:00:42,180 questions. 14 00:00:42,180 --> 00:00:47,001 Anyone want to raise a question I can answer? 15 00:00:47,001 --> 00:00:47,500 Yes. 16 00:00:47,500 --> 00:00:49,500 AUDIENCE: So something that we were running into 17 00:00:49,500 --> 00:00:52,340 was the definition of local ordered [INAUDIBLE]. 18 00:00:52,340 --> 00:00:56,082 Local and stationary and global [INAUDIBLE] 19 00:00:56,082 --> 00:01:00,020 and how to figure out [INAUDIBLE]. 20 00:01:00,020 --> 00:01:00,868 OK. 21 00:01:00,868 --> 00:01:04,290 So what we ended up doing was finding [INAUDIBLE] 22 00:01:04,290 --> 00:01:09,084 by taking dd plus 1 minus [INAUDIBLE]. 23 00:01:09,084 --> 00:01:09,750 PROFESSOR: Yeah. 24 00:01:09,750 --> 00:01:11,568 AUDIENCE: And then saying that that was 25 00:01:11,568 --> 00:01:14,160 the [INAUDIBLE] location of it. 26 00:01:14,160 --> 00:01:14,800 PROFESSOR: OK. 27 00:01:14,800 --> 00:01:15,360 Yeah. 28 00:01:15,360 --> 00:01:17,318 AUDIENCE: And then that was equal to-- whatever 29 00:01:17,318 --> 00:01:20,620 order [INAUDIBLE] that was was equal to the order of delta t 30 00:01:20,620 --> 00:01:25,154 times [INAUDIBLE] plus 1 where t is the local order [INAUDIBLE]. 31 00:01:25,154 --> 00:01:26,570 PROFESSOR: That's exactly what you 32 00:01:26,570 --> 00:01:29,990 should be doing is finding the local order of axis. 33 00:01:29,990 --> 00:01:35,285 Did anybody else understand what [INAUDIBLE]? 34 00:01:35,285 --> 00:01:38,590 OK. [INAUDIBLE] saying. 35 00:01:38,590 --> 00:01:40,980 So that's exactly the right way of finding out 36 00:01:40,980 --> 00:01:43,900 the local order of axis. 37 00:01:43,900 --> 00:01:45,660 Looking at the schema as [INAUDIBLE] n 38 00:01:45,660 --> 00:01:48,420 plus 1 minus the [INAUDIBLE] of the [INAUDIBLE]. 39 00:01:48,420 --> 00:01:49,470 That is you're tau. 40 00:01:49,470 --> 00:01:51,450 That is your [INAUDIBLE] area. 41 00:01:51,450 --> 00:01:54,800 And tau should be on the order delta t 42 00:01:54,800 --> 00:02:00,412 to the t plus 1 where p is a local order of [INAUDIBLE]. 43 00:02:00,412 --> 00:02:00,912 OK. 44 00:02:00,912 --> 00:02:04,370 That's basically repeating what [INAUDIBLE]. 45 00:02:04,370 --> 00:02:07,260 AUDIENCE: And how does that relate to the global order? 46 00:02:07,260 --> 00:02:09,510 PROFESSOR: How does that relate to the global order of 47 00:02:09,510 --> 00:02:10,010 [INAUDIBLE]? 48 00:02:10,010 --> 00:02:13,112 Anybody want to attempt to answer that? 49 00:02:13,112 --> 00:02:14,930 AUDIENCE: [INAUDIBLE] 50 00:02:14,930 --> 00:02:17,683 PROFESSOR: So say that there is an if. 51 00:02:17,683 --> 00:02:20,509 AUDIENCE: [INAUDIBLE] 52 00:02:20,509 --> 00:02:24,000 PROFESSOR: If [INAUDIBLE] under what conditions 53 00:02:24,000 --> 00:02:26,114 does [INAUDIBLE] theorem hold? 54 00:02:26,114 --> 00:02:28,520 AUDIENCE: [INAUDIBLE] 55 00:02:28,520 --> 00:02:30,010 PROFESSOR: 0 stable, right? 56 00:02:30,010 --> 00:02:34,390 As long as t is great or equal to 1, which usually it is, 57 00:02:34,390 --> 00:02:36,130 you have a consistency. 58 00:02:36,130 --> 00:02:39,620 So consistency is usually is not that much of problem 59 00:02:39,620 --> 00:02:42,910 when you already have the local order of [INAUDIBLE]. 60 00:02:42,910 --> 00:02:46,590 0 stable is something you have to separately. 61 00:02:46,590 --> 00:02:49,600 But as long as the schema is 0 stable, 62 00:02:49,600 --> 00:02:51,790 then the local order of accuracy is 63 00:02:51,790 --> 00:02:54,530 equal to the global order of accuracy 64 00:02:54,530 --> 00:02:56,950 as long as that order of accuracy is great of equal 65 00:02:56,950 --> 00:02:57,460 to 1. 66 00:03:00,540 --> 00:03:03,062 Is that clear? 67 00:03:03,062 --> 00:03:05,040 AUDIENCE: Could you repeat that one more time? 68 00:03:05,040 --> 00:03:07,670 PROFESSOR: If a [INAUDIBLE] is 0 stable, 69 00:03:07,670 --> 00:03:09,650 then the local order of accuracy is 70 00:03:09,650 --> 00:03:13,635 the same as the global order of accuracy. 71 00:03:13,635 --> 00:03:14,510 AUDIENCE: [INAUDIBLE] 72 00:03:19,929 --> 00:03:20,720 PROFESSOR: Exactly. 73 00:03:20,720 --> 00:03:25,700 When a scheme is not 0 stable, it's [INAUDIBLE] equal to 0. 74 00:03:25,700 --> 00:03:29,880 And there is no global order of accuracy at all. 75 00:03:29,880 --> 00:03:30,635 Yes. 76 00:03:30,635 --> 00:03:31,510 AUDIENCE: [INAUDIBLE] 77 00:03:35,895 --> 00:03:36,520 PROFESSOR: Yes. 78 00:03:36,520 --> 00:03:40,652 If a schema is not 0 stable, then the scheme doesn't work. 79 00:03:43,310 --> 00:03:49,026 Remember when we had the supposedly most accurate 80 00:03:49,026 --> 00:03:51,870 two-step scheme, [INAUDIBLE] scheme? 81 00:03:51,870 --> 00:03:53,840 What happens when we rebuilt the delta t? 82 00:03:53,840 --> 00:03:58,050 The error, instead of decreasing, it increases. 83 00:03:58,050 --> 00:04:02,020 So that's what happens with a not 0 stable scheme, where 84 00:04:02,020 --> 00:04:04,070 you refine your time step. 85 00:04:04,070 --> 00:04:07,530 Instead of the error decreasing, you have an increasing error. 86 00:04:07,530 --> 00:04:10,012 All right. 87 00:04:10,012 --> 00:04:10,845 Any other questions? 88 00:04:13,648 --> 00:04:14,523 AUDIENCE: [INAUDIBLE] 89 00:04:26,047 --> 00:04:26,630 PROFESSOR: OK. 90 00:04:26,630 --> 00:04:32,680 So the question is can we go over eigenvalues [INAUDIBLE] 91 00:04:32,680 --> 00:04:33,680 again? 92 00:04:33,680 --> 00:04:35,680 [INAUDIBLE] page-- yes. 93 00:04:38,450 --> 00:04:39,650 All right. 94 00:04:39,650 --> 00:04:42,590 So in doing eigenvalues, stability you plug in du 95 00:04:42,590 --> 00:04:46,300 dt equal to lambda u, right? 96 00:04:46,300 --> 00:04:49,090 So that is the question you use to analyze 97 00:04:49,090 --> 00:04:51,560 eigenvalue stability. 98 00:04:51,560 --> 00:04:55,063 Then you write down an equation of Un plus 1. 99 00:04:55,063 --> 00:05:01,960 Again, if it's a midpoint rule, then the scheme I'm plugging 100 00:05:01,960 --> 00:05:06,470 is plus 2 delta t times f of Vn. 101 00:05:06,470 --> 00:05:11,830 And in this case, f of Vn is lambda times the Vn right? 102 00:05:11,830 --> 00:05:15,920 So that is the equation you get by plugging in the differential 103 00:05:15,920 --> 00:05:19,530 equation into a scheme. 104 00:05:19,530 --> 00:05:22,924 Now, the next thing to do is to assume my Vn. 105 00:05:22,924 --> 00:05:27,460 And actually V n plus 1, Vn minus 1, 106 00:05:27,460 --> 00:05:29,270 and all other terms in your scheme 107 00:05:29,270 --> 00:05:36,270 satisfies an exponentially growing pattern. 108 00:05:36,270 --> 00:05:38,540 So when I whatever time stamp it is, 109 00:05:38,540 --> 00:05:43,170 it is equal to the 0 time stamp times a growth factor 110 00:05:43,170 --> 00:05:48,090 to whatever time stamp [INAUDIBLE]. 111 00:05:48,090 --> 00:05:52,500 So once you plug all of these into the scheme, 112 00:05:52,500 --> 00:05:55,450 you can find the quadratic equation for z 113 00:05:55,450 --> 00:05:56,970 if it's a two-step scheme. 114 00:05:56,970 --> 00:06:00,730 If it's a one-step scheme, you find just a linear equation 115 00:06:00,730 --> 00:06:01,440 for z. 116 00:06:01,440 --> 00:06:03,390 If it's a three-step scheme, you're 117 00:06:03,390 --> 00:06:09,940 going to find out with a cubic equation for z, et cetera. 118 00:06:09,940 --> 00:06:17,280 And then the next is to see, does that equation 119 00:06:17,280 --> 00:06:24,890 allow any z, any solution, who's modulus is greater than 1? 120 00:06:24,890 --> 00:06:28,950 If that equation for particular combination of delta t 121 00:06:28,950 --> 00:06:33,380 and lambda-- delta t and lambda is always multiplied together. 122 00:06:33,380 --> 00:06:38,850 So for whatever delta t times lambda if this equation allows 123 00:06:38,850 --> 00:06:42,550 for z that has a modulus greater than 1, then 124 00:06:42,550 --> 00:06:45,800 it is not eigenvalue stable. 125 00:06:45,800 --> 00:06:48,661 The combination of the scheme and that lambda delta t 126 00:06:48,661 --> 00:06:50,417 is not eigenvalue stable. 127 00:06:50,417 --> 00:06:50,916 Yeah. 128 00:06:50,916 --> 00:06:53,570 AUDIENCE: When you say the modulus greater than 129 00:06:53,570 --> 00:06:58,738 or equal to 1, I guess whenever I see modulus [INAUDIBLE]. 130 00:07:03,900 --> 00:07:04,830 PROFESSOR: OK. 131 00:07:04,830 --> 00:07:08,100 So the question is modulus is. 132 00:07:08,100 --> 00:07:11,190 Here the modulus is off a [INAUDIBLE] number. 133 00:07:11,190 --> 00:07:13,260 AUDIENCE: Oh, so do you mean like [INAUDIBLE]? 134 00:07:13,260 --> 00:07:13,926 PROFESSOR: Yeah. 135 00:07:13,926 --> 00:07:15,840 The [INAUDIBLE] to it is the real 136 00:07:15,840 --> 00:07:19,650 of z squared plus imaginary of d squared. 137 00:07:19,650 --> 00:07:21,120 What is the significance of that? 138 00:07:21,120 --> 00:07:24,810 The significance of that is that if that modulus 139 00:07:24,810 --> 00:07:28,750 is greater than 1, then z to the nth power 140 00:07:28,750 --> 00:07:32,620 is going to grow larger and larger as you make n larger. 141 00:07:32,620 --> 00:07:35,290 If the modulus is less than 1, then 142 00:07:35,290 --> 00:07:38,255 z to the nth power is going to become smaller as a take 143 00:07:38,255 --> 00:07:39,970 n to infinity. 144 00:07:39,970 --> 00:07:43,680 What happens if the modulus of these equal to 1? 145 00:07:43,680 --> 00:07:46,932 Then the modulus of these always going to be equal to 1 whatever 146 00:07:46,932 --> 00:07:47,432 [INAUDIBLE]. 147 00:07:50,180 --> 00:07:50,680 OK. 148 00:07:50,680 --> 00:07:53,290 Any other question? 149 00:07:53,290 --> 00:07:53,999 Yeah. 150 00:07:53,999 --> 00:07:54,874 AUDIENCE: [INAUDIBLE] 151 00:08:00,397 --> 00:08:00,980 PROFESSOR: OK. 152 00:08:00,980 --> 00:08:03,480 So last week's [INAUDIBLE], why does du 153 00:08:03,480 --> 00:08:07,886 dt [INAUDIBLE] negative lambda times u. 154 00:08:07,886 --> 00:08:13,440 So in analyzing eigenvalue stability, 155 00:08:13,440 --> 00:08:15,540 you are looking at equation of this form. 156 00:08:15,540 --> 00:08:16,040 Right? 157 00:08:16,040 --> 00:08:19,660 So if I write down equal to lambda minus lambda times u, 158 00:08:19,660 --> 00:08:23,520 it is still in this form. 159 00:08:23,520 --> 00:08:27,220 It's just the sign of the lambdas are kind of wrong. 160 00:08:27,220 --> 00:08:30,120 I mean, you can-- maybe I should use another symbol. 161 00:08:30,120 --> 00:08:35,299 Maybe I should say dudt equal to minus theta times u. 162 00:08:35,299 --> 00:08:37,940 In that case, then you just have to [INAUDIBLE] lambda 163 00:08:37,940 --> 00:08:39,070 equal to minus theta. 164 00:08:39,070 --> 00:08:41,100 And you can do the analysis the same way. 165 00:08:46,336 --> 00:08:48,716 Does that answer your question? 166 00:08:48,716 --> 00:08:50,620 AUDIENCE: Yeah. [INAUDIBLE] 167 00:08:50,620 --> 00:08:52,540 PROFESSOR: OK. 168 00:08:52,540 --> 00:08:55,780 Any other question? 169 00:08:55,780 --> 00:08:57,440 No? 170 00:08:57,440 --> 00:08:58,330 [INAUDIBLE] more. 171 00:08:58,330 --> 00:09:00,841 OK. 172 00:09:00,841 --> 00:09:01,340 OK. 173 00:09:01,340 --> 00:09:03,930 So for the reading recap, we have 174 00:09:03,930 --> 00:09:07,810 read about stiffness and the Newton-Raphson. 175 00:09:07,810 --> 00:09:10,540 Let me recap what they are. 176 00:09:10,540 --> 00:09:13,330 Stiffness are really orders of magnitude distance 177 00:09:13,330 --> 00:09:15,840 in timescales. 178 00:09:15,840 --> 00:09:17,265 OK. 179 00:09:17,265 --> 00:09:21,650 So a stiff problem means there is one timescale that 180 00:09:21,650 --> 00:09:25,750 is a very, very small compared to the timescale 181 00:09:25,750 --> 00:09:28,160 of the main phenomenon we want to simulate. 182 00:09:31,030 --> 00:09:34,840 Maybe we want to simulate some phenomenon that is interesting. 183 00:09:34,840 --> 00:09:38,870 But in order to simulate that, there is something 184 00:09:38,870 --> 00:09:42,510 of a hidden timescale that is much, much faster than the one 185 00:09:42,510 --> 00:09:44,030 we are interested in. 186 00:09:44,030 --> 00:09:48,090 And I'm going to show you two examples of what 187 00:09:48,090 --> 00:09:52,200 that very small timescale is. 188 00:09:52,200 --> 00:09:58,353 And so that is expressed in terms of physical phenomenon, 189 00:09:58,353 --> 00:09:59,622 two different timescales. 190 00:09:59,622 --> 00:10:03,100 we're presenting maybe two different physical phenomenon 191 00:10:03,100 --> 00:10:05,510 that you have to simulate at the same time. 192 00:10:05,510 --> 00:10:08,320 In terms of mathematics, where you write down OD, 193 00:10:08,320 --> 00:10:11,850 when you write an Ordinary Differential equation, 194 00:10:11,850 --> 00:10:15,940 you already kind of abstracted from the physics. 195 00:10:15,940 --> 00:10:21,090 So in that case, how do you interpret [INAUDIBLE]? 196 00:10:21,090 --> 00:10:21,590 OK. 197 00:10:21,590 --> 00:10:25,670 We can say that when you transform a physical phenomenon 198 00:10:25,670 --> 00:10:27,900 into an ordinary differential equation, 199 00:10:27,900 --> 00:10:32,490 the timescale is really translated into eigenvalues. 200 00:10:32,490 --> 00:10:35,175 And we are also going to see examples. 201 00:10:35,175 --> 00:10:40,180 So if you have two timescales, one slow, one fast, 202 00:10:40,180 --> 00:10:43,320 we are going to see two eigenvalues where 203 00:10:43,320 --> 00:10:48,050 you write down the equation in its matrix form 204 00:10:48,050 --> 00:10:51,790 and [INAUDIBLE] do eigenvalue analysis of the matrix. 205 00:10:51,790 --> 00:10:54,396 So we're going to see one large eigenvalue, one 206 00:10:54,396 --> 00:10:56,320 small eigenvalue. 207 00:10:56,320 --> 00:10:59,680 And the fast process responds to the larger one or the smaller 208 00:10:59,680 --> 00:11:03,930 one, what do you think? 209 00:11:03,930 --> 00:11:04,920 AUDIENCE: Large? 210 00:11:04,920 --> 00:11:06,180 PROFESSOR: The large, why? 211 00:11:06,180 --> 00:11:07,638 AUDIENCE: Because it's [INAUDIBLE]. 212 00:11:17,280 --> 00:11:19,050 PROFESSOR: Exactly. 213 00:11:19,050 --> 00:11:20,530 So the large eigenvalue corresponds 214 00:11:20,530 --> 00:11:22,740 to the fast process. 215 00:11:22,740 --> 00:11:27,780 So if you think of dudt equal to lambda u, 216 00:11:27,780 --> 00:11:31,980 what unit does lambda have? 217 00:11:31,980 --> 00:11:34,200 That's another way to think about it. 218 00:11:34,200 --> 00:11:37,530 What unit does lambda have? 219 00:11:37,530 --> 00:11:39,530 In engineering, one of the most important things 220 00:11:39,530 --> 00:11:42,280 is to look at the units of everything, right? 221 00:11:42,280 --> 00:11:43,280 Huh? 222 00:11:43,280 --> 00:11:44,285 AUDIENCE: [INAUDIBLE] 223 00:11:44,285 --> 00:11:44,910 PROFESSOR: Yes. 224 00:11:44,910 --> 00:11:48,275 The unit of lambda is 1 over the unit [INAUDIBLE]. 225 00:11:48,275 --> 00:11:50,730 It's 1 over [INAUDIBLE]. 226 00:11:50,730 --> 00:11:56,240 Lambda really has a unit of frequency or rate, right? 227 00:11:56,240 --> 00:11:59,150 Actually, lambda is a-- imaginary lambda 228 00:11:59,150 --> 00:12:01,746 it is exactly the [INAUDIBLE] frequency of the solution, 229 00:12:01,746 --> 00:12:02,454 right? 230 00:12:02,454 --> 00:12:05,724 So lambda has the unit of frequency. 231 00:12:05,724 --> 00:12:08,860 A very fast process is going to have a high frequency, 232 00:12:08,860 --> 00:12:11,080 therefore a large eigenvalue. 233 00:12:11,080 --> 00:12:13,000 And a very slow process is going to have 234 00:12:13,000 --> 00:12:18,356 a low frequency, and therefore a small eigenvalue. 235 00:12:18,356 --> 00:12:20,130 All right, does it make sense? 236 00:12:20,130 --> 00:12:22,030 So stiffness can either be interpreted 237 00:12:22,030 --> 00:12:24,970 in terms of order of magnitude difference in timescales 238 00:12:24,970 --> 00:12:30,960 or order of magnitude difference in eigenvalues. 239 00:12:30,960 --> 00:12:31,570 OK. 240 00:12:31,570 --> 00:12:35,540 You also read about Newton-Raphson. 241 00:12:35,540 --> 00:12:40,620 And Newton-Raphson is the matter of solving nonlinear equations 242 00:12:40,620 --> 00:12:43,910 using increasing schemes. 243 00:12:43,910 --> 00:12:46,660 So the [INAUDIBLE] is, as you're going to see, 244 00:12:46,660 --> 00:12:51,330 is going to benefit a lot from using an implicit scheme 245 00:12:51,330 --> 00:12:53,930 instead of explicit scheme. 246 00:12:53,930 --> 00:12:56,820 And when you have a nonlinear equation 247 00:12:56,820 --> 00:13:01,480 and you want to use an explicit scheme, as you dismay discover 248 00:13:01,480 --> 00:13:06,650 when you are doing the homework question, at every time stamp 249 00:13:06,650 --> 00:13:10,015 you need to solve a nonlinear equation, a nonlinear algebraic 250 00:13:10,015 --> 00:13:11,320 equation. 251 00:13:11,320 --> 00:13:13,260 In the homework, the equation happens 252 00:13:13,260 --> 00:13:14,810 to be a quadratic equation, and you 253 00:13:14,810 --> 00:13:16,730 can solve it using [INAUDIBLE]. 254 00:13:16,730 --> 00:13:19,610 But in general, that nonlinear equation 255 00:13:19,610 --> 00:13:23,410 you have solved every single time stamp 256 00:13:23,410 --> 00:13:25,570 is not going to happen to be an equation 257 00:13:25,570 --> 00:13:27,680 with an analytical solution. 258 00:13:27,680 --> 00:13:33,420 And a Newton-Raphson is a method people have invented centuries 259 00:13:33,420 --> 00:13:39,010 ago to solve such nonlinear equations numerically. 260 00:13:39,010 --> 00:13:43,790 All right, any questions before we dive into stiffness 261 00:13:43,790 --> 00:13:47,340 and using Raphson? 262 00:13:47,340 --> 00:13:48,148 All right. 263 00:13:48,148 --> 00:13:50,640 Stiffness. 264 00:13:50,640 --> 00:13:53,306 The first [INAUDIBLE] when we illustrated stiffness 265 00:13:53,306 --> 00:13:55,050 is this guy. 266 00:13:55,050 --> 00:14:00,440 So we did in the first lecture, [INAUDIBLE]. 267 00:14:00,440 --> 00:14:01,350 Right? 268 00:14:01,350 --> 00:14:05,890 And this is a very, very similar set up. 269 00:14:05,890 --> 00:14:09,600 And to remind you, we have the same [INAUDIBLE] over here. 270 00:14:09,600 --> 00:14:12,120 But instead of an aluminum cube, we 271 00:14:12,120 --> 00:14:18,900 have two metal plates sticked together like [INAUDIBLE]. 272 00:14:18,900 --> 00:14:22,860 So this blue [INAUDIBLE] is very [INAUDIBLE]. 273 00:14:22,860 --> 00:14:26,760 And one is copper, the other is aluminum. 274 00:14:26,760 --> 00:14:30,180 They are 2 inch by 2 inch big. 275 00:14:30,180 --> 00:14:38,810 And each only is a [INAUDIBLE], so one aluminum, one copper. 276 00:14:38,810 --> 00:14:43,417 And I'm going to heat only this aluminum with a heat lamp. 277 00:14:43,417 --> 00:14:45,000 So I'm going to turn on the heat lamp. 278 00:14:45,000 --> 00:14:46,541 And there are two thermal [INAUDIBLE] 279 00:14:46,541 --> 00:14:48,240 that matches the [INAUDIBLE]. 280 00:14:52,210 --> 00:14:58,790 What differential equation would you use to model this problem? 281 00:14:58,790 --> 00:15:01,000 When I'm heating only the aluminum, 282 00:15:01,000 --> 00:15:05,005 how would the [INAUDIBLE] of this and this going to behave? 283 00:15:05,005 --> 00:15:06,770 How would that be [INAUDIBLE]? 284 00:15:09,700 --> 00:15:14,114 You can discuss in pairs or in groups of three. 285 00:15:14,114 --> 00:15:16,700 And we'll see really answer the question 286 00:15:16,700 --> 00:15:24,690 of if we want to predict it, is it a stiff problem? 287 00:15:24,690 --> 00:15:25,960 If so, why? 288 00:15:25,960 --> 00:15:28,850 If not, why not? 289 00:15:28,850 --> 00:15:31,108 You can use a computer to look up any concepts 290 00:15:31,108 --> 00:15:33,438 or anything like that. 291 00:15:33,438 --> 00:15:38,210 You can see the two colors, one is bronze-- sorry, sorry, 292 00:15:38,210 --> 00:15:39,410 one is copper. 293 00:15:39,410 --> 00:15:40,930 One is a copper temperature. 294 00:15:40,930 --> 00:15:43,500 One is a aluminum temperature. 295 00:15:43,500 --> 00:15:49,850 So we have some very good conclusions here. 296 00:15:49,850 --> 00:15:53,370 Why don't you just help us understand [INAUDIBLE]? 297 00:16:01,450 --> 00:16:04,060 AUDIENCE: So this is a stuff problem, 298 00:16:04,060 --> 00:16:06,960 because there are two different things that are happening. 299 00:16:06,960 --> 00:16:10,450 We have the convection, which we [INAUDIBLE] 300 00:16:10,450 --> 00:16:12,220 the heat [INAUDIBLE] and the metal 301 00:16:12,220 --> 00:16:13,940 and then the metal in the air, and then 302 00:16:13,940 --> 00:16:17,020 the conduction between the two metals. 303 00:16:17,020 --> 00:16:18,830 The metals are both very conductive. 304 00:16:18,830 --> 00:16:20,830 So that process happens much faster 305 00:16:20,830 --> 00:16:25,235 than the rate of convection. 306 00:16:25,235 --> 00:16:26,110 PROFESSOR: All right. 307 00:16:26,110 --> 00:16:26,985 Does that make sense? 308 00:16:31,900 --> 00:16:34,870 All right, thank you. 309 00:16:34,870 --> 00:16:37,630 So we have to physical phenomenon, convection 310 00:16:37,630 --> 00:16:40,620 and conduction. 311 00:16:40,620 --> 00:16:44,490 And if you'd think carefully, the two metals 312 00:16:44,490 --> 00:16:48,770 I exposed over here, within like the common metals, 313 00:16:48,770 --> 00:16:52,080 are the most heat conductive ones 314 00:16:52,080 --> 00:16:55,033 that you can reasonably [INAUDIBLE], aluminum 315 00:16:55,033 --> 00:16:57,250 and copper. 316 00:16:57,250 --> 00:17:05,200 So I deliberately made the rate of conduction to be very fast. 317 00:17:05,200 --> 00:17:08,270 I deliberately made the conduction to be very fast. 318 00:17:08,270 --> 00:17:11,802 And I also made them very thick. 319 00:17:11,802 --> 00:17:19,102 So if you look at-- let me start writing some equations. 320 00:17:22,880 --> 00:17:23,650 OK. 321 00:17:23,650 --> 00:17:30,400 So if you look at the conduction, rate of conduction, 322 00:17:30,400 --> 00:17:33,870 the rate of conduction, heat conduction, is equal to what? 323 00:17:33,870 --> 00:17:35,050 Can somebody tell me? 324 00:17:39,680 --> 00:17:42,380 There is definitely a k somewhere, 325 00:17:42,380 --> 00:17:51,870 the conductivity times the area times delta t over delta-- 326 00:17:51,870 --> 00:17:52,790 in this [INAUDIBLE]. 327 00:17:52,790 --> 00:17:58,310 Let's say the direction across the plates are x. 328 00:17:58,310 --> 00:18:00,374 So it is delta t over delta x. 329 00:18:03,580 --> 00:18:04,490 OK. 330 00:18:04,490 --> 00:18:15,730 And changing the Q-dot is also equal to-- actually, 331 00:18:15,730 --> 00:18:17,050 I shouldn't say this. 332 00:18:17,050 --> 00:18:24,910 I should say the mass of each plate 333 00:18:24,910 --> 00:18:37,666 times the thermal capacitance, mc, times the partial T, 334 00:18:37,666 --> 00:18:41,840 partial T. So this is the rate of temperature change 335 00:18:41,840 --> 00:18:48,430 is also equal to Q-dot convection minus this 336 00:18:48,430 --> 00:18:52,830 is the conduction, Q conduction. 337 00:18:52,830 --> 00:18:55,620 So this is for the aluminum plate. 338 00:18:58,270 --> 00:19:01,200 And if you just look at if, let's say, 339 00:19:01,200 --> 00:19:04,400 we isolate these two phenomenons if we only 340 00:19:04,400 --> 00:19:07,040 look at the conduction, what we get 341 00:19:07,040 --> 00:19:13,030 is partial T partial T equal to kA divided 342 00:19:13,030 --> 00:19:17,330 by mc delta T over delta x. 343 00:19:17,330 --> 00:19:25,820 So remember our eigenvalue analysis? 344 00:19:25,820 --> 00:19:30,260 This part would become our eigenvalue. 345 00:19:30,260 --> 00:19:33,400 If we already have the conduction process, 346 00:19:33,400 --> 00:19:35,167 then this would be our lambda. 347 00:19:37,631 --> 00:19:38,130 OK. 348 00:19:38,130 --> 00:19:40,550 I think I get a minus sign here. 349 00:19:40,550 --> 00:19:42,000 So this will be our lambda. 350 00:19:42,000 --> 00:19:44,240 So we have a large k. 351 00:19:44,240 --> 00:19:48,648 OK We have our large A. But have a large [INAUDIBLE] compared 352 00:19:48,648 --> 00:19:51,540 to-- we have a large A compared to our delta x, two 353 00:19:51,540 --> 00:19:52,040 [INAUDIBLE]. 354 00:19:54,630 --> 00:19:58,680 So we have deliberately made these to be large. 355 00:19:58,680 --> 00:20:01,170 And if you plug in the numbers, this 356 00:20:01,170 --> 00:20:06,670 is significantly larger, about one to two orders of magnitude 357 00:20:06,670 --> 00:20:10,660 larger than the forced convection rate 358 00:20:10,660 --> 00:20:14,030 [INAUDIBLE] table. 359 00:20:14,030 --> 00:20:18,810 So this is a stiff process in terms of physics, 360 00:20:18,810 --> 00:20:20,960 because we have a very fast speed 361 00:20:20,960 --> 00:20:23,698 conduction and a relatively slow speed convection. 362 00:20:26,510 --> 00:20:32,630 In terms of mathematics, let me say this is the aluminum. 363 00:20:32,630 --> 00:20:38,858 This is delta squared delta T is equal to the T aluminum minus T 364 00:20:38,858 --> 00:20:39,358 copper. 365 00:20:41,970 --> 00:20:47,750 So we have m aluminum c of aluminum equal to this. 366 00:20:47,750 --> 00:20:52,030 And we have aluminum equal to, let me say-- 367 00:20:52,030 --> 00:20:57,270 and let's set this k to be the average rate of conductivity 368 00:20:57,270 --> 00:20:59,100 in the aluminum and the copper. 369 00:20:59,100 --> 00:21:08,731 So we replaced our delta T by TA minus Tc. 370 00:21:08,731 --> 00:21:09,230 All right. 371 00:21:09,230 --> 00:21:11,450 So this is conduction. 372 00:21:11,450 --> 00:21:13,470 And we also have convection. 373 00:21:15,931 --> 00:21:17,930 And the rate of convection, can somebody tell me 374 00:21:17,930 --> 00:21:19,330 what the rate of convection is? 375 00:21:24,490 --> 00:21:28,050 We have the convection coefficient 376 00:21:28,050 --> 00:21:38,070 times A, area-- sorry-- times the difference between the T 377 00:21:38,070 --> 00:21:38,660 error. 378 00:21:38,660 --> 00:21:44,040 So let me just say to [INAUDIBLE] T error minus T 379 00:21:44,040 --> 00:21:51,780 aluminum and divided by aluminum mass and the heat capacitance. 380 00:21:51,780 --> 00:21:55,430 And our copper is going to satisfy 381 00:21:55,430 --> 00:22:00,900 a similar equation, where the heat conduction is the same. 382 00:22:00,900 --> 00:22:05,710 So what this is c instead. 383 00:22:05,710 --> 00:22:10,310 And we have TA minus TC here divided by delta x. 384 00:22:10,310 --> 00:22:13,130 And here we have a removal of heat. 385 00:22:15,830 --> 00:22:17,420 So this is hot air. 386 00:22:17,420 --> 00:22:20,110 And we have a removal of heat. 387 00:22:20,110 --> 00:22:25,770 Cold air divided by Mc Cc. 388 00:22:25,770 --> 00:22:26,600 OK. 389 00:22:26,600 --> 00:22:30,096 So as you're going to see, we are going to get a 2 390 00:22:30,096 --> 00:22:30,867 by 2 matrix. 391 00:22:34,000 --> 00:22:36,080 We are going to get a 2 by 2 matrix. 392 00:22:36,080 --> 00:22:43,830 And the 2 by 2 matrix is going to have the 2 by 2 matrix. 393 00:22:43,830 --> 00:22:48,110 We write down the T of the aluminum temperature 394 00:22:48,110 --> 00:22:52,060 and copper temperature is going to be equal to if you 395 00:22:52,060 --> 00:22:53,690 regroup the terms. 396 00:22:53,690 --> 00:23:00,650 And we know that this term is going to be large. 397 00:23:00,650 --> 00:23:06,770 So let me call this big A. And these terms 398 00:23:06,770 --> 00:23:09,970 are going to be small. 399 00:23:09,970 --> 00:23:13,370 Let me color these small terms by blue. 400 00:23:13,370 --> 00:23:13,870 OK. 401 00:23:13,870 --> 00:23:16,800 So this term is going to be small. 402 00:23:16,800 --> 00:23:19,310 This term is going to be small. 403 00:23:19,310 --> 00:23:22,840 And let me color the last terms in red. 404 00:23:22,840 --> 00:23:25,052 So this term is going to be large. 405 00:23:27,700 --> 00:23:31,840 So let me just write qualitatively here. 406 00:23:31,840 --> 00:23:35,960 We have a minus large term over here 407 00:23:35,960 --> 00:23:45,100 and a minus small term minus a small term in blue. 408 00:23:45,100 --> 00:23:50,810 So this is a multiplied by Ta and the Tc. 409 00:23:53,790 --> 00:23:56,760 So on top of Ta, we have a negative large term 410 00:23:56,760 --> 00:23:59,300 and negative small term. 411 00:23:59,300 --> 00:24:06,280 On top of Tc here, we have a plus large term. 412 00:24:06,280 --> 00:24:08,860 And in the second equation, the evolution of the copper 413 00:24:08,860 --> 00:24:14,750 temperature, we have a large term in front of here 414 00:24:14,750 --> 00:24:19,760 and nothing in the small term. 415 00:24:19,760 --> 00:24:21,880 And in terms of the copper temperature, 416 00:24:21,880 --> 00:24:26,165 we have a minus large term and a minus small term. 417 00:24:30,320 --> 00:24:35,580 So the matrix looks like this. 418 00:24:35,580 --> 00:24:41,350 That's how the matrix would look like when 419 00:24:41,350 --> 00:24:44,030 you write these two equations in terms of matrix form. 420 00:24:48,150 --> 00:24:52,470 Now, if you do the eigenvalue analysis of a matrix that 421 00:24:52,470 --> 00:24:59,290 looks like this, you can take the-- 422 00:24:59,290 --> 00:25:02,990 what happens to the eigenvalue if S infinitesimally 423 00:25:02,990 --> 00:25:04,367 small compared to L? 424 00:25:07,580 --> 00:25:12,810 Let's say what is the eigenvalue of minus L, minus L, L and L? 425 00:25:21,594 --> 00:25:24,396 AUDIENCE: [INAUDIBLE] 426 00:25:24,396 --> 00:25:25,020 PROFESSOR: Yes. 427 00:25:25,020 --> 00:25:27,654 Or it is L, because eigenvalues are linear. 428 00:25:27,654 --> 00:25:32,213 It's an L times the eigenvalue of this matrix. 429 00:25:32,213 --> 00:25:34,474 And what is the eigenvalue of that matrix? 430 00:25:34,474 --> 00:25:35,277 We can try to-- 431 00:25:35,277 --> 00:25:37,318 AUDIENCE: Well, at least one of them [INAUDIBLE]. 432 00:25:42,787 --> 00:25:43,370 PROFESSOR: OK. 433 00:25:43,370 --> 00:25:44,550 At least one of them are 0. 434 00:25:44,550 --> 00:25:46,530 Because this matrix is [INAUDIBLE], right? 435 00:25:46,530 --> 00:25:50,429 The first line is negative of the second line. 436 00:25:50,429 --> 00:25:51,470 What about the other one? 437 00:25:51,470 --> 00:25:52,740 AUDIENCE: 0 minus 2. 438 00:25:52,740 --> 00:25:54,405 PROFESSOR: 0 minus 2 exactly. 439 00:25:57,380 --> 00:25:59,300 Wait, is it minus 2? 440 00:25:59,300 --> 00:26:00,580 Yes, it is minus 2. 441 00:26:00,580 --> 00:26:01,110 OK. 442 00:26:01,110 --> 00:26:05,480 So it is 0 or minus 2, right? 443 00:26:05,480 --> 00:26:06,560 Minus 2L. 444 00:26:06,560 --> 00:26:10,350 So you can see the eigenvalues, one of them is 0. 445 00:26:10,350 --> 00:26:12,600 The other is minus 2. 446 00:26:12,600 --> 00:26:18,510 And if you add these small terms the eigenvalue-- 447 00:26:18,510 --> 00:26:24,930 because the small items are just minus S on the diagonal, right? 448 00:26:24,930 --> 00:26:27,110 So how do they affect the eigenvalues? 449 00:26:27,110 --> 00:26:30,554 It's a test to your linear algebra. 450 00:26:30,554 --> 00:26:32,960 AUDIENCE: [INAUDIBLE] 451 00:26:32,960 --> 00:26:34,920 PROFESSOR: It is going to be put a minus S 452 00:26:34,920 --> 00:26:36,102 on both of the eigenvalues. 453 00:26:39,430 --> 00:26:41,860 It is the eigenvalue of an identity matrix 454 00:26:41,860 --> 00:26:45,950 times S times minus S. The eigenvalues of identity matrix 455 00:26:45,950 --> 00:26:55,970 is 1, right? 456 00:26:55,970 --> 00:26:58,610 So let me see-- [INAUDIBLE]. 457 00:27:04,360 --> 00:27:05,180 I'm not sure. 458 00:27:05,180 --> 00:27:06,060 Let me take it back. 459 00:27:06,060 --> 00:27:11,440 I'm not sure exactly what the eigenvalues are. 460 00:27:11,440 --> 00:27:12,250 OK. 461 00:27:12,250 --> 00:27:14,550 So when I'm adding a [INAUDIBLE] matrix, 462 00:27:14,550 --> 00:27:19,500 I'm basically perturbing this by minus S. 463 00:27:19,500 --> 00:27:22,200 So this is going to be my eigenvalues. 464 00:27:22,200 --> 00:27:24,260 And because I have a small eigenvalue, 465 00:27:24,260 --> 00:27:27,572 I have a large eigenvalue, I would get a [INAUDIBLE]. 466 00:27:30,770 --> 00:27:34,560 So basically, we are looking at the example of a [INAUDIBLE] 467 00:27:34,560 --> 00:27:35,480 problem. 468 00:27:35,480 --> 00:27:38,580 We can analyze from the perspective of physics. 469 00:27:38,580 --> 00:27:42,060 We have a fast conduction of slow convection. 470 00:27:42,060 --> 00:27:44,750 And if we put these physically into equations 471 00:27:44,750 --> 00:27:51,120 and analyze the eigenvalues, we can get a slow eigenvalue 472 00:27:51,120 --> 00:27:53,560 and a fast eigenvalue. 473 00:27:56,380 --> 00:27:59,020 The orders of magnitude difference in eigenvalues 474 00:27:59,020 --> 00:28:04,864 is also going to indicate the system is going to be stiff. 475 00:28:04,864 --> 00:28:05,740 Questions on this? 476 00:28:05,740 --> 00:28:09,840 Maybe you don't quite get through the mathematics, 477 00:28:09,840 --> 00:28:14,810 but it is going to be leading to the same conclusion. 478 00:28:17,810 --> 00:28:21,449 AUDIENCE: Does the name derive from [INAUDIBLE]? 479 00:28:21,449 --> 00:28:22,490 PROFESSOR: Good question. 480 00:28:22,490 --> 00:28:27,610 Does the name derive from stiff springs? 481 00:28:27,610 --> 00:28:31,060 So let me actually give you-- the answer is yes. 482 00:28:31,060 --> 00:28:33,710 The name does derive from stiff springs. 483 00:28:33,710 --> 00:28:36,500 And it's actually going to be a homework question. 484 00:28:36,500 --> 00:28:43,200 But like I can kind of hint you a little bit right now. 485 00:28:43,200 --> 00:28:45,150 So what if you have a system like this? 486 00:28:50,520 --> 00:28:52,060 What if you have a system like this? 487 00:28:52,060 --> 00:28:57,820 Instead of a thermal problem, let's think of a pendulum. 488 00:28:57,820 --> 00:29:02,190 So a pendulum is we have a mass over here, right? 489 00:29:02,190 --> 00:29:09,640 And a regular pendulum would have an inelastic string 490 00:29:09,640 --> 00:29:11,650 attached to the mass. 491 00:29:11,650 --> 00:29:17,320 But what if you think of you have a spring here, 492 00:29:17,320 --> 00:29:20,580 so that the distance between the hinge and the mass 493 00:29:20,580 --> 00:29:22,870 can actually become longer or shorter. 494 00:29:27,420 --> 00:29:31,260 So if you have a system like this, in what condition-- so 495 00:29:31,260 --> 00:29:35,500 let's say the stiffness of the spring is K. 496 00:29:35,500 --> 00:29:41,220 Would you have a stiff system in terms of ODEs? 497 00:29:41,220 --> 00:29:43,180 Or you have a non-stiff system? 498 00:29:43,180 --> 00:29:45,180 In what condition would you have a stiff system? 499 00:29:45,180 --> 00:29:48,420 In what condition would you have a non-stiff system. 500 00:29:48,420 --> 00:29:50,782 AUDIENCE: [INAUDIBLE] stiffness [INAUDIBLE]. 501 00:29:50,782 --> 00:29:52,990 PROFESSOR: It depends on the stiffness of the spring, 502 00:29:52,990 --> 00:29:53,490 exactly. 503 00:29:53,490 --> 00:29:55,960 We have two physical processes over here. 504 00:29:55,960 --> 00:30:00,130 One is the motion of the pendulum driven by gravity. 505 00:30:00,130 --> 00:30:04,110 The other is the oscillation of the spring. 506 00:30:04,110 --> 00:30:07,660 If the spring is very stiff, then 507 00:30:07,660 --> 00:30:13,680 the frequency of the oscillation is going to be very high, 508 00:30:13,680 --> 00:30:16,920 which means the timescale of the oscillation 509 00:30:16,920 --> 00:30:20,890 is going to be much faster than the motion of the pendulum 510 00:30:20,890 --> 00:30:23,230 due to gravity. 511 00:30:23,230 --> 00:30:26,360 And then we get two very different timescales. 512 00:30:26,360 --> 00:30:28,044 Therefore, we get a stiff system. 513 00:30:32,490 --> 00:30:36,910 So that is an example of, like, how does the name stiff really 514 00:30:36,910 --> 00:30:41,780 comes into the picture of all this if you have, let's say, 515 00:30:41,780 --> 00:30:44,900 a large structure where you are interested in the motion 516 00:30:44,900 --> 00:30:46,390 of the whole. 517 00:30:46,390 --> 00:30:51,050 But inside the structure, there are some very stiff components, 518 00:30:51,050 --> 00:30:53,990 I mean, really stiff in terms of physically stiff components. 519 00:30:57,400 --> 00:31:01,620 When you derive the whole ODE, you discover two timescales. 520 00:31:01,620 --> 00:31:04,360 One is the timescale you're interested in. 521 00:31:04,360 --> 00:31:08,380 But there is a much shorter timescale, much higher 522 00:31:08,380 --> 00:31:11,510 frequency timescale due to the stiff component 523 00:31:11,510 --> 00:31:13,770 inside the system. 524 00:31:13,770 --> 00:31:17,000 And therefore, you get a very difficult problem to solve. 525 00:31:17,000 --> 00:31:19,150 And [INAUDIBLE] this problem. 526 00:31:22,270 --> 00:31:25,570 Does that make sense? 527 00:31:25,570 --> 00:31:26,336 Yeah 528 00:31:26,336 --> 00:31:27,211 AUDIENCE: [INAUDIBLE] 529 00:31:31,664 --> 00:31:32,330 PROFESSOR: Yeah. 530 00:31:32,330 --> 00:31:35,780 I guess my interpretation is that it's stiff, 531 00:31:35,780 --> 00:31:38,770 because of the stiffness of the spring. 532 00:31:38,770 --> 00:31:42,020 I mean, yeah, it's hard to solve. 533 00:31:42,020 --> 00:31:44,463 But it's because of the stiffness of the system 534 00:31:44,463 --> 00:31:48,327 it is hard to solve. 535 00:31:48,327 --> 00:31:51,960 It's like hard to solve is a result of it being stiff. 536 00:31:58,730 --> 00:32:00,438 Any other questions? 537 00:32:00,438 --> 00:32:02,214 AUDIENCE: [INAUDIBLE] 538 00:32:02,214 --> 00:32:03,313 PROFESSOR: You got it? 539 00:32:03,313 --> 00:32:04,000 AUDIENCE: Yup. 540 00:32:04,000 --> 00:32:05,580 PROFESSOR: OK. 541 00:32:05,580 --> 00:32:08,670 So before I give you another example 542 00:32:08,670 --> 00:32:12,430 of this system, let's talk about how to solve it. 543 00:32:12,430 --> 00:32:13,830 OK. 544 00:32:13,830 --> 00:32:18,370 As you read in your reading, in order to solve a stiff system, 545 00:32:18,370 --> 00:32:22,460 you really need implicit methods. 546 00:32:22,460 --> 00:32:24,250 Why is that the case? 547 00:32:24,250 --> 00:32:28,760 Because in explicit method, it is only stable for a limited 548 00:32:28,760 --> 00:32:30,291 region of lambda delta t. 549 00:32:33,120 --> 00:32:40,820 And if there is some phenomenon in your system that 550 00:32:40,820 --> 00:32:45,040 is very fast, much, much faster than the phenomenons 551 00:32:45,040 --> 00:32:50,900 you want to resolve-- OK, for example, in this case, 552 00:32:50,900 --> 00:32:54,205 we may want to resolve the scale of how 553 00:32:54,205 --> 00:32:57,340 the temperature rise and how the temperature [INAUDIBLE]. 554 00:32:57,340 --> 00:32:59,890 That is the scale of the convection. 555 00:32:59,890 --> 00:33:01,990 But in order for you to solve it, 556 00:33:01,990 --> 00:33:05,080 you have to resolve-- one of your lambdas 557 00:33:05,080 --> 00:33:08,660 is the lambda corresponding to a much, much faster process. 558 00:33:08,660 --> 00:33:11,740 What does this mean in terms of the plot? 559 00:33:11,740 --> 00:33:15,110 It means that if you have the stability region like this-- 560 00:33:15,110 --> 00:33:17,420 so this is the peanut shape of the active [INAUDIBLE], 561 00:33:17,420 --> 00:33:22,080 that's one of the best explicit schemes out there. 562 00:33:22,080 --> 00:33:28,600 But if you have a lambda that is a thousand times the process, 563 00:33:28,600 --> 00:33:32,370 the frequency of the process you are interested in, 564 00:33:32,370 --> 00:33:35,540 that means you have to have a delta t that 565 00:33:35,540 --> 00:33:41,080 is a thousand times smaller than you would want to use. 566 00:33:41,080 --> 00:33:43,740 Because if you want to really resolve the process 567 00:33:43,740 --> 00:33:46,760 you want to resolve very well, you kind of only 568 00:33:46,760 --> 00:33:51,270 need a lambda times the smaller lambda times delta t 569 00:33:51,270 --> 00:33:53,480 to be in a reasonable range. 570 00:33:53,480 --> 00:33:58,290 But that wouldn't be stable, because of the existence 571 00:33:58,290 --> 00:34:00,780 of a very large eigenvalue. 572 00:34:00,780 --> 00:34:04,250 So in order to make all the lambda delta t's 573 00:34:04,250 --> 00:34:06,380 to be within the stability region-- and remember, 574 00:34:06,380 --> 00:34:09,490 you have to make all the lambda delta t's within the stability 575 00:34:09,490 --> 00:34:09,989 region. 576 00:34:09,989 --> 00:34:11,364 Otherwise, you're scheme is going 577 00:34:11,364 --> 00:34:14,170 to be not eigenvalue stable. 578 00:34:14,170 --> 00:34:15,670 So in order for you to do that, you 579 00:34:15,670 --> 00:34:19,004 would have to have a delta t that is some times 580 00:34:19,004 --> 00:34:22,490 ridiculously small. 581 00:34:22,490 --> 00:34:22,989 OK. 582 00:34:22,989 --> 00:34:25,929 So that is explicit. 583 00:34:25,929 --> 00:34:31,820 And for explicit schemes, all of the schemes only 584 00:34:31,820 --> 00:34:35,760 have a limited stability region. 585 00:34:35,760 --> 00:34:38,000 But if you have an implicit scheme, 586 00:34:38,000 --> 00:34:40,100 the story's much different. 587 00:34:40,100 --> 00:34:42,900 You typically have a stability region that looks like this. 588 00:34:42,900 --> 00:34:48,719 It is stable for an infinitely large region. 589 00:34:48,719 --> 00:34:50,520 OK. 590 00:34:50,520 --> 00:34:53,080 You can easily make this scheme to be 591 00:34:53,080 --> 00:34:55,989 a stable for an infinitely region, 592 00:34:55,989 --> 00:35:01,280 so that even if some of the lambda are very large, 593 00:35:01,280 --> 00:35:03,300 you can still have a stable scheme. 594 00:35:03,300 --> 00:35:07,470 You can still use a delta t as large as the timescale 595 00:35:07,470 --> 00:35:10,320 you are interested in. 596 00:35:10,320 --> 00:35:11,540 Does it make sense? 597 00:35:14,970 --> 00:35:20,160 Now, implicit method has a lot of benefits. 598 00:35:20,160 --> 00:35:22,800 But it also have some disadvantage, especially 599 00:35:22,800 --> 00:35:25,180 for [INAUDIBLE] your system. 600 00:35:25,180 --> 00:35:28,390 As you saw, [INAUDIBLE] system each step 601 00:35:28,390 --> 00:35:30,840 involves solving a nonlinear equation. 602 00:35:30,840 --> 00:35:34,460 So for example, I'm using the most simple scheme backward 603 00:35:34,460 --> 00:35:34,960 [INAUDIBLE]. 604 00:35:39,280 --> 00:35:42,520 In backward [INAUDIBLE], the difference 605 00:35:42,520 --> 00:35:46,120 between V n plus 1 Vn minus over delta t 606 00:35:46,120 --> 00:35:50,030 is equal to the right-hand side of V n plus 1 instead Vn. 607 00:35:50,030 --> 00:35:51,860 If it's Vn, then it's forward [INAUDIBLE]. 608 00:35:51,860 --> 00:35:54,750 But if it's Vn plus 1, it's backward [INAUDIBLE]. 609 00:35:54,750 --> 00:35:57,830 It looks like a very innocent difference. 610 00:35:57,830 --> 00:36:02,220 But if f is nonlinear, this is hell a lot different. 611 00:36:02,220 --> 00:36:08,320 Because the unknowns are also within here. 612 00:36:08,320 --> 00:36:09,846 So this is unknown. 613 00:36:09,846 --> 00:36:11,780 V n plus 1 is unknown. 614 00:36:11,780 --> 00:36:13,470 Only Vn is known. 615 00:36:13,470 --> 00:36:16,920 If this is Vn, I can evaluate f of Vn. 616 00:36:16,920 --> 00:36:21,580 But if this is V n plus 1, I don't know what V n plus 1 is. 617 00:36:21,580 --> 00:36:24,010 So I cannot evaluate this. 618 00:36:24,010 --> 00:36:29,230 I have to solve the whole thing as a nonlinear equation. 619 00:36:29,230 --> 00:36:31,990 OK. 620 00:36:31,990 --> 00:36:34,990 On the other the day, we said if f is a linear equation, 621 00:36:34,990 --> 00:36:39,710 if f is linear, we can express this in a matrix form 622 00:36:39,710 --> 00:36:42,820 and rearrange the equation and compute it 623 00:36:42,820 --> 00:36:44,650 by solving a linear equation. 624 00:36:44,650 --> 00:36:48,090 But if f is nonlinear, how do you do it? 625 00:36:51,190 --> 00:36:53,590 Of course the answer is Newton-Raphson. 626 00:36:53,590 --> 00:36:56,602 But to understand what Newton-Raphson does, 627 00:36:56,602 --> 00:36:59,480 I think it benefits first to review what 628 00:36:59,480 --> 00:37:00,917 we would do in the linear case. 629 00:37:04,120 --> 00:37:07,580 In linear case, f of V n plus 1 can 630 00:37:07,580 --> 00:37:13,066 be represented using a matrix times the n plus 1. 631 00:37:16,190 --> 00:37:16,860 OK. 632 00:37:16,860 --> 00:37:20,910 Then what we can do is the following. 633 00:37:20,910 --> 00:37:25,270 We can move all the known terms on the left-hand side, 634 00:37:25,270 --> 00:37:33,810 I over delta t minus A times V n plus 1 equals to the-- this is 635 00:37:33,810 --> 00:37:39,060 unknown equal to the knowns, which is Vn divided by delta t. 636 00:37:39,060 --> 00:37:43,145 So we are moving [INAUDIBLE] this is [INAUDIBLE] 637 00:37:43,145 --> 00:37:45,683 and moving this term, which is now here, 638 00:37:45,683 --> 00:37:48,450 onto the left-hand side. 639 00:37:48,450 --> 00:37:53,175 Once we arrive at a matrix form, we can use [INAUDIBLE] matrix 640 00:37:53,175 --> 00:37:56,870 and solve for the Vn plus 1 right? 641 00:38:00,800 --> 00:38:03,255 Now, let's dive into the nonlinear case. 642 00:38:06,980 --> 00:38:07,480 OK. 643 00:38:07,480 --> 00:38:10,030 We don't know how to solve the nonlinear equation. 644 00:38:10,030 --> 00:38:16,050 So why don't we approximate it using a linear equation? 645 00:38:16,050 --> 00:38:20,420 Why don't we approximate the nonlinear term f of V n plus 1. 646 00:38:20,420 --> 00:38:23,420 Try something linear. 647 00:38:23,420 --> 00:38:24,935 How do you do that? 648 00:38:24,935 --> 00:38:25,810 AUDIENCE: [INAUDIBLE] 649 00:38:28,750 --> 00:38:32,590 PROFESSOR: Small perturbation Taylor series. 650 00:38:32,590 --> 00:38:35,740 This is another use of Taylor series completely 651 00:38:35,740 --> 00:38:39,130 different from how we used it in discretizing 652 00:38:39,130 --> 00:38:42,130 ordinary differential equations. 653 00:38:42,130 --> 00:38:51,800 We linearize f of V n plus 1 at some kind of initial guess. 654 00:38:51,800 --> 00:38:56,050 So we first guess what V n plus 1 is. 655 00:38:56,050 --> 00:39:00,670 And usually, a good first initial guess is just Vn. 656 00:39:00,670 --> 00:39:04,760 Because if I know I'm taking small time steps, then 657 00:39:04,760 --> 00:39:08,315 I know the next time step I have a V n plus 1 658 00:39:08,315 --> 00:39:11,040 that is really similar to what Vn is. 659 00:39:11,040 --> 00:39:13,630 So I'm going to set f of Vn plus 1 660 00:39:13,630 --> 00:39:23,650 equal to Vn equal to f of Vn plus delta V 661 00:39:23,650 --> 00:39:28,650 where delta V is V n plus 1 minus Vn 662 00:39:28,650 --> 00:39:33,770 times the derivative of V. So instead of writing it 663 00:39:33,770 --> 00:39:38,940 like this, I'm going to write a matrix, partial f partial V 664 00:39:38,940 --> 00:39:46,730 at Vn times delta V. So I'm going to write it like this. 665 00:39:46,730 --> 00:39:49,622 Now, in this Taylor series expansion, 666 00:39:49,622 --> 00:39:51,560 I only can write a problem. 667 00:39:51,560 --> 00:39:54,020 Because I'm ignoring the [INAUDIBLE]. 668 00:39:54,020 --> 00:39:56,354 Now, in this Taylor series expansion, what is known? 669 00:39:56,354 --> 00:39:57,020 What is unknown? 670 00:40:02,040 --> 00:40:04,940 This is known, right? 671 00:40:04,940 --> 00:40:10,990 And the unknown-- well, the unknown is only this. 672 00:40:10,990 --> 00:40:12,774 The matrix is also known. 673 00:40:16,570 --> 00:40:19,840 So somehow we reduced the nonlinear equation 674 00:40:19,840 --> 00:40:21,090 into a linear question. 675 00:40:21,090 --> 00:40:28,590 Because all the terms that involves the unknown is linear, 676 00:40:28,590 --> 00:40:30,870 right? 677 00:40:30,870 --> 00:40:35,890 That's write this down and convince ourselves. 678 00:40:35,890 --> 00:40:38,883 Let's plug this into the original equation. 679 00:40:38,883 --> 00:40:39,758 AUDIENCE: [INAUDIBLE] 680 00:40:51,010 --> 00:40:52,756 PROFESSOR: Yes. 681 00:40:52,756 --> 00:40:54,650 AUDIENCE: [INAUDIBLE] 682 00:40:54,650 --> 00:40:57,110 PROFESSOR: So half of [INAUDIBLE] is unknown. 683 00:40:57,110 --> 00:40:59,940 But once we [INAUDIBLE] like this, 684 00:40:59,940 --> 00:41:04,190 we found the only unknown in terms of a linear term 685 00:41:04,190 --> 00:41:05,126 is [INAUDIBLE]. 686 00:41:10,330 --> 00:41:12,150 So let's do this. 687 00:41:12,150 --> 00:41:13,920 Let's plug into the scheme. 688 00:41:13,920 --> 00:41:21,360 What we found is that so Vn plus 1 minus Vn is my delta v, 689 00:41:21,360 --> 00:41:21,860 right? 690 00:41:21,860 --> 00:41:24,696 My delta V is unknown. 691 00:41:24,696 --> 00:41:32,510 Delta V divide by delta t is equal to this. 692 00:41:32,510 --> 00:41:36,270 So the first term is known. 693 00:41:36,270 --> 00:41:38,690 And the Jacobi is known. 694 00:41:38,690 --> 00:41:42,370 The Jacobi is the derivative of f to V. 695 00:41:42,370 --> 00:41:47,820 And my delta V is over here. 696 00:41:47,820 --> 00:41:48,320 OK. 697 00:41:48,320 --> 00:41:51,620 Now, I can solve this equation using 698 00:41:51,620 --> 00:41:57,500 exactly the same way which I solved the linear equation. 699 00:41:57,500 --> 00:42:02,870 I can say I, which is identity over delta t minus my Jacobi, 700 00:42:02,870 --> 00:42:13,794 partial f partial V at Vn times my delta V is equal to f of Vn. 701 00:42:16,660 --> 00:42:17,160 OK. 702 00:42:17,160 --> 00:42:21,020 Now, I can solve for the delta V. 703 00:42:21,020 --> 00:42:26,230 And I'm going to say my f Vn plus 1 [INAUDIBLE], 704 00:42:26,230 --> 00:42:33,730 which is my guess, is equal to Vn plus this quantity I just 705 00:42:33,730 --> 00:42:38,370 solved for, delta V. 706 00:42:38,370 --> 00:42:41,370 This Vn plus 1 [INAUDIBLE] hopefully 707 00:42:41,370 --> 00:42:45,580 is a better approximation to V n plus 1 than my initial guess 708 00:42:45,580 --> 00:42:46,080 Vn. 709 00:42:48,910 --> 00:42:50,630 But how can I be sure? 710 00:42:50,630 --> 00:42:52,570 How can I be certain it is actually better? 711 00:42:57,850 --> 00:42:59,770 AUDIENCE: [INAUDIBLE] 712 00:42:59,770 --> 00:43:01,933 PROFESSOR: I calculate the residual, exactly. 713 00:43:06,750 --> 00:43:09,090 Now, I have this quantity. 714 00:43:09,090 --> 00:43:15,060 I can plug this quantity into the equation. 715 00:43:15,060 --> 00:43:24,070 I'm going to say is it equal to f of V n plus 1 tilde. 716 00:43:24,070 --> 00:43:27,840 If this v tilde n plus 1, when I plug it in, 717 00:43:27,840 --> 00:43:31,860 is equal to the right-hand side, more approximately 718 00:43:31,860 --> 00:43:38,430 than if I plug in Vn as V n tilde plus 1. 719 00:43:38,430 --> 00:43:42,030 Then I know I have a better approximation. 720 00:43:42,030 --> 00:43:44,540 If this is almost exactly equal, then I 721 00:43:44,540 --> 00:43:46,926 know I already got a very good answer. 722 00:43:51,840 --> 00:43:56,710 What if I improved, but still didn't have an as accurate 723 00:43:56,710 --> 00:43:58,395 answer as I want? 724 00:43:58,395 --> 00:43:59,270 AUDIENCE: [INAUDIBLE] 725 00:44:04,625 --> 00:44:05,250 PROFESSOR: Yes. 726 00:44:05,250 --> 00:44:06,450 I keep iterating. 727 00:44:06,450 --> 00:44:09,650 Now, I'm going to define another delta n. 728 00:44:09,650 --> 00:44:17,630 So if not good enough, I'm going to say, OK, 729 00:44:17,630 --> 00:44:23,330 what I really want is equal to my guess plus my new delta V. 730 00:44:23,330 --> 00:44:29,310 This is a new delta V. And do this again. 731 00:44:29,310 --> 00:44:30,210 And do this again. 732 00:44:30,210 --> 00:44:31,331 How do I do this again? 733 00:44:34,100 --> 00:44:36,980 The unknown, which is f Vn plus 1, 734 00:44:36,980 --> 00:44:41,920 now is equal to f of v tilde n plus 1. 735 00:44:41,920 --> 00:44:45,360 Now, this is known, because I already computed the better 736 00:44:45,360 --> 00:44:47,250 approximation. 737 00:44:47,250 --> 00:44:52,210 Plus the derivative of f to V at this tilde V 738 00:44:52,210 --> 00:45:02,582 n plus 1 times my new delta V-- so this is iteration two. 739 00:45:06,440 --> 00:45:13,160 And previously, this is iteration number one. 740 00:45:13,160 --> 00:45:15,180 And here is my iteration number two. 741 00:45:15,180 --> 00:45:18,780 In iteration number two, I constructed a new Taylor series 742 00:45:18,780 --> 00:45:21,300 expansion, I constructed a new approximation 743 00:45:21,300 --> 00:45:24,395 based on my updated guess. 744 00:45:27,790 --> 00:45:30,140 And then the next thing is the same. 745 00:45:30,140 --> 00:45:35,220 I'm going to plug in this equation into the formula. 746 00:45:35,220 --> 00:45:48,080 And the formula is V n plus 1 minus Vn. 747 00:45:48,080 --> 00:45:51,480 Now, my V n plus 1 is equal to this, right? 748 00:45:51,480 --> 00:45:58,800 So I actually have a V tilde n plus 1 minus Vn 749 00:45:58,800 --> 00:46:02,700 plus my delta V divided by delta t 750 00:46:02,700 --> 00:46:06,560 is equal to-- oh, let me actually color the terms that 751 00:46:06,560 --> 00:46:07,800 is known and unknown. 752 00:46:07,800 --> 00:46:11,280 These are known equal to f of v tilde 753 00:46:11,280 --> 00:46:17,710 n plus 1 plus the same thing times the unknown delta 754 00:46:17,710 --> 00:46:20,100 V. Sorry, should be blue. 755 00:46:27,170 --> 00:46:30,580 And again, I'm going to move all the known terms 756 00:46:30,580 --> 00:46:33,620 into one side and the unknown terms to the other side. 757 00:46:38,290 --> 00:46:43,030 It's equal to f of V tilde n plus 1, which is known, 758 00:46:43,030 --> 00:46:48,600 minus delta t of [INAUDIBLE] minus Vn. 759 00:46:48,600 --> 00:46:52,500 I'm going to solve for that delta V again. 760 00:46:52,500 --> 00:46:54,940 Once I solve my delta V, I'm going 761 00:46:54,940 --> 00:47:01,797 to update my guess to be my first iteration guess 762 00:47:01,797 --> 00:47:04,680 plus the update again. 763 00:47:04,680 --> 00:47:08,130 And then here goes my iteration number three. 764 00:47:08,130 --> 00:47:12,820 I'm going to keep iterating until the residual drops 765 00:47:12,820 --> 00:47:16,300 to into a tolerance level that I think is small enough. 766 00:47:21,510 --> 00:47:24,380 So the Newton-Raphson iteration is really 767 00:47:24,380 --> 00:47:30,210 another way of using Taylor series analysis 768 00:47:30,210 --> 00:47:36,606 by using the fact that we are able to solve these increases 769 00:47:36,606 --> 00:47:38,000 scheme equations. 770 00:47:38,000 --> 00:47:41,710 So if we derive a algebraic equation using implicit scheme, 771 00:47:41,710 --> 00:47:45,200 we know how to solve that if it's a linear equation. 772 00:47:45,200 --> 00:47:47,830 We don't know how to solve that if it's a nonlinear equation. 773 00:47:47,830 --> 00:47:51,180 But we can approximate it using a linear equation 774 00:47:51,180 --> 00:47:53,790 and approximate it again and again. 775 00:47:53,790 --> 00:47:57,490 When I have a better estimate, then the Taylor series 776 00:47:57,490 --> 00:47:59,600 approximation is even better. 777 00:47:59,600 --> 00:48:02,835 And that should give me an even a better approximation 778 00:48:02,835 --> 00:48:06,076 at the next step. 779 00:48:06,076 --> 00:48:08,990 All right is it clear? 780 00:48:08,990 --> 00:48:11,480 I mean, one of the Newton-Raphson iterations 781 00:48:11,480 --> 00:48:17,566 is one of the most useful numerical techniques 782 00:48:17,566 --> 00:48:21,154 that really goes well beyond this subject. 783 00:48:26,260 --> 00:48:30,480 It really accomplishes what you can-- if you go to MATLAB, 784 00:48:30,480 --> 00:48:31,990 you can use fsolve. 785 00:48:31,990 --> 00:48:35,686 fsolve usually helps you solve nonlinear equations. 786 00:48:35,686 --> 00:48:39,304 But fsolve only works if you have a small amount 787 00:48:39,304 --> 00:48:40,595 of equations you want to solve. 788 00:48:43,260 --> 00:48:45,370 When we go to [INAUDIBLE] when we 789 00:48:45,370 --> 00:48:47,970 want to solve-- [INAUDIBLE] had [INAUDIBLE] you're 790 00:48:47,970 --> 00:48:51,200 going to find out maybe we have millions 791 00:48:51,200 --> 00:48:54,640 of equations we want to solve at the same time. 792 00:48:54,640 --> 00:48:58,980 And the fsolve it going to be helpful in the situation. 793 00:48:58,980 --> 00:49:03,034 And in these cases, you really need Newton-Raphson equations 794 00:49:03,034 --> 00:49:03,534 [INAUDIBLE]. 795 00:49:07,560 --> 00:49:09,616 Any other questions on Newton-Raphson. 796 00:49:13,504 --> 00:49:15,260 Do you guys know how to implement 797 00:49:15,260 --> 00:49:18,630 a Newton-Raphson equation? 798 00:49:18,630 --> 00:49:19,720 Sure? 799 00:49:19,720 --> 00:49:26,380 Because I just got some consensus right before class 800 00:49:26,380 --> 00:49:28,020 on some of the questions. 801 00:49:28,020 --> 00:49:34,250 When you try to solve-- let me say one word. 802 00:49:34,250 --> 00:49:36,090 When you try to solve this equation, 803 00:49:36,090 --> 00:49:40,970 you want to solve a matrix times delta v equal to a residual. 804 00:49:40,970 --> 00:49:44,620 So this is the residual, right? 805 00:49:44,620 --> 00:49:48,230 It is really important to construct 806 00:49:48,230 --> 00:49:51,760 the A in the right way. 807 00:49:51,760 --> 00:49:53,610 Because if you don't be careful, you 808 00:49:53,610 --> 00:49:58,630 will get A transposed instead of A. OK. 809 00:49:58,630 --> 00:50:02,880 And when you solve delta V equal to A inverse times R, 810 00:50:02,880 --> 00:50:04,980 it is really important that A inverse 811 00:50:04,980 --> 00:50:06,830 is on the left-hand side of R instead of 812 00:50:06,830 --> 00:50:08,680 on the right-hand side. 813 00:50:08,680 --> 00:50:12,680 Because in linear algebra, the order really matters. 814 00:50:12,680 --> 00:50:13,370 OK. 815 00:50:13,370 --> 00:50:21,338 And how the entries in a matrix A is placed is also important. 816 00:50:24,840 --> 00:50:27,720 Let me make a new page just to make my point. 817 00:50:27,720 --> 00:50:32,330 This I think can save a lot of headaches. 818 00:50:35,350 --> 00:50:43,310 If delta V is arranged at V1, V2, et cetera to Vn and R 819 00:50:43,310 --> 00:50:49,540 is arranged as R1 et cetera to Rn, 820 00:50:49,540 --> 00:50:57,590 and the A is arranged as the derivative of R1 to V1 et 821 00:50:57,590 --> 00:51:07,950 cetera to derivative of R1 to Vn and the derivative of Rn 822 00:51:07,950 --> 00:51:14,250 to V1 derivative of Rn to Vn. 823 00:51:14,250 --> 00:51:17,480 It is important you [INAUDIBLE] rather than 824 00:51:17,480 --> 00:51:20,270 the transport of the matrix. 825 00:51:20,270 --> 00:51:23,240 Because it's correct Taylor series expansion 826 00:51:23,240 --> 00:51:28,738 is this matrix times this vector. 827 00:51:28,738 --> 00:51:31,630 If you do the transpose of this matrix, 828 00:51:31,630 --> 00:51:34,330 then you would be modifying the derivative 829 00:51:34,330 --> 00:51:41,010 of Rn to [INAUDIBLE] Vn, which is going to be [INAUDIBLE]. 830 00:51:46,260 --> 00:51:55,818 And then you do delta V equal to A inverse times R. So just want 831 00:51:55,818 --> 00:51:59,770 to make sure you have the right denominator 832 00:51:59,770 --> 00:52:05,300 and the [INAUDIBLE] inside the matrix. 833 00:52:05,300 --> 00:52:08,780 Is this clear? 834 00:52:08,780 --> 00:52:15,450 When you do this in MATLAB, it's A backslash R. That gives you 835 00:52:15,450 --> 00:52:25,690 A inverse times R. Questions? 836 00:52:25,690 --> 00:52:26,190 No? 837 00:52:29,020 --> 00:52:31,330 OK. 838 00:52:31,330 --> 00:52:36,160 So the rest of the 20 minutes, I want to have some fun. 839 00:52:36,160 --> 00:52:40,960 So I want to kind of have you try 840 00:52:40,960 --> 00:52:45,950 in your own computer a real example of a stiff system. 841 00:52:45,950 --> 00:52:49,730 And I have a joystick over here, so you can use. 842 00:52:49,730 --> 00:52:56,500 And if some of you have Simulink installed on your computer, 843 00:52:56,500 --> 00:52:58,760 feel free to grab your computer, come to here, 844 00:52:58,760 --> 00:53:03,800 and see what is your own implementation of the system. 845 00:53:03,800 --> 00:53:05,270 So this is system is like this. 846 00:53:05,270 --> 00:53:08,240 So let' build a MATLAB flight simulator. 847 00:53:08,240 --> 00:53:13,290 OK. [INAUDIBLE] build a flight simulation in MATLAB. 848 00:53:13,290 --> 00:53:17,280 In class, I won't be able to simulate the whole airplane. 849 00:53:17,280 --> 00:53:20,280 I'm only to be able to simulate the pitch 850 00:53:20,280 --> 00:53:25,790 motions, the longitudinal motion of the airplane, so no turning. 851 00:53:25,790 --> 00:53:27,270 All right. 852 00:53:27,270 --> 00:53:28,020 So OK. 853 00:53:28,020 --> 00:53:30,780 So assume the [INAUDIBLE] coefficient 854 00:53:30,780 --> 00:53:33,960 is equal to 2 pi times alpha. 855 00:53:33,960 --> 00:53:36,215 So we're assuming we have [INAUDIBLE] 856 00:53:36,215 --> 00:53:41,510 air foil-- if you do think [INAUDIBLE] theory, that 857 00:53:41,510 --> 00:53:44,054 is exactly what I'm going to get, 858 00:53:44,054 --> 00:53:48,440 2 pi times alpha angle of attack. 859 00:53:48,440 --> 00:53:54,890 And we have the lift and drag to be proportional to Cd 860 00:53:54,890 --> 00:54:02,460 and proportional to Cd and Cl. 861 00:54:02,460 --> 00:54:08,920 And the dynamics is that dvdt, the derivative of my velocity, 862 00:54:08,920 --> 00:54:15,850 is equal to minus D, the drag times the gravity component 863 00:54:15,850 --> 00:54:17,510 in the backwards reaction. 864 00:54:17,510 --> 00:54:24,480 So if the my airplane has a drag, has a pitch of theta, 865 00:54:24,480 --> 00:54:30,190 I'm going to have deceleration mg cosine theta. 866 00:54:30,190 --> 00:54:33,200 And the rate of change of theta, which is my pitch, 867 00:54:33,200 --> 00:54:40,000 is proportional to the lift minus the gravity component 868 00:54:40,000 --> 00:54:41,630 in the cosine direction. 869 00:54:41,630 --> 00:54:43,848 So that is my dynamic. 870 00:54:43,848 --> 00:54:47,040 So see [INAUDIBLE], I have two couple differential equations 871 00:54:47,040 --> 00:54:51,000 already where the terms d and l are 872 00:54:51,000 --> 00:54:53,710 expressing in terms of these. 873 00:54:53,710 --> 00:55:01,610 Now, the rate of change of alpha, 874 00:55:01,610 --> 00:55:04,680 that is the angle of attack, I am 875 00:55:04,680 --> 00:55:10,180 going to model this as input minus alpha divided by Tau. 876 00:55:10,180 --> 00:55:14,790 So that is the model of the longitudinal stability. 877 00:55:14,790 --> 00:55:15,560 OK. 878 00:55:15,560 --> 00:55:18,030 So this is the case where I actually 879 00:55:18,030 --> 00:55:20,100 have a longitudinal stability. 880 00:55:20,100 --> 00:55:24,090 Otherwise, the sign would be the other way. 881 00:55:24,090 --> 00:55:25,630 So alpha is my input. 882 00:55:25,630 --> 00:55:29,390 I'm going to use the [INAUDIBLE], add my input in. 883 00:55:29,390 --> 00:55:32,705 And alpha is the angle of attack. 884 00:55:32,705 --> 00:55:33,580 AUDIENCE: [INAUDIBLE] 885 00:55:37,840 --> 00:55:41,720 PROFESSOR: Tau is a value I'm going to set. 886 00:55:41,720 --> 00:55:45,570 Tau is going to be-- so what do you think the value of Tau 887 00:55:45,570 --> 00:55:49,270 should be if I have a very stable system, if my Cd is 888 00:55:49,270 --> 00:55:52,617 way in front of my aerodynamic sample? 889 00:55:55,638 --> 00:55:56,513 AUDIENCE: [INAUDIBLE] 890 00:56:01,870 --> 00:56:04,430 PROFESSOR: So if I have a very stable system, 891 00:56:04,430 --> 00:56:06,695 Tau should be very large or very small? 892 00:56:06,695 --> 00:56:07,570 AUDIENCE: [INAUDIBLE] 893 00:56:07,570 --> 00:56:08,905 PROFESSOR: Large? 894 00:56:08,905 --> 00:56:09,760 Are you sure? 895 00:56:12,436 --> 00:56:15,860 So what happens if I have a very stable system? 896 00:56:15,860 --> 00:56:22,230 If I pitch the airplane off, is it going to come back fast 897 00:56:22,230 --> 00:56:23,491 or come back very-- 898 00:56:23,491 --> 00:56:24,333 AUDIENCE: Fast. 899 00:56:24,333 --> 00:56:26,020 PROFESSOR: Fast, right. 900 00:56:26,020 --> 00:56:29,380 So if I have a very stable system, 901 00:56:29,380 --> 00:56:31,720 Tau is going to be very small. 902 00:56:31,720 --> 00:56:35,312 If I have a marginally stable system, 903 00:56:35,312 --> 00:56:37,090 Tau is going to be very large. 904 00:56:37,090 --> 00:56:42,600 So Tau has the unit of pi. 905 00:56:42,600 --> 00:56:45,520 It's really kind of how long that it takes for the airplane 906 00:56:45,520 --> 00:56:50,350 to cut to static stability. 907 00:56:50,350 --> 00:56:51,625 I have two files. 908 00:56:51,625 --> 00:56:56,120 One is the longitudinal [INAUDIBLE] n. 909 00:56:56,120 --> 00:56:59,130 So this function is really [INAUDIBLE] 910 00:56:59,130 --> 00:57:02,201 exactly the same differential equation 911 00:57:02,201 --> 00:57:04,506 I just showed on the slide. 912 00:57:04,506 --> 00:57:06,730 So I have four variables. 913 00:57:06,730 --> 00:57:13,157 They are the velocity, the pitch angle, the angle of attack, 914 00:57:13,157 --> 00:57:14,594 and my altitude. 915 00:57:17,468 --> 00:57:19,384 I have all the [INAUDIBLE] defined here. 916 00:57:19,384 --> 00:57:22,262 I have my Cl equal to 2pi times alpha. 917 00:57:22,262 --> 00:57:24,172 I can do the drag in this. 918 00:57:24,172 --> 00:57:24,672 [INAUDIBLE] 919 00:57:30,456 --> 00:57:35,320 And I have the dvdt, the theta dt, the alpha dt, 920 00:57:35,320 --> 00:57:36,310 and [INAUDIBLE]. 921 00:57:45,818 --> 00:57:50,740 So if you guys implement your own computer using [INAUDIBLE] 922 00:57:50,740 --> 00:57:53,620 style, [INAUDIBLE]. 923 00:58:06,890 --> 00:58:09,070 And here, I have Tau equal to 0.001. 924 00:58:09,070 --> 00:58:14,007 Does that mean I have a very stable system or a not very 925 00:58:14,007 --> 00:58:16,394 stable system? 926 00:58:16,394 --> 00:58:18,366 I got a very stable system, right. 927 00:58:18,366 --> 00:58:19,845 I get a very stable [INAUDIBLE]. 928 00:58:31,295 --> 00:58:32,170 AUDIENCE: [INAUDIBLE] 929 00:58:41,044 --> 00:58:47,430 PROFESSOR: And if you succeeded [INAUDIBLE] you 930 00:58:47,430 --> 00:58:50,680 can [INAUDIBLE] input [INAUDIBLE] alpha [INAUDIBLE]. 931 00:58:50,680 --> 00:58:54,990 It's kind of like visualizing [INAUDIBLE]. 932 00:58:54,990 --> 00:58:56,990 For example, I can [INAUDIBLE]. 933 00:59:15,148 --> 00:59:17,564 It just kind of visualizes [INAUDIBLE]. 934 00:59:17,564 --> 00:59:18,480 This is a [INAUDIBLE]. 935 00:59:25,000 --> 00:59:26,980 I think I [INAUDIBLE]. 936 00:59:34,520 --> 00:59:35,395 AUDIENCE: [INAUDIBLE] 937 00:59:46,159 --> 00:59:52,950 PROFESSOR: [INAUDIBLE] your own [INAUDIBLE] on the joystick, 938 00:59:52,950 --> 00:59:55,244 you can really control your aircraft. 939 00:59:55,244 --> 00:59:57,820 You can really control your [INAUDIBLE] simulated 940 00:59:57,820 --> 00:59:58,320 [INAUDIBLE]. 941 01:00:03,740 --> 01:00:04,880 So let's do this. 942 01:00:04,880 --> 01:00:06,634 Just for the rest of the five minutes, 943 01:00:06,634 --> 01:00:09,044 I'll just let you have fun for yourself. 944 01:00:09,044 --> 01:00:13,970 And one thing I want to show you is that-- so here, 945 01:00:13,970 --> 01:00:15,040 I [INAUDIBLE]. 946 01:00:15,040 --> 01:00:18,410 And the way I did is [INAUDIBLE] can save this file. 947 01:00:22,110 --> 01:00:28,700 And the way I [INAUDIBLE] the joystick input 948 01:00:28,700 --> 01:00:30,752 is by setting [INAUDIBLE] equal to [INAUDIBLE]. 949 01:00:33,410 --> 01:00:37,440 That actually gives you a joystick. 950 01:00:37,440 --> 01:00:38,750 It's like a handle. 951 01:00:38,750 --> 01:00:41,230 It gives you a joystick handle. 952 01:00:41,230 --> 01:00:47,855 And in [INAUDIBLE] from the dropbox, what I did 953 01:00:47,855 --> 01:00:49,600 is the input equal to axis. 954 01:00:55,840 --> 01:01:00,600 So I did the input [INAUDIBLE] to axis [INAUDIBLE] 2. 955 01:01:00,600 --> 01:01:04,630 So this is the axis when I [INAUDIBLE]. 956 01:01:08,442 --> 01:01:12,572 And the [INAUDIBLE] is the third axis. 957 01:01:12,572 --> 01:01:14,540 And it happens to be this one. 958 01:01:14,540 --> 01:01:18,480 The first axis I think we [INAUDIBLE]. 959 01:01:18,480 --> 01:01:21,165 If you guys have time, that'd help me explain this to you 960 01:01:21,165 --> 01:01:25,944 something more like real simulator, that's be great. 961 01:01:25,944 --> 01:01:26,444 OK. 962 01:01:29,770 --> 01:01:33,080 This is [INAUDIBLE]. 963 01:01:33,080 --> 01:01:38,900 [INAUDIBLE] my view which is the [INAUDIBLE] of the velocity, 964 01:01:38,900 --> 01:01:41,800 each angle, angle of attack, and altitude 965 01:01:41,800 --> 01:01:46,110 is equal to the last variable plus delta t 966 01:01:46,110 --> 01:01:50,510 times the function [INAUDIBLE]. 967 01:01:50,510 --> 01:01:53,410 And I've [INAUDIBLE] and did the display. 968 01:01:57,700 --> 01:02:01,170 The [INAUDIBLE] is asking [INAUDIBLE] the whole thing. 969 01:02:01,170 --> 01:02:07,170 But [INAUDIBLE] that [INAUDIBLE] very much 970 01:02:07,170 --> 01:02:12,500 depends on this thing, very much depend on my Tau. 971 01:02:12,500 --> 01:02:15,180 So right now, my Tau is plus 1. 972 01:02:15,180 --> 01:02:18,400 It's stable, but not that stable. 973 01:02:18,400 --> 01:02:20,480 If I [INAUDIBLE] it to 0.001, it's 974 01:02:20,480 --> 01:02:23,270 going to be a more stable system. 975 01:02:23,270 --> 01:02:25,142 But what does that mean? 976 01:02:25,142 --> 01:02:27,600 That means it's [INAUDIBLE], right? 977 01:02:27,600 --> 01:02:30,670 It has a smaller timescale that is 978 01:02:30,670 --> 01:02:32,770 much smaller than the one I'm interested in, 979 01:02:32,770 --> 01:02:36,350 which is the [INAUDIBLE] the longitudinal motion 980 01:02:36,350 --> 01:02:38,190 of aircraft. 981 01:02:38,190 --> 01:02:43,311 So if I set to be that value in MATLAB for [INAUDIBLE]. 982 01:02:43,311 --> 01:02:53,300 If I want to simulate [INAUDIBLE], what happens 983 01:02:53,300 --> 01:02:58,854 is my altitude is 10 to the 16. 984 01:02:58,854 --> 01:03:04,960 And basically, the airplane goes unstable. 985 01:03:04,960 --> 01:03:08,370 Not unstable physically, but unstable numerically. 986 01:03:08,370 --> 01:03:10,430 It's not the airplane goes unstable. 987 01:03:10,430 --> 01:03:15,340 But it's my [INAUDIBLE] integrator goes unstable. 988 01:03:15,340 --> 01:03:19,400 It is particularly unstable in the pitch direction. 989 01:03:19,400 --> 01:03:22,689 Because in the pitch dimension, i 990 01:03:22,689 --> 01:03:26,290 have a timescale that is much, much smaller. 991 01:03:26,290 --> 01:03:30,110 So if you guys are interested, take the [INAUDIBLE] I have 992 01:03:30,110 --> 01:03:37,570 and [INAUDIBLE] integrate on it using Newton-Raphson. 993 01:03:37,570 --> 01:03:42,940 That way if somebody is able to do that and bring 994 01:03:42,940 --> 01:03:47,140 the demo next class, that's fantastic. 995 01:03:47,140 --> 01:03:49,642 And that also saves you the homework this week. 996 01:03:49,642 --> 01:03:54,310 Because the homework this week is going to be about that. 997 01:03:54,310 --> 01:04:00,816 So if you do that before next class, you can demo in class, 998 01:04:00,816 --> 01:04:05,600 and you already solved a big part of this week's homework. 999 01:04:05,600 --> 01:04:07,530 All right. 1000 01:04:07,530 --> 01:04:08,030 OK. 1001 01:04:08,030 --> 01:04:13,070 And what you [INAUDIBLE] is already in the [INAUDIBLE]. 1002 01:04:13,070 --> 01:04:16,120 So I will see you all Wednesday.