1 00:00:00,090 --> 00:00:02,490 The following content is provided under a Creative 2 00:00:02,490 --> 00:00:04,030 Commons license. 3 00:00:04,030 --> 00:00:06,330 Your support will help MIT OpenCourseWare 4 00:00:06,330 --> 00:00:10,720 continue to offer high quality educational resources for free. 5 00:00:10,720 --> 00:00:13,320 To make a donation or view additional materials 6 00:00:13,320 --> 00:00:17,280 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,280 --> 00:00:18,450 at ocw.mit.edu. 8 00:00:23,110 --> 00:00:25,380 PROFESSOR: Today what we've been doing, 9 00:00:25,380 --> 00:00:26,820 we've been looking at how there's 10 00:00:26,820 --> 00:00:29,430 a lot of different representations for CT systems. 11 00:00:29,430 --> 00:00:31,900 They look almost the same as a lot of representations 12 00:00:31,900 --> 00:00:33,900 for DT systems. 13 00:00:33,900 --> 00:00:36,390 And today I want to go one more step 14 00:00:36,390 --> 00:00:38,970 and show how there's actually a bunch of relationships 15 00:00:38,970 --> 00:00:41,280 between them. 16 00:00:41,280 --> 00:00:44,790 That's when things become very powerful. 17 00:00:44,790 --> 00:00:46,710 And so I want to do that by thinking 18 00:00:46,710 --> 00:00:50,550 about a very simple example, thinking about a CT system 19 00:00:50,550 --> 00:00:55,450 and how you would convert that CT system into a DT 20 00:00:55,450 --> 00:00:57,640 representation. 21 00:00:57,640 --> 00:00:59,980 This is a problem we've worked on before, the leaky tank 22 00:00:59,980 --> 00:01:00,479 system. 23 00:01:00,479 --> 00:01:04,660 We've already seen a gazillion representations for it. 24 00:01:04,660 --> 00:01:07,990 We can think about the leaky tank system as a differential 25 00:01:07,990 --> 00:01:09,130 equation. 26 00:01:09,130 --> 00:01:11,830 We derive that in Lecture One. 27 00:01:11,830 --> 00:01:15,220 We can think of it as a block diagram, Lecture One. 28 00:01:15,220 --> 00:01:16,840 We can think about it as a functional. 29 00:01:16,840 --> 00:01:18,310 That was about two lectures ago. 30 00:01:18,310 --> 00:01:20,540 As a system function, that was Laplace transforms, 31 00:01:20,540 --> 00:01:22,280 that was about a week ago. 32 00:01:22,280 --> 00:01:24,130 We can think about an impulse response 33 00:01:24,130 --> 00:01:26,530 because the fundamental signal in CT, 34 00:01:26,530 --> 00:01:30,580 the thing that plays the same role as the unit sample in DT, 35 00:01:30,580 --> 00:01:32,190 is the unit impulse. 36 00:01:32,190 --> 00:01:34,240 So we can think about the impulse response. 37 00:01:34,240 --> 00:01:35,740 And there's a variety of connections 38 00:01:35,740 --> 00:01:37,000 between all of those. 39 00:01:37,000 --> 00:01:41,320 What I want to do today is compare the step response 40 00:01:41,320 --> 00:01:44,260 of the leaky tank system to the step 41 00:01:44,260 --> 00:01:50,930 response of a DT approximation to the tank system. 42 00:01:50,930 --> 00:01:54,480 To get started then, I want to figure out the step response 43 00:01:54,480 --> 00:01:56,790 of the leaky tank system. 44 00:01:56,790 --> 00:02:00,372 For you, you should think about this as practice for the exam. 45 00:02:00,372 --> 00:02:02,205 You should be able to do this in 30 seconds. 46 00:02:05,100 --> 00:02:06,567 So start. 47 00:02:06,567 --> 00:02:08,150 Compare your answers to your neighbor. 48 00:02:08,150 --> 00:02:11,090 Figure out what is the step response 49 00:02:11,090 --> 00:02:12,220 for the leaky tank system. 50 00:02:30,474 --> 00:02:33,967 [INTERPOSING VOICES] 51 00:02:54,440 --> 00:02:55,140 No. 52 00:02:55,140 --> 00:02:55,640 No. 53 00:02:59,020 --> 00:03:02,120 OK, this question is too simple so we're going to blast ahead. 54 00:03:02,120 --> 00:03:03,530 What's the answer? 55 00:03:03,530 --> 00:03:07,527 What's the step response for the leaky tank system? 56 00:03:07,527 --> 00:03:08,610 Everybody raise your hand. 57 00:03:08,610 --> 00:03:10,290 Let me see how many numbers. 58 00:03:10,290 --> 00:03:15,490 OK, it's not quite as high a fraction as I would have liked. 59 00:03:15,490 --> 00:03:17,579 Take another 15 seconds. 60 00:03:17,579 --> 00:03:19,120 Or better yet, talk to your neighbor. 61 00:03:19,120 --> 00:03:20,619 Explain your answer to your neighbor 62 00:03:20,619 --> 00:03:22,648 and let your neighbor tell you why you're wrong. 63 00:03:22,648 --> 00:03:26,134 [INTERPOSING VOICES] 64 00:04:14,510 --> 00:04:16,970 OK, re-vote. 65 00:04:16,970 --> 00:04:21,589 So what's the step response of the leaky tank system? 66 00:04:21,589 --> 00:04:22,520 Better. 67 00:04:22,520 --> 00:04:24,650 Better, better, better, better, better, better. 68 00:04:24,650 --> 00:04:25,970 OK, almost 100%. 69 00:04:25,970 --> 00:04:27,050 Not quite. 70 00:04:27,050 --> 00:04:28,770 Another question. 71 00:04:28,770 --> 00:04:32,480 How many ways can you find the step response of the leaky tank 72 00:04:32,480 --> 00:04:33,290 system? 73 00:04:33,290 --> 00:04:35,930 One represents more than one. 74 00:04:35,930 --> 00:04:38,390 I'm not going to have a representation for 0, right. 75 00:04:38,390 --> 00:04:39,830 More than one, more than two, more than three, 76 00:04:39,830 --> 00:04:40,970 more than four, more than five. 77 00:04:40,970 --> 00:04:42,303 How many ways can you find that? 78 00:04:46,740 --> 00:04:48,600 Don't just stare at me with blank looks. 79 00:04:54,460 --> 00:04:56,200 OK, what's a good way to find the step 80 00:04:56,200 --> 00:04:58,994 response of this system? 81 00:04:58,994 --> 00:05:00,410 You can shout, that way I won't be 82 00:05:00,410 --> 00:05:02,118 able to identify where you're coming from 83 00:05:02,118 --> 00:05:04,470 and I won't be able to point to you. 84 00:05:04,470 --> 00:05:07,340 But you have to be quick because if I see your mouth move then 85 00:05:07,340 --> 00:05:09,180 I'll know which one you are. 86 00:05:09,180 --> 00:05:11,980 So when I look at it this way you shout over here, right. 87 00:05:11,980 --> 00:05:14,030 There's simple ways to do this, right. 88 00:05:16,580 --> 00:05:19,470 What's a good way to find the step response of the leaky tank 89 00:05:19,470 --> 00:05:19,970 system? 90 00:05:19,970 --> 00:05:22,345 AUDIENCE: You have the transfer function [? magnetized ?] 91 00:05:22,345 --> 00:05:25,340 with one bias then we have the [INAUDIBLE] 92 00:05:25,340 --> 00:05:27,190 PROFESSOR: That's a relatively advanced way 93 00:05:27,190 --> 00:05:29,000 and it's completely correct. 94 00:05:29,000 --> 00:05:31,280 Could somebody tell me an even simpler way. 95 00:05:31,280 --> 00:05:32,135 Yes? 96 00:05:32,135 --> 00:05:34,597 AUDIENCE: What's the behavior as t goes to infinity. 97 00:05:34,597 --> 00:05:35,180 PROFESSOR: OK. 98 00:05:35,180 --> 00:05:37,790 What is it? 99 00:05:37,790 --> 00:05:39,350 Let's do something easier. 100 00:05:39,350 --> 00:05:41,862 What's the input? 101 00:05:41,862 --> 00:05:44,130 [INTERPOSING VOICES] 102 00:05:44,130 --> 00:05:46,580 PROFESSOR: Well, it's a unit step, right. 103 00:05:46,580 --> 00:05:48,780 So the input is some unit step thing right. 104 00:05:48,780 --> 00:05:53,560 So my input, if I think about some input r0 of t, 105 00:05:53,560 --> 00:05:56,870 the input is something that looks like that. 106 00:05:56,870 --> 00:05:58,940 So if I look at, like you suggested, 107 00:05:58,940 --> 00:06:01,160 if I look at what's going to happen for t 108 00:06:01,160 --> 00:06:03,532 goes to infinity, what's going to happen? 109 00:06:03,532 --> 00:06:07,380 AUDIENCE: Eventually the rate at which we're going out 110 00:06:07,380 --> 00:06:10,747 is going to be the same as the rate that's going it. 111 00:06:13,460 --> 00:06:15,650 PROFESSOR: So based on that, do I 112 00:06:15,650 --> 00:06:18,456 like this one, this one, this one, this one, or that one? 113 00:06:18,456 --> 00:06:21,242 AUDIENCE: So, it knocks out one and three. 114 00:06:21,242 --> 00:06:22,700 PROFESSOR: Knocks out one and three 115 00:06:22,700 --> 00:06:24,200 because we're not expecting it to go 116 00:06:24,200 --> 00:06:26,090 to zero because the input didn't go to zero. 117 00:06:26,090 --> 00:06:27,590 Good. 118 00:06:27,590 --> 00:06:30,050 OK, so it's maybe this, or this, or that. 119 00:06:32,375 --> 00:06:33,250 What's a good method? 120 00:06:36,600 --> 00:06:38,248 What's a good method? 121 00:06:38,248 --> 00:06:39,206 Yes? 122 00:06:39,206 --> 00:06:40,706 AUDIENCE: So the thing that confused 123 00:06:40,706 --> 00:06:43,758 me is that in the original problem on the problem set 124 00:06:43,758 --> 00:06:46,200 we had it was a second order system, 125 00:06:46,200 --> 00:06:47,560 but this one's a first order. 126 00:06:47,560 --> 00:06:48,851 PROFESSOR: This is first order. 127 00:06:48,851 --> 00:06:50,990 AUDIENCE: Yeah, so then you know that it's 128 00:06:50,990 --> 00:06:53,105 going to look like something's that's first order. 129 00:06:53,105 --> 00:06:55,480 PROFESSOR: Still looks like something that's first order. 130 00:06:55,480 --> 00:06:57,197 That's good. 131 00:06:57,197 --> 00:06:59,280 I asked the question here and I flicked back here, 132 00:06:59,280 --> 00:07:01,680 that was a clue. 133 00:07:01,680 --> 00:07:06,430 How many ways can you think of to do this problem? 134 00:07:06,430 --> 00:07:07,330 Five ways. 135 00:07:10,150 --> 00:07:10,736 OK. 136 00:07:10,736 --> 00:07:13,360 You could think about solving it by looking at the differential 137 00:07:13,360 --> 00:07:14,124 equation. 138 00:07:14,124 --> 00:07:15,790 How about how many of you could do that? 139 00:07:19,110 --> 00:07:22,050 OK, how many of you took 1803? 140 00:07:22,050 --> 00:07:22,880 Ah, good, good. 141 00:07:22,880 --> 00:07:24,960 So all of you could do it by doing the lower 142 00:07:24,960 --> 00:07:26,820 left-hand corner, right? 143 00:07:26,820 --> 00:07:29,300 OK, you could all do it that way. 144 00:07:29,300 --> 00:07:33,430 You could all do it with block diagrams, right. 145 00:07:33,430 --> 00:07:35,889 We thought about how you put a signal into a block diagram 146 00:07:35,889 --> 00:07:37,680 and you can chase it around its end, right. 147 00:07:37,680 --> 00:07:39,690 You could do it that way. 148 00:07:39,690 --> 00:07:42,830 So there's at least five ways. 149 00:07:42,830 --> 00:07:45,682 Just as rehearsal, I'm sharing two ways here 150 00:07:45,682 --> 00:07:47,640 that don't quite fall there, so my answer would 151 00:07:47,640 --> 00:07:51,530 have been at least seven ways that I can do this problem. 152 00:07:51,530 --> 00:07:53,280 Because I'm going to show you two new ones 153 00:07:53,280 --> 00:07:55,320 that don't appear directly. 154 00:07:55,320 --> 00:07:59,180 One way is to think about the differential equation, 155 00:07:59,180 --> 00:08:03,170 solving for t less than zero and t greater than zero. 156 00:08:03,170 --> 00:08:04,545 Paste the solutions together. 157 00:08:07,065 --> 00:08:09,200 With me so far? 158 00:08:09,200 --> 00:08:10,970 So solve it for t less than 0, the answer 159 00:08:10,970 --> 00:08:12,305 is 0 because there was no input. 160 00:08:12,305 --> 00:08:14,000 It started at rest. 161 00:08:14,000 --> 00:08:15,340 Solve it for t bigger than 0. 162 00:08:15,340 --> 00:08:18,560 That means the input is 1. 163 00:08:18,560 --> 00:08:20,720 So you can get some answer for t bigger than 0. 164 00:08:20,720 --> 00:08:27,770 Paste the two solutions together by using step functions. 165 00:08:27,770 --> 00:08:31,235 Put the total answer back into the differential equation. 166 00:08:33,890 --> 00:08:35,809 That total answer better have the property 167 00:08:35,809 --> 00:08:39,890 that it solves the differential equation for all time. 168 00:08:39,890 --> 00:08:40,390 OK. 169 00:08:40,390 --> 00:08:41,210 Nod your head yes. 170 00:08:41,210 --> 00:08:44,340 It will make me feel like I'm doing a fantastic job. 171 00:08:47,700 --> 00:08:49,500 The only trick there is thinking about how 172 00:08:49,500 --> 00:08:51,750 do you do things like differentiating unit step 173 00:08:51,750 --> 00:08:52,560 function. 174 00:08:52,560 --> 00:08:54,310 But the derivative of a unit step function 175 00:08:54,310 --> 00:08:56,557 is delta function. 176 00:08:56,557 --> 00:08:58,140 The derivative of one of these things, 177 00:08:58,140 --> 00:08:59,973 which looks like a product of something that 178 00:08:59,973 --> 00:09:02,670 exists for all time and something that turns on at 0, 179 00:09:02,670 --> 00:09:03,900 it's just a product rule. 180 00:09:03,900 --> 00:09:05,070 Derivative of the first times the second, 181 00:09:05,070 --> 00:09:07,110 plus second times the derivative of the first. 182 00:09:07,110 --> 00:09:10,590 Except I said the same thing twice. 183 00:09:10,590 --> 00:09:12,150 OK. 184 00:09:12,150 --> 00:09:14,040 And so if you do that, you end up 185 00:09:14,040 --> 00:09:18,850 finding out that to match the delta functions and the u 186 00:09:18,850 --> 00:09:22,170 functions, it places additional constraints on the constants 187 00:09:22,170 --> 00:09:25,550 and the answer looks like this. 188 00:09:25,550 --> 00:09:29,119 OK, everybody sort of sees what I'm saying? 189 00:09:29,119 --> 00:09:30,660 Here's a different way you can do it. 190 00:09:30,660 --> 00:09:31,660 You could think systems. 191 00:09:35,040 --> 00:09:39,160 So on the chart I told you what the unit's impulse response 192 00:09:39,160 --> 00:09:39,660 was. 193 00:09:39,660 --> 00:09:44,550 It's 1 over tau u to the minus t over tau u of t. 194 00:09:44,550 --> 00:09:49,170 So you could use that to figure out the response. 195 00:09:49,170 --> 00:09:51,180 If I know that delta goes into a system, 196 00:09:51,180 --> 00:09:57,900 it gives me the unit impulse response h of t. 197 00:09:57,900 --> 00:10:00,170 And the question then is, find the unit step response. 198 00:10:00,170 --> 00:10:02,370 Well, there's an easy way to find the unit step. 199 00:10:02,370 --> 00:10:04,455 That's just the integral of the unit impulse. 200 00:10:08,160 --> 00:10:10,970 So apparently, the unit step response of this thing 201 00:10:10,970 --> 00:10:12,920 is the same as the unit impulse response 202 00:10:12,920 --> 00:10:14,005 of this combined system. 203 00:10:17,830 --> 00:10:19,720 But we know from our analysis of systems 204 00:10:19,720 --> 00:10:21,630 that you're allowed to commute things. 205 00:10:21,630 --> 00:10:23,130 So that means I can flip this order. 206 00:10:26,697 --> 00:10:28,280 Which means then that all I need to do 207 00:10:28,280 --> 00:10:30,580 is integrate the impulse response of this thing, which 208 00:10:30,580 --> 00:10:34,050 I knew by assumption. 209 00:10:34,050 --> 00:10:36,550 So if I integrate the impulse response, 210 00:10:36,550 --> 00:10:37,550 I get the step response. 211 00:10:37,550 --> 00:10:39,230 That's another way of doing it. 212 00:10:39,230 --> 00:10:40,760 I could do it by Laplace transforms, 213 00:10:40,760 --> 00:10:42,560 I could do it a gazillion ways, right. 214 00:10:42,560 --> 00:10:43,880 Easy. 215 00:10:43,880 --> 00:10:47,660 You should go home and make sure you can do all of those. 216 00:10:47,660 --> 00:10:49,370 OK, so the answer then was number two. 217 00:10:49,370 --> 00:10:50,267 It's this thing. 218 00:10:50,267 --> 00:10:52,100 It's the first order response, like we said. 219 00:10:52,100 --> 00:10:54,920 It has to go to a particular final value, which 220 00:10:54,920 --> 00:10:59,480 is equal to the final value of the input. 221 00:10:59,480 --> 00:11:02,370 There's a variety of ways that you could get that. 222 00:11:02,370 --> 00:11:06,080 OK, the point of today then is to take that unit sample 223 00:11:06,080 --> 00:11:12,110 response and figure out ways to approximate it. 224 00:11:12,110 --> 00:11:14,750 What I want to do is think about how 225 00:11:14,750 --> 00:11:17,180 I would make a discrete representation for the CT 226 00:11:17,180 --> 00:11:19,970 system, the leaky tank system. 227 00:11:19,970 --> 00:11:21,200 You've done this in homework. 228 00:11:21,200 --> 00:11:24,020 This was homework one. 229 00:11:24,020 --> 00:11:27,050 I'm trying to do is get some new perspective by thinking 230 00:11:27,050 --> 00:11:29,960 about all those representations that we have on the answer 231 00:11:29,960 --> 00:11:33,830 that you already derived in homework one. 232 00:11:33,830 --> 00:11:39,140 So if I wanted to represent this system, the leaky tank system, 233 00:11:39,140 --> 00:11:40,610 by a difference equation, one way 234 00:11:40,610 --> 00:11:41,985 to get the difference equation is 235 00:11:41,985 --> 00:11:45,780 to make an approximation to the derivative based 236 00:11:45,780 --> 00:11:48,050 on differences. 237 00:11:48,050 --> 00:11:50,270 The easiest way to do that is something 238 00:11:50,270 --> 00:11:53,890 that we will call the forward Euler method. 239 00:11:53,890 --> 00:11:56,060 In the forward Euler method, what we do is 240 00:11:56,060 --> 00:11:57,860 we think about all the functions of time. 241 00:11:57,860 --> 00:11:59,780 Say we have an x function of time 242 00:11:59,780 --> 00:12:03,466 and a y function of time, the input and the output. 243 00:12:03,466 --> 00:12:05,840 I've got the continuous version and the discrete version, 244 00:12:05,840 --> 00:12:09,342 that's the sub c and the sub d. 245 00:12:09,342 --> 00:12:10,800 The way I could make an association 246 00:12:10,800 --> 00:12:15,840 between discrete and continuous is by sampling the signals. 247 00:12:15,840 --> 00:12:18,560 So I could say that if I knew x sub 248 00:12:18,560 --> 00:12:21,160 c of t, that's going to be some squirrely function 249 00:12:21,160 --> 00:12:23,860 but I don't know the answer, I don't know what that is. 250 00:12:23,860 --> 00:12:26,910 But whatever it is, I will say that the discrete version 251 00:12:26,910 --> 00:12:32,850 at time n is the same as the continuous version at time n 252 00:12:32,850 --> 00:12:37,160 times t. t is a sampling interval. 253 00:12:37,160 --> 00:12:40,370 And the discrete version of this y function, this output 254 00:12:40,370 --> 00:12:44,170 function, at time m plus 1t is the m 255 00:12:44,170 --> 00:12:49,160 plus 1 sample of the discretized output signal. 256 00:12:49,160 --> 00:12:53,202 Then the trick to solving the differential equation-- 257 00:12:53,202 --> 00:12:54,910 remember the differential equation looked 258 00:12:54,910 --> 00:13:03,260 like tau y dot of t is x of t minus y of t. 259 00:13:03,260 --> 00:13:07,600 I need to have a way of thinking about this y dot thing. 260 00:13:07,600 --> 00:13:09,270 A way of thinking about the y dot thing 261 00:13:09,270 --> 00:13:11,670 would be the slope of the line that connects 262 00:13:11,670 --> 00:13:14,400 this sample to the next sample. 263 00:13:14,400 --> 00:13:17,970 We call it forward Euler because at time n 264 00:13:17,970 --> 00:13:24,770 we approximate the derivative at time n by looking forward. 265 00:13:24,770 --> 00:13:31,010 So we approximate the derivative of y continuous at time nt 266 00:13:31,010 --> 00:13:36,650 by looking forward, yd of n plus 1 minus yd of n over t. 267 00:13:36,650 --> 00:13:40,160 Then all we need to do is make that substitution 268 00:13:40,160 --> 00:13:44,480 into the differential equation and it turns it 269 00:13:44,480 --> 00:13:46,950 into a difference equation. 270 00:13:46,950 --> 00:13:50,180 So if I make the substitution that y dot is 271 00:13:50,180 --> 00:13:52,740 given by this kind of an expression, 272 00:13:52,740 --> 00:13:55,970 substitute into this expression. 273 00:13:55,970 --> 00:13:58,790 I get a difference equation that is in some sense 274 00:13:58,790 --> 00:14:03,260 equivalent to the original differential equation. 275 00:14:03,260 --> 00:14:04,790 I can solve that difference equation 276 00:14:04,790 --> 00:14:08,460 and I get that bottom difference relationship. 277 00:14:08,460 --> 00:14:10,910 That's what you did in homework one. 278 00:14:10,910 --> 00:14:13,920 If you were to plot that answer, here's what you would get. 279 00:14:17,370 --> 00:14:21,840 The blue curve represents the solution 280 00:14:21,840 --> 00:14:27,360 to the leaky tank problem, the continuous problem. 281 00:14:27,360 --> 00:14:31,890 1 minus e to the minus t over tau, quantity u of t. 282 00:14:31,890 --> 00:14:33,810 So that's the blue line. 283 00:14:33,810 --> 00:14:35,790 If you select the sampling interval 284 00:14:35,790 --> 00:14:38,310 to be small compared to tau-- 285 00:14:38,310 --> 00:14:41,370 tau was the time constant for the CT system-- 286 00:14:41,370 --> 00:14:43,830 if you select the sampling interval to be small, 287 00:14:43,830 --> 00:14:46,440 0.1, the samples that you calculate 288 00:14:46,440 --> 00:14:48,150 fall right on top of the line. 289 00:14:48,150 --> 00:14:48,650 Great. 290 00:14:51,250 --> 00:14:52,630 That's what we would want, right. 291 00:14:52,630 --> 00:14:54,680 We're trying to make a DT approximation. 292 00:14:54,680 --> 00:14:58,240 If our approximation worked the solution to the DT equations 293 00:14:58,240 --> 00:15:00,910 should be the same, in some sense, 294 00:15:00,910 --> 00:15:05,110 as the solution to the CT equations. 295 00:15:05,110 --> 00:15:08,340 But if you change capital T, you get 296 00:15:08,340 --> 00:15:10,320 something that looks decreasingly 297 00:15:10,320 --> 00:15:15,750 like the continuous version if you make T step 298 00:15:15,750 --> 00:15:19,080 bigger and bigger per time. 299 00:15:19,080 --> 00:15:20,640 T is a sampling interval. 300 00:15:20,640 --> 00:15:23,130 If I started with a small sampling interval, 301 00:15:23,130 --> 00:15:24,720 I got a good approximation. 302 00:15:24,720 --> 00:15:27,930 By the time I get the sampling interval up to 2T, 303 00:15:27,930 --> 00:15:30,540 this solution to the DT problem looks nothing 304 00:15:30,540 --> 00:15:34,020 like the solution to the CT problem. 305 00:15:34,020 --> 00:15:37,410 OK, that's a general problem in a numerical method. 306 00:15:37,410 --> 00:15:39,210 So what we're really talking about 307 00:15:39,210 --> 00:15:41,700 is analysis of numerical methods. 308 00:15:41,700 --> 00:15:44,680 What went wrong? 309 00:15:44,680 --> 00:15:48,701 Why is it that the approximation worked well and didn't 310 00:15:48,701 --> 00:15:49,200 work well? 311 00:15:49,200 --> 00:15:50,970 I mean, it's intuitively clear that that's 312 00:15:50,970 --> 00:15:52,110 what you should have done but we'd 313 00:15:52,110 --> 00:15:53,776 like to be a little more formal and we'd 314 00:15:53,776 --> 00:15:55,440 like to be a little more quantitative. 315 00:15:55,440 --> 00:15:56,835 What was it that went wrong? 316 00:15:59,430 --> 00:16:01,410 So to get some insight let's figure 317 00:16:01,410 --> 00:16:04,422 out the pole for the DT system. 318 00:16:04,422 --> 00:16:05,130 Where's the pole? 319 00:16:59,570 --> 00:17:01,320 OK, where's the pole? 320 00:17:01,320 --> 00:17:02,810 Where is the pole of the DT system? 321 00:17:06,030 --> 00:17:08,730 Not a large voter turnout, but 100% 322 00:17:08,730 --> 00:17:11,400 among those who turned out. 323 00:17:11,400 --> 00:17:13,950 So the answer is number two. 324 00:17:13,950 --> 00:17:16,410 It's pretty simple to see how that would be the answer 325 00:17:16,410 --> 00:17:20,119 if you start with the difference equation. 326 00:17:20,119 --> 00:17:24,339 It's very simple to write as e transform. 327 00:17:24,339 --> 00:17:29,680 This evaluate y at m plus 1 is the reverse of a delay, 328 00:17:29,680 --> 00:17:31,270 it's an advance. 329 00:17:31,270 --> 00:17:33,950 Delay is multiplied by z minus 1, so advance 330 00:17:33,950 --> 00:17:37,140 is multiplied by z. 331 00:17:37,140 --> 00:17:40,230 So you can take the z transform of the difference equation 332 00:17:40,230 --> 00:17:44,115 to derive the z transform of the system function. 333 00:17:48,530 --> 00:17:51,960 And then clearly there a pole here at z 334 00:17:51,960 --> 00:17:55,220 equals 1 minus T over tau. 335 00:17:55,220 --> 00:17:56,990 So the answer was number two. 336 00:17:56,990 --> 00:18:01,640 And it gives us a way to think about why the difference 337 00:18:01,640 --> 00:18:05,120 solution didn't work well. 338 00:18:05,120 --> 00:18:10,272 What we can see is that even though you remember-- 339 00:18:10,272 --> 00:18:11,730 what was the pole of the CT system? 340 00:18:15,679 --> 00:18:17,220 What's was the pole of the CT system? 341 00:18:27,932 --> 00:18:29,890 How do you think about the pole of a CT system? 342 00:18:35,291 --> 00:18:37,260 AUDIENCE: [INAUDIBLE] 343 00:18:37,260 --> 00:18:38,580 PROFESSOR: Close. 344 00:18:38,580 --> 00:18:41,520 What's the pole of the CT system? 345 00:18:41,520 --> 00:18:43,520 AUDIENCE: [INAUDIBLE] 346 00:18:43,520 --> 00:18:45,200 PROFESSOR: Minus 1 over tau. 347 00:18:45,200 --> 00:18:47,770 So we would do the same sort of thing, but now with a Laplace 348 00:18:47,770 --> 00:18:49,790 transform, right. 349 00:18:49,790 --> 00:18:51,290 So we would say that we could write 350 00:18:51,290 --> 00:18:52,980 Laplace transform of this. 351 00:18:52,980 --> 00:19:01,700 This would be s tau y is x minus y. 352 00:19:01,700 --> 00:19:06,560 And the pole that we get in the s plane it's 353 00:19:06,560 --> 00:19:12,300 going to be 1 over 1 minus, minus 1 over tau. 354 00:19:12,300 --> 00:19:16,760 Despite the fact that the pole in the s plane 355 00:19:16,760 --> 00:19:18,860 was the same for all the simulations, 356 00:19:18,860 --> 00:19:22,800 the simulations, the discrete versions, look different. 357 00:19:22,800 --> 00:19:26,000 And that's because the pole for the DT system is not the same. 358 00:19:26,000 --> 00:19:30,590 The pole for the DT system depended both on tau, 359 00:19:30,590 --> 00:19:34,280 as did the pole for the CT system. 360 00:19:34,280 --> 00:19:42,290 But the DT system the pole depended also on capital T. 361 00:19:42,290 --> 00:19:44,900 So we said that the pole, you remember the solution 362 00:19:44,900 --> 00:19:51,530 to the last problem, the pole was at 1 minus T over tau. 363 00:19:51,530 --> 00:19:56,405 So if T over tau is 0.1, the pole is at 0.9. 364 00:19:56,405 --> 00:20:00,920 If T over tau is 0.3, the pole is 0.7. 365 00:20:00,920 --> 00:20:06,426 If the pole is at 2, it's 1 minus 2 is minus 1. 366 00:20:06,426 --> 00:20:12,850 So the pole for the DT system depends on both T and tau. 367 00:20:12,850 --> 00:20:16,730 And it's given formally by this relationship. 368 00:20:19,270 --> 00:20:23,930 The equivalent pole in the DT system is 1 minus T over tau. 369 00:20:23,930 --> 00:20:29,090 So the pole in the CT system was minus 1 over tau. 370 00:20:29,090 --> 00:20:30,710 The pole in the DT system moved. 371 00:20:35,290 --> 00:20:40,180 The amazing thing is that the correspondence 372 00:20:40,180 --> 00:20:44,290 between where the pole in the CT system was 373 00:20:44,290 --> 00:20:47,665 and where the pole in the DT system is, 374 00:20:47,665 --> 00:20:51,760 is completely determined by the forward Euler method. 375 00:20:51,760 --> 00:20:54,335 It has nothing to do with the particular problem. 376 00:20:57,868 --> 00:21:00,760 OK. 377 00:21:00,760 --> 00:21:03,790 We just figured out the map between the pole 378 00:21:03,790 --> 00:21:06,430 in the s domain and the pole in the z domain 379 00:21:06,430 --> 00:21:08,530 for a particular problem for the leaky tank. 380 00:21:08,530 --> 00:21:14,080 It turns out that that same map holds for every differential 381 00:21:14,080 --> 00:21:16,666 equation. 382 00:21:16,666 --> 00:21:18,040 So what I want to think about now 383 00:21:18,040 --> 00:21:20,560 is how you would prove such a statement. 384 00:21:20,560 --> 00:21:27,600 So, think about regardless of the CT system 385 00:21:27,600 --> 00:21:30,780 that we're thinking about, I can always 386 00:21:30,780 --> 00:21:39,480 write it in block diagram form with adders, integrators, 387 00:21:39,480 --> 00:21:41,580 and gains. 388 00:21:41,580 --> 00:21:45,300 So for the leaky tank system that was easy. 389 00:21:45,300 --> 00:21:48,060 My system looked like-- 390 00:21:48,060 --> 00:21:54,955 I had 1 over tau, integrate add. 391 00:21:58,252 --> 00:22:02,055 So my system for the leaky tank system looked like that. 392 00:22:06,640 --> 00:22:10,320 So the point is that there there's an A there. 393 00:22:10,320 --> 00:22:13,210 The Euler forward relationship is telling me 394 00:22:13,210 --> 00:22:18,580 how I can figure out a DT representation for the A 395 00:22:18,580 --> 00:22:20,420 function. 396 00:22:20,420 --> 00:22:22,910 So let's think about what A is. 397 00:22:22,910 --> 00:22:29,440 A is a thing that in CT, if the output of A 398 00:22:29,440 --> 00:22:31,270 is y, what's the input to A? 399 00:22:35,437 --> 00:22:36,809 AUDIENCE: The derivative. 400 00:22:36,809 --> 00:22:38,100 PROFESSOR: It's the derivative. 401 00:22:38,100 --> 00:22:40,840 So the input we would want to call y dot. 402 00:22:43,380 --> 00:22:46,990 So I might say that's x. 403 00:22:46,990 --> 00:22:50,560 So if the input is x, which is y dot, I put it through and A box 404 00:22:50,560 --> 00:22:53,950 and it comes out y. 405 00:22:53,950 --> 00:22:57,460 So what's the Euler forward rule saying? 406 00:22:57,460 --> 00:22:59,680 So the Euler forward rule says that if I 407 00:22:59,680 --> 00:23:04,180 want to compute x of n, the n sample of this thing, 408 00:23:04,180 --> 00:23:05,350 I should do y dot. 409 00:23:05,350 --> 00:23:09,340 But y dot, I'm doing Euler forward I should look ahead. 410 00:23:09,340 --> 00:23:14,890 So I should compute y dot as y of n plus 1 minus y 411 00:23:14,890 --> 00:23:17,015 of n, divide by t. 412 00:23:22,010 --> 00:23:24,660 OK. 413 00:23:24,660 --> 00:23:27,330 Now if I want to make a DT equivalent system what 414 00:23:27,330 --> 00:23:31,170 I'd like to have is some kind of a box that I could put x of n 415 00:23:31,170 --> 00:23:34,005 in and get y of n out. 416 00:23:36,690 --> 00:23:43,770 If I had such a box then I could replace every A in my CT block 417 00:23:43,770 --> 00:23:49,312 diagram with this new box that depends only on delays. 418 00:23:49,312 --> 00:23:51,270 So let's think about what would be in that box. 419 00:23:51,270 --> 00:23:54,780 If I wanted to make w of n out of x of n 420 00:23:54,780 --> 00:23:57,962 according to this rule, what would I do? 421 00:23:57,962 --> 00:24:04,530 Well, let see, y of n plus 1 should be y of n 422 00:24:04,530 --> 00:24:06,240 added to T x of n. 423 00:24:10,659 --> 00:24:14,880 So if I want to compute y of n plus 1. 424 00:24:14,880 --> 00:24:17,470 Oh dear, what's y of n plus 1. 425 00:24:17,470 --> 00:24:22,130 How do I generate-- my output I want to be y of n. 426 00:24:22,130 --> 00:24:25,460 Where's y of n plus 1? 427 00:24:25,460 --> 00:24:29,623 If I knew y of n, how I compute y of n plus 1? 428 00:24:29,623 --> 00:24:31,590 AUDIENCE: [INAUDIBLE] 429 00:24:31,590 --> 00:24:33,640 PROFESSOR: It would be back one. 430 00:24:33,640 --> 00:24:41,860 So if I had an R here, what would be the name of this guy? 431 00:24:41,860 --> 00:24:45,100 This would be y of n plus 1, right? 432 00:24:45,100 --> 00:24:49,870 Delays have the property that their output is minus 1. 433 00:24:49,870 --> 00:24:52,730 I need a signal that's plus 1. 434 00:24:52,730 --> 00:24:55,790 So I need the reverse of a delay, which 435 00:24:55,790 --> 00:25:02,240 I can implement by having this y signal being generated by an R. 436 00:25:02,240 --> 00:25:05,570 Then this equation says that in order to compute y of n plus 1, 437 00:25:05,570 --> 00:25:10,400 this thing, what I need to do is add this to that. 438 00:25:10,400 --> 00:25:17,060 So I need to add this to that. 439 00:25:20,860 --> 00:25:21,570 OK. 440 00:25:21,570 --> 00:25:23,900 The Euler forward rule says, if I 441 00:25:23,900 --> 00:25:26,150 want to make a discrete approximation 442 00:25:26,150 --> 00:25:30,080 to the relationship between y at the output and its derivative 443 00:25:30,080 --> 00:25:34,720 at the input, I should make one of those boxes. 444 00:25:34,720 --> 00:25:35,220 OK. 445 00:25:35,220 --> 00:25:36,570 I have a rule now. 446 00:25:36,570 --> 00:25:42,120 Regardless of my CT system, I'll take every integrator 447 00:25:42,120 --> 00:25:45,930 and stick one of those in it. 448 00:25:45,930 --> 00:25:50,277 And what I'll have is a DT approximation to my CT system 449 00:25:50,277 --> 00:25:52,360 that's everywhere based on the Euler forward rule. 450 00:25:52,360 --> 00:25:55,440 Is that clear? 451 00:25:55,440 --> 00:25:58,230 So now I have a rule for converting an arbitrary CT 452 00:25:58,230 --> 00:26:00,720 system into an equivalent DT system. 453 00:26:00,720 --> 00:26:04,560 Equivalent in the sense of Euler forward. 454 00:26:04,560 --> 00:26:07,140 And I know that that transformation will hold. 455 00:26:07,140 --> 00:26:10,770 But it's even better than that. 456 00:26:10,770 --> 00:26:13,440 Because I can now say something about the relationship 457 00:26:13,440 --> 00:26:18,140 between the position of the pole in the CT system 458 00:26:18,140 --> 00:26:20,600 and the position of the pole in the DT system. 459 00:26:20,600 --> 00:26:26,570 Because I know this original system, the A, 460 00:26:26,570 --> 00:26:28,760 I'm going to think of A as being 1 over 2. 461 00:26:28,760 --> 00:26:31,660 That's the Laplace transformation. 462 00:26:34,740 --> 00:26:37,710 And I want that to be equivalent, 463 00:26:37,710 --> 00:26:42,720 according to this map, to some transformation in z. 464 00:26:42,720 --> 00:26:44,130 So I can look at this thing and I 465 00:26:44,130 --> 00:26:46,830 can see well, that system function, 466 00:26:46,830 --> 00:26:49,830 if I represent that whole block by a system function, 467 00:26:49,830 --> 00:26:53,310 the system transformation it looks like that. 468 00:26:57,740 --> 00:27:00,900 But R, that's the same as 1 over z. 469 00:27:05,260 --> 00:27:09,700 But that's the same as T over z minus 1. 470 00:27:09,700 --> 00:27:15,280 Apparently, there's a relationship between s and z. 471 00:27:15,280 --> 00:27:23,950 In fact, z minus 1 is sT. z is 1 plus sT. 472 00:27:23,950 --> 00:27:29,500 Regardless of what CT system I started with, 473 00:27:29,500 --> 00:27:32,320 if I use the Euler forward relationship to make 474 00:27:32,320 --> 00:27:34,960 an approximation of the integrator 475 00:27:34,960 --> 00:27:37,705 the resulting transformation will always have that property. 476 00:27:40,420 --> 00:27:43,880 That's exactly what we saw over here. 477 00:27:43,880 --> 00:27:48,790 So we think about the A's in the original system being mapped 478 00:27:48,790 --> 00:27:53,910 to something that's a little bit more complicated, showed here. 479 00:27:53,910 --> 00:27:57,860 But it's a DT representation. 480 00:27:57,860 --> 00:28:00,020 And that DT representation always 481 00:28:00,020 --> 00:28:04,160 has this property, that wherever the poles were in s 482 00:28:04,160 --> 00:28:08,450 I can find where the poles were in z by taking z 483 00:28:08,450 --> 00:28:17,370 equals 1 plus sT. 484 00:28:17,370 --> 00:28:21,420 That's how we get the dependence on T. If the original pole was 485 00:28:21,420 --> 00:28:25,180 like over here at minus 1 over tau, 486 00:28:25,180 --> 00:28:30,460 we just put s equals minus 1 over tau, 487 00:28:30,460 --> 00:28:32,200 and we get precisely this relationship 488 00:28:32,200 --> 00:28:33,490 that we got before. 489 00:28:33,490 --> 00:28:36,220 The 1 plus sT, which is what I found here, 490 00:28:36,220 --> 00:28:39,460 is the same as the 1 minus T over tau 491 00:28:39,460 --> 00:28:43,870 that we found for the particular example of the leaky tank. 492 00:28:43,870 --> 00:28:44,572 Yes? 493 00:28:44,572 --> 00:28:46,018 AUDIENCE: I think you mentioned this earlier, 494 00:28:46,018 --> 00:28:47,809 but this is purely because of the mechanics 495 00:28:47,809 --> 00:28:49,260 of the forward Euler method? 496 00:28:49,260 --> 00:28:51,160 PROFESSOR: Because of forward Euler. 497 00:28:51,160 --> 00:28:56,620 This is only true if I decide that all of my integrators 498 00:28:56,620 --> 00:29:00,670 are approximated using the forward Euler rule. 499 00:29:00,670 --> 00:29:03,790 It's absolutely true. 500 00:29:03,790 --> 00:29:05,180 OK. 501 00:29:05,180 --> 00:29:08,660 And that's a very interesting result. What it says 502 00:29:08,660 --> 00:29:12,260 is that if I think about how were the poles distributed 503 00:29:12,260 --> 00:29:15,650 in the s plane, I just used that rule 504 00:29:15,650 --> 00:29:20,360 to figure out how they'll be distributed in the z plane. 505 00:29:20,360 --> 00:29:25,070 The rule says take the s plane pole, scale it by capital T, 506 00:29:25,070 --> 00:29:26,590 and then shift the answer by 1. 507 00:29:29,852 --> 00:29:31,250 Well, that's pretty interesting. 508 00:29:31,250 --> 00:29:34,580 Because that means that there are s's 509 00:29:34,580 --> 00:29:39,680 over here that when I go through that map 510 00:29:39,680 --> 00:29:42,180 end up outside the unit circle. 511 00:29:42,180 --> 00:29:43,590 That's exactly what I found. 512 00:29:46,250 --> 00:29:48,320 That transformation has the property 513 00:29:48,320 --> 00:29:52,640 that it can map a stable CT system, a perfectly 514 00:29:52,640 --> 00:29:57,560 well-behaved CT system, into an oscillatory or even 515 00:29:57,560 --> 00:30:01,470 a growing divergent DT system. 516 00:30:01,470 --> 00:30:04,340 And you can see that simply because of the map 517 00:30:04,340 --> 00:30:07,500 between z and s. 518 00:30:07,500 --> 00:30:15,590 Had s been some number over here, 519 00:30:15,590 --> 00:30:20,360 the unit impulse response of the CT system 520 00:30:20,360 --> 00:30:22,360 would have been completely well-behaved, 521 00:30:22,360 --> 00:30:28,280 e to the minus sT. But the response to the DT equivalent 522 00:30:28,280 --> 00:30:30,590 would be badly behaved because it would have 523 00:30:30,590 --> 00:30:34,960 mapped outside the unit circle. 524 00:30:34,960 --> 00:30:35,570 OK? 525 00:30:35,570 --> 00:30:39,320 And as you motivated, the that's only true 526 00:30:39,320 --> 00:30:42,840 because I did Euler forward. 527 00:30:42,840 --> 00:30:48,270 I can do precisely the same analysis for backward Euler. 528 00:30:48,270 --> 00:30:50,730 Instead of approximating derivatives 529 00:30:50,730 --> 00:30:53,340 by looking forward in time like I did before, 530 00:30:53,340 --> 00:30:55,320 I could instead look backward in time. 531 00:30:58,020 --> 00:31:01,500 If I look backward in time it looks almost the same. 532 00:31:01,500 --> 00:31:03,670 Now I say the derivative at the time n 533 00:31:03,670 --> 00:31:08,310 cap T is n minus n minus 1. 534 00:31:08,310 --> 00:31:10,470 Look backwards. 535 00:31:10,470 --> 00:31:13,680 Seems like a trivial difference. 536 00:31:13,680 --> 00:31:17,010 But in fact the answer comes out completely different. 537 00:31:17,010 --> 00:31:38,270 If I look backwards in time instead, 538 00:31:38,270 --> 00:31:41,540 what I can think about now is replacing every one 539 00:31:41,540 --> 00:31:42,950 of these A operators again. 540 00:31:42,950 --> 00:31:46,910 So I think about A. A was this thing that y came out of 541 00:31:46,910 --> 00:31:49,730 and y dot must have gone into, which was x. 542 00:31:52,720 --> 00:31:55,870 And now I'm using Euler backward instead. 543 00:31:55,870 --> 00:32:03,810 So now I want x of n should look backwards in time. 544 00:32:03,810 --> 00:32:14,060 So I want y of n minus y of n minus 1 divided by T. 545 00:32:14,060 --> 00:32:19,910 So what this says is that I want to take y of n 546 00:32:19,910 --> 00:32:28,460 should be y of n minus 1, added to T times x of n. 547 00:32:28,460 --> 00:32:32,110 So that's a system that if I started with x of n 548 00:32:32,110 --> 00:32:35,690 and I wanted to generate y of n, it's 549 00:32:35,690 --> 00:32:37,350 almost the same as the other one. 550 00:32:37,350 --> 00:32:40,700 Except now it says, when I want to construct y of n, 551 00:32:40,700 --> 00:32:42,740 start with a delayed version of y. 552 00:32:42,740 --> 00:32:44,390 How do I get a delayed version of y? 553 00:32:47,250 --> 00:32:48,480 Delay it. 554 00:32:48,480 --> 00:32:54,580 So I take y and I delay it like that. 555 00:32:58,270 --> 00:33:02,320 What comes out here is y of n minus 1. 556 00:33:02,320 --> 00:33:11,710 And then y of n is y of n minus 1, added to T times x of n. 557 00:33:11,710 --> 00:33:14,590 So it's like that. 558 00:33:14,590 --> 00:33:19,000 It's almost the same, but the math is different. 559 00:33:19,000 --> 00:33:23,530 So now I'm replacing my A's, which are always 1 560 00:33:23,530 --> 00:33:29,860 over s, with a system that looks like T going forward divided 561 00:33:29,860 --> 00:33:33,620 by 1 minus R in the bottom. 562 00:33:33,620 --> 00:33:38,110 So that's T over 1 minus 1 over z. 563 00:33:38,110 --> 00:33:43,460 So that's zT over z minus 1. 564 00:33:43,460 --> 00:33:48,115 So that means that z minus 1 now is sTz. 565 00:33:52,400 --> 00:33:57,190 Cross multiplying 1 minus sT on z is 1. 566 00:33:57,190 --> 00:34:00,610 So z is 1 over 1 minus sT. 567 00:34:00,610 --> 00:34:02,800 I got something that looks completely different. 568 00:34:02,800 --> 00:34:05,650 This is backward Euler. 569 00:34:05,650 --> 00:34:07,150 This is forward Euler. 570 00:34:07,150 --> 00:34:10,270 So the answer for forward Euler over here 571 00:34:10,270 --> 00:34:16,060 is 1 plus sT. The answer for backward Euler is 1 over 1 572 00:34:16,060 --> 00:34:21,429 minus sT. Everybody with me? 573 00:34:21,429 --> 00:34:26,469 So now when I think about where do the poles land, 574 00:34:26,469 --> 00:34:30,159 if I make the backwards Euler approximation 575 00:34:30,159 --> 00:34:35,920 they fall on this relationship instead of the previous. 576 00:34:35,920 --> 00:34:38,440 And the interesting thing about that relationship 577 00:34:38,440 --> 00:34:44,600 is that if you think about the way 578 00:34:44,600 --> 00:34:51,300 this works every point in the left half plane of s, 579 00:34:51,300 --> 00:34:57,030 according to this map, ends up inside a little circle 580 00:34:57,030 --> 00:35:00,060 in the z domain. 581 00:35:00,060 --> 00:35:06,106 The entire left half plane maps into the circle 582 00:35:06,106 --> 00:35:07,230 that's shaded in the right. 583 00:35:07,230 --> 00:35:09,360 If you just make a picture. 584 00:35:09,360 --> 00:35:13,770 If you just plug in s equals 1, where does s happen? 585 00:35:13,770 --> 00:35:16,650 Plug in s equals minus 1, where's the new z? 586 00:35:16,650 --> 00:35:20,370 Plug in s equals 1 over T, where's the new z? 587 00:35:20,370 --> 00:35:23,430 All of the values in the left half plane for s 588 00:35:23,430 --> 00:35:29,080 map inside a small circle in the z plane. 589 00:35:29,080 --> 00:35:35,310 Which means that if the original system had a pole anywhere 590 00:35:35,310 --> 00:35:36,870 in the left half plane-- 591 00:35:36,870 --> 00:35:38,790 remember left half planes, left-sided. 592 00:35:38,790 --> 00:35:41,670 We're thinking that those are the kinds of systems 593 00:35:41,670 --> 00:35:48,640 whose unit impulse responses converge toward 0. 594 00:35:48,640 --> 00:35:53,410 If you had a system that had poles in the left half plane 595 00:35:53,410 --> 00:35:55,840 and you do the backwards Euler transformation, 596 00:35:55,840 --> 00:35:58,690 you're guaranteed to get a system that has 597 00:35:58,690 --> 00:36:02,780 poles inside the unit circle. 598 00:36:02,780 --> 00:36:07,680 In fact, they're in a smaller circle than the unit circle. 599 00:36:07,680 --> 00:36:08,230 OK. 600 00:36:08,230 --> 00:36:11,960 Everybody sort of know what I'm talking about? 601 00:36:11,960 --> 00:36:14,740 So this is the idea of thinking about, 602 00:36:14,740 --> 00:36:18,970 not relationships among DT representations, 603 00:36:18,970 --> 00:36:22,270 or representations among CT systems, 604 00:36:22,270 --> 00:36:25,570 but relations between CT and DT. 605 00:36:25,570 --> 00:36:30,820 It's because we can cast each of those kinds of systems 606 00:36:30,820 --> 00:36:32,830 into a polynomial representation that we 607 00:36:32,830 --> 00:36:37,480 can make a correspondence between the CT system 608 00:36:37,480 --> 00:36:39,910 and the DT approximation. 609 00:36:39,910 --> 00:36:42,490 I'll talk about just one more, and that's 610 00:36:42,490 --> 00:36:48,080 the trapezoid rule, which is what you did in homework two. 611 00:36:48,080 --> 00:36:50,300 You may remember homework two, right. 612 00:36:50,300 --> 00:36:52,970 Since it was due, like, yesterday. 613 00:36:52,970 --> 00:36:54,640 So the last problem in homework two 614 00:36:54,640 --> 00:36:57,340 had to do with finding a numerical approximation 615 00:36:57,340 --> 00:37:00,220 to the mass and springs system. 616 00:37:00,220 --> 00:37:02,830 And you remember, we did three of them. 617 00:37:02,830 --> 00:37:07,060 Those three were actually forward Euler, backward Euler, 618 00:37:07,060 --> 00:37:09,610 and trapezoidal rule. 619 00:37:09,610 --> 00:37:12,730 Trapezoidal rule says, OK, I didn't 620 00:37:12,730 --> 00:37:17,050 like this idea of looking forward, 621 00:37:17,050 --> 00:37:19,780 that seems anti-symmetric. 622 00:37:19,780 --> 00:37:22,630 What's special about forwards or backwards? 623 00:37:22,630 --> 00:37:25,840 That's also treating backwards special. 624 00:37:25,840 --> 00:37:28,240 I want to treat it symmetric in time. 625 00:37:28,240 --> 00:37:30,760 That's what the center difference approximation did. 626 00:37:30,760 --> 00:37:33,087 The center difference approximation in homework two 627 00:37:33,087 --> 00:37:34,420 was based on a trapezoidal rule. 628 00:37:34,420 --> 00:37:37,000 The trapezoidal rule says, OK, let 629 00:37:37,000 --> 00:37:40,395 me approximate my DT output. 630 00:37:43,600 --> 00:37:48,070 Let me think about a sequence of samples in a DT output, y to n. 631 00:37:48,070 --> 00:37:50,980 Let me force the differential equation 632 00:37:50,980 --> 00:37:53,845 to be true at every point between samples. 633 00:37:58,690 --> 00:38:01,180 In the forward Euler and the backward, 634 00:38:01,180 --> 00:38:02,740 we force the differential equation 635 00:38:02,740 --> 00:38:05,740 to be true at integers n. 636 00:38:05,740 --> 00:38:08,140 That made us compute derivatives by looking 637 00:38:08,140 --> 00:38:09,070 forward or backwards. 638 00:38:09,070 --> 00:38:11,680 In a trapezoidal rule we force the differential equation 639 00:38:11,680 --> 00:38:13,570 to be true between samples. 640 00:38:13,570 --> 00:38:19,210 Then we say, OK, the signal yc should be 641 00:38:19,210 --> 00:38:22,270 the average of those samples. 642 00:38:22,270 --> 00:38:24,790 And the derivative should be the difference 643 00:38:24,790 --> 00:38:29,989 of the two samples divided by T. So they're centered. 644 00:38:29,989 --> 00:38:30,780 Everybody see that? 645 00:38:30,780 --> 00:38:33,230 So we're going to force the differential equation 646 00:38:33,230 --> 00:38:36,650 to be true at points between the samples of the difference 647 00:38:36,650 --> 00:38:39,160 equation. 648 00:38:39,160 --> 00:38:42,020 And that's going to give me a different kind of relationship 649 00:38:42,020 --> 00:38:44,840 that looks strikingly the same as these kinds 650 00:38:44,840 --> 00:38:47,600 of relationships. 651 00:38:47,600 --> 00:38:57,460 OK, so now I'm going to say that I would like to have 652 00:38:57,460 --> 00:39:03,110 A, which maps y, y dot is x. 653 00:39:03,110 --> 00:39:08,710 Except now what I'm going to want to say is that x-- 654 00:39:08,710 --> 00:39:13,330 which I will represent as the average 655 00:39:13,330 --> 00:39:16,378 of the nth and nth minus 1-- 656 00:39:20,362 --> 00:39:25,160 should be constrained to be the derivative of this guy, 657 00:39:25,160 --> 00:39:30,705 which I will do by looking at the corresponding values of y. 658 00:39:34,190 --> 00:39:36,830 OK? 659 00:39:36,830 --> 00:39:39,470 So that gives me a different way of doing the approximation. 660 00:39:39,470 --> 00:39:51,590 I get y of n should be y of n minus 1, plus T over 2, x of n 661 00:39:51,590 --> 00:39:54,068 plus x of n minus 1. 662 00:39:57,056 --> 00:39:59,840 Just a different rule for how to do the derivative, that's 663 00:39:59,840 --> 00:40:01,280 all I've done. 664 00:40:01,280 --> 00:40:03,590 But it gives me a different kind of a system. 665 00:40:03,590 --> 00:40:07,910 Now I want to have x of n go into something that I 666 00:40:07,910 --> 00:40:09,800 will make my new A boxes. 667 00:40:12,740 --> 00:40:15,530 To compute y of n I should have a delayed version. 668 00:40:15,530 --> 00:40:16,310 Well, that's easy. 669 00:40:16,310 --> 00:40:17,165 I make one of those. 670 00:40:20,620 --> 00:40:25,370 And y of n should be the sum of the delayed version. 671 00:40:25,370 --> 00:40:30,710 And T over 2 times a delayed version of x. 672 00:40:30,710 --> 00:40:31,900 So I have to do this. 673 00:40:34,800 --> 00:40:40,290 So now I have the sum of x and a delayed version of x. 674 00:40:40,290 --> 00:40:42,015 And I put that through T over 2. 675 00:40:45,970 --> 00:40:48,030 So here is my new discrete approximation 676 00:40:48,030 --> 00:40:51,711 to the accumulator. 677 00:40:51,711 --> 00:40:53,460 And I do just the same thing I did before. 678 00:40:53,460 --> 00:41:00,280 I say, what's the relationship between s and z? 679 00:41:11,650 --> 00:41:16,810 So my A, which is the same as 1 over s, 680 00:41:16,810 --> 00:41:24,450 now becomes that block diagram, which looks like T over 2. 681 00:41:24,450 --> 00:41:27,390 Looks like r plus 1. 682 00:41:27,390 --> 00:41:30,640 Let's see, 1 plus R. Lets do it the other way. 683 00:41:30,640 --> 00:41:38,620 So T over 2, 1 plus R, 1 minus 2. 684 00:41:38,620 --> 00:41:42,400 So T over 2 from here, 1 plus R from here, 1 over 1 685 00:41:42,400 --> 00:41:43,375 minus R from there. 686 00:41:46,580 --> 00:41:50,020 Which I can convert into z and I'll get T over 2, 687 00:41:50,020 --> 00:41:52,850 z plus 1 over z minus 1. 688 00:41:56,160 --> 00:41:59,030 I don't think I made any mistakes yet. 689 00:41:59,030 --> 00:42:05,230 So then I get z plus 1-- 690 00:42:05,230 --> 00:42:06,423 z minus 1. 691 00:42:10,590 --> 00:42:13,180 Bring that over there, bring that over there. 692 00:42:13,180 --> 00:42:16,191 sT over 2, z plus 1. 693 00:42:19,880 --> 00:42:21,410 Now bring the z's over here. 694 00:42:21,410 --> 00:42:31,290 1 minus sT over 2 operate on z to give me 1 plus sT over 2. 695 00:42:31,290 --> 00:42:38,990 So z is 1 plus sT over 2, over 1 minus sT over 2. 696 00:42:38,990 --> 00:42:44,540 So that's my new transformation based on the trapezoidal rule, 697 00:42:44,540 --> 00:42:45,590 which is showed here. 698 00:42:45,590 --> 00:42:47,460 Hopefully they match. 699 00:42:47,460 --> 00:42:53,180 So z maps to 1 plus sT over 2 divided by 1 minus sT over 2. 700 00:42:53,180 --> 00:42:55,610 And the interesting thing about that transformation 701 00:42:55,610 --> 00:43:00,140 is that it map the entire left half plane of s 702 00:43:00,140 --> 00:43:01,550 precisely into the unit circle. 703 00:43:04,740 --> 00:43:07,770 That was the reason that the trapezoidal rule 704 00:43:07,770 --> 00:43:10,680 worked so much better on the problems 705 00:43:10,680 --> 00:43:14,190 you tried in homework two. 706 00:43:14,190 --> 00:43:18,750 So if the pole starts out being real so 707 00:43:18,750 --> 00:43:22,990 that it's someplace in the s plane on this red arrow. 708 00:43:22,990 --> 00:43:27,120 Euler forward gave us a pole in the z plane 709 00:43:27,120 --> 00:43:31,045 that could be, if T is big enough, outside the unit 710 00:43:31,045 --> 00:43:31,545 circle. 711 00:43:34,350 --> 00:43:37,120 In the Euler backwards method, it always 712 00:43:37,120 --> 00:43:39,850 lands someplace in the unit circle. 713 00:43:39,850 --> 00:43:45,430 In the trapezoidal rule it lands someplace in the unit circle. 714 00:43:45,430 --> 00:43:48,460 But in the mass spring problem and the poles 715 00:43:48,460 --> 00:43:52,120 were on the imaginary axis, which 716 00:43:52,120 --> 00:43:55,900 means that in the Euler forward method, 717 00:43:55,900 --> 00:43:58,640 the poles went outside the unit circle. 718 00:43:58,640 --> 00:44:01,180 That's the reason the solution to the mass spring problem 719 00:44:01,180 --> 00:44:01,680 diverged. 720 00:44:05,100 --> 00:44:07,920 In the Euler backward method, the poles 721 00:44:07,920 --> 00:44:12,110 that were on the j omega axis mapped to the perimeter 722 00:44:12,110 --> 00:44:13,710 of this inside circle. 723 00:44:13,710 --> 00:44:16,980 That's why they converged, even though the mass spring 724 00:44:16,980 --> 00:44:21,210 system should have isolated forever in the solution 725 00:44:21,210 --> 00:44:23,100 that you did with Euler backwards. 726 00:44:23,100 --> 00:44:28,500 It converged, and that's because the method maps 727 00:44:28,500 --> 00:44:32,290 poles on the j omega axis inside the unit circle. 728 00:44:32,290 --> 00:44:34,960 That's not what we want. 729 00:44:34,960 --> 00:44:37,690 What we want for the mass spring system is to map 730 00:44:37,690 --> 00:44:42,010 the j omega poles directly onto the unit circle 731 00:44:42,010 --> 00:44:43,920 so that pure oscillations over here 732 00:44:43,920 --> 00:44:46,540 correspond to pure oscillations over there. 733 00:44:46,540 --> 00:44:48,840 And that's exactly what the trapezoidal rules does. 734 00:44:51,840 --> 00:44:54,516 OK, so the point then-- 735 00:44:54,516 --> 00:44:56,640 and this was the solution to that homework problem. 736 00:44:59,180 --> 00:45:02,560 So the point is that not only are we 737 00:45:02,560 --> 00:45:04,390 interested in figuring out relationships 738 00:45:04,390 --> 00:45:08,020 among the different representations for CT systems 739 00:45:08,020 --> 00:45:11,590 and among the different representations for DT systems, 740 00:45:11,590 --> 00:45:13,960 there's a lot of insight that you can get especially 741 00:45:13,960 --> 00:45:16,960 into things like numerical approximations 742 00:45:16,960 --> 00:45:19,990 by thinking about how the relationships in one domain 743 00:45:19,990 --> 00:45:22,140 map to the other.