1 00:00:17,100 --> 00:00:25,110 Hello, in the last class we have reviewed some exercises. I mean while solving exercises 2 00:00:25,110 --> 00:00:31,680 we have reviewed some of the single step methods. So, let us continue to do that and we 3 00:00:31,680 --> 00:00:37,000 missed may be solving system of equation and then... Of course, we have learnt R K 4 00:00:37,000 --> 00:00:43,501 methods, but only explicit. So, may be with reference to some implicit nature. So, let 5 00:00:43,501 --> 00:00:49,110 us try to attempt some problems. 6 00:00:49,110 --> 00:00:50,110 . 7 00:00:50,110 --> 00:01:13,310 So, this is tutorial two still continuing single step methods. Solve for y of point 8 00:01:13,310 --> 00:01:42,390 3 point 6 when y x is the solution of 9 00:01:42,390 --> 00:01:55,619 second order equation. So, we need two mutual conditions 10 00:01:55,619 --> 00:02:25,341 sorry. Choose h is point 3. So, solve for y of point 3 and the y of point 6 when y x 11 00:02:25,341 --> 00:02:28,940 is the solution of the second order equation this 12 00:02:28,940 --> 00:02:32,600 initial value problem and choose h point 3. So, 13 00:02:32,600 --> 00:02:50,430 that means to compute y of point 3 with this. So, x 0 is 0, so y of point 3 is y 1 y of 14 00:02:50,430 --> 00:02:54,520 point 6 is y 2. 15 00:02:54,520 --> 00:03:03,700 Now as we discussed so earlier so this is a second order. So, what do we have to do 16 00:03:03,700 --> 00:03:09,700 convert it to couple system of fist order equation and then try to adopt one of the 17 00:03:09,700 --> 00:03:22,730 methods. The story is not over, which method we have to mention? Solve using runge - 18 00:03:22,730 --> 00:03:43,370 .kutta of order four right. If we solve runge - kutta order four then lot of general idea 19 00:03:43,370 --> 00:03:45,950 we may get. 20 00:03:45,950 --> 00:03:46,950 . 21 00:03:46,950 --> 00:03:59,262 So what was our equation? Y double minus x y dashed plus y equals 0 and y of 0 is 1 and 22 00:03:59,262 --> 00:04:23,740 y dash of 0 is minus 1 right? Now we have to convert this to system. Let y dash is z. 23 00:04:23,740 --> 00:04:33,030 So, then this becomes this implies z dashed minus 24 00:04:33,030 --> 00:04:44,250 x z plus y equals to 0. So, therefore, we have the following system y dash equals to 25 00:04:44,250 --> 00:04:54,760 z, z dash d is minus y plus x z, y of zero is 1. 26 00:04:54,760 --> 00:05:11,010 And y dash of 0 becomes z of 0 is minus 1. So, this is our system, so this our system 27 00:05:11,010 --> 00:05:12,750 that we have to solve. 28 00:05:12,750 --> 00:05:36,300 Now since it is a remark x is independent variable y and z dependent variables. So, 29 00:05:36,300 --> 00:05:44,740 therefore, when we use R K fourth order we have to be careful and we have to define two 30 00:05:44,740 --> 00:05:55,010 different functions. So, how do we define? So, the general with reference to general 31 00:05:55,010 --> 00:06:08,780 system y dash equals to f of x y z, which is z it is z dash these g of x y z, which 32 00:06:08,780 --> 00:06:18,240 is minus y plus x z. So, corresponding to y we define 33 00:06:18,240 --> 00:06:31,090 a specific functions and correspond z we define different functions. So how do we do 34 00:06:31,090 --> 00:06:33,270 so how do we do? 35 00:06:33,270 --> 00:06:34,270 .. 36 00:06:34,270 --> 00:07:04,880 y n plus 1 equals y n plus h by 6 k 1 plus 2 k 2 plus k 3 plus k 4 right? Then so we 37 00:07:04,880 --> 00:07:21,470 define. So, let us have simultaneously z n plus 1 z n plus h by 6. So, we have to use 38 00:07:21,470 --> 00:07:26,520 a different notation. So, let us use a different 39 00:07:26,520 --> 00:07:43,140 notation l 1 plus 2, l 2 plus l 3, l 4. So what is 40 00:07:43,140 --> 00:08:42,479 k 1? K 1 is f of x, y, z and what is l 1? G of x, y, z then k 2, therefore l 2 and k 41 00:08:42,479 --> 00:10:00,559 3. l 3, k 4, l 4. So, these are the two different coupled 42 00:10:00,559 --> 00:10:11,851 so unless you compute k 1 one cannot compute l 2. So, unless we compute l 1 one 43 00:10:11,851 --> 00:10:22,729 cannot compute k 2. So, they are coupled right. So, let us proceed further. 44 00:10:22,729 --> 00:10:23,729 . 45 00:10:23,729 --> 00:10:42,249 .Now n is 0 so we have f of x, y, z is, f of x, y, z is z. g of x, y, z is minus y plus 46 00:10:42,249 --> 00:11:00,410 x z so k 1 is. So, let us write down the given that as 47 00:11:00,410 --> 00:11:13,149 well y 0 is 0 z 0 is minus 1 x 0 is 0. So z 0 is 48 00:11:13,149 --> 00:11:47,019 minus 1. And what is l 1? So, this is 0 0. So, l 1 is y 0 sorry y zero is 1. So this 49 00:11:47,019 --> 00:12:03,589 will be 1 minus 1. So this is minus 1. Then k 2 is z 50 00:12:03,589 --> 00:12:21,850 0 plus h l 1 by 2 minus 1 plus l 1 is minus 1. 51 00:12:21,850 --> 00:12:40,939 So, this will be this l 2, l 2 will be minus. So, this on we 52 00:12:40,939 --> 00:12:47,699 have defined l 2 is… so we have a all three involved so the increments are 53 00:12:47,699 --> 00:13:06,910 h by 2, h k 1 by 2, h l 1 by 2. So from here minus y 0 plus this plus x 0 plus h by 2 z 54 00:13:06,910 --> 00:13:21,509 0 plus h l 1 by 2. So this will be minus k 1 is 55 00:13:21,509 --> 00:14:11,100 minus 1 plus x 0 is 0, z 0 is minus 1, l 1 is minus 1. So this will be minus 1 minus 56 00:14:11,100 --> 00:14:28,009 so this will be so this is our l 2. 57 00:14:28,009 --> 00:14:29,009 . 58 00:14:29,009 --> 00:16:26,149 Now k 3 so l 2 so this will be, then l 3, k 2, l 2. So this will be, then k 4, l 3. 59 00:16:26,149 --> 00:17:35,370 So, this is then l 4, k 3 value minus y 0. This is z 0 60 00:17:35,370 --> 00:17:43,460 so this is z 0. So, this can be simplified and we 61 00:17:43,460 --> 00:17:47,260 get minus point. 62 00:17:47,260 --> 00:17:48,260 .. 63 00:17:48,260 --> 00:18:36,400 So, having obtained these values we have y 0, h by 6, then k 1 plus 2, k 2 plus 2, 64 00:18:36,400 --> 00:19:29,570 k 3 plus k 4, so this l 1 plus 2, l 2 plus 2. So, this 65 00:19:29,570 --> 00:19:48,049 can be. So, y of point 6 left as an exercise so 66 00:19:48,049 --> 00:20:00,730 similar method. So, you can try to do it. So, with a with R K method we could solve 67 00:20:00,730 --> 00:20:05,460 system. So that we get both simultaneously that is how to use R K method and 68 00:20:05,460 --> 00:20:12,340 simultaneously how to solve system of equations. And if you observe the R K method, 69 00:20:12,340 --> 00:20:17,090 which we have discussed both second order and then three stage and forth order etcetera. 70 00:20:17,090 --> 00:20:24,009 So, these are all explicit in fact tell a series explicit method and the all that. So, 71 00:20:24,009 --> 00:20:31,039 there are some methods which are implicit. So, what 72 00:20:31,039 --> 00:20:36,500 do you mean by implicit? So, we will discuss in detail when we go to multi step methods, 73 00:20:36,500 --> 00:20:43,120 but just a brief what is implicit method and. Then we quickly look into implicit Runge - Kutta 74 00:20:43,120 --> 00:20:45,380 method. So let us do that. 75 00:20:45,380 --> 00:20:46,380 .. 76 00:20:46,380 --> 00:21:12,540 So, suppose a method is defined as y n plus 1 equals to y n minus 2 plus 3 f and plus 77 00:21:12,540 --> 00:21:20,559 1. And this f n plus 1 is f of. So, that means 78 00:21:20,559 --> 00:21:28,330 we are asking for computing y n plus 1, but right hand side is also asking. So such method 79 00:21:28,330 --> 00:21:34,160 is implicit right? . 80 00:21:34,160 --> 00:21:48,440 So, let us look at it is a kind of problem only, but in terms of implicit R K method 81 00:21:48,440 --> 00:22:19,049 derive an implicit Runge - Kutta method of the form. 82 00:22:19,049 --> 00:22:40,090 So, you may observe why we are calling this implicit. So, you have left hand side 83 00:22:40,090 --> 00:22:44,470 you have k 1, but right hand side as well we 84 00:22:44,470 --> 00:22:56,240 have. So, derive an implicit Runge - Kutta method of the form this 85 00:22:56,240 --> 00:22:58,830 that is second order. 86 00:22:58,830 --> 00:23:08,789 .So, how do you proceed? So, we in general in explicit we have learnt we have expanded 87 00:23:08,789 --> 00:23:14,410 this and tell us series and then we have expanded this in powers of h. And then we 88 00:23:14,410 --> 00:23:22,389 expanded the y n, y of x n plus 1 in tell a series. And then match the coefficient of 89 00:23:22,389 --> 00:23:24,559 equal parts of h. 90 00:23:24,559 --> 00:23:30,529 Similar sought of thing we need to do here, but you may observe right hand side you 91 00:23:30,529 --> 00:23:37,590 have k 1. And left hand side we have k 1. So that means if you keep on substituting 92 00:23:37,590 --> 00:23:41,130 k 1 this same expression recursively k 1 will 93 00:23:41,130 --> 00:23:45,100 be sitting on the right hand side. So, let us see 94 00:23:45,100 --> 00:24:18,980 how do we proceed further? So, k 1 expanding alpha h dou f by dou x plus beta k 1. So, 95 00:24:18,980 --> 00:24:41,940 the higer term etcetera. So, this is h f n alpha h square plus h beta dou f by dou y 96 00:24:41,940 --> 00:24:52,850 k 1. So k 1 is sitting. So now again we need to substitute 97 00:24:52,850 --> 00:25:28,190 k 1. . 98 00:25:28,190 --> 00:25:52,590 And the other terms. So, therefore y n plus 1 is y n plus w 1 h f n plus. If you multiply 99 00:25:52,590 --> 00:26:47,590 these h square beta, h square beta h f n dou y plus h q terms. So, plus so tell a series. 100 00:26:47,590 --> 00:26:53,980 Now comparing these two because the method is second order we can pair up to h 101 00:26:53,980 --> 00:27:09,920 square. So, this approximate, this and for f w 1 must be 1. Then for f x coefficient 102 00:27:09,920 --> 00:27:17,899 is half there and here alpha w 1 is half. Then for 103 00:27:17,899 --> 00:27:32,620 here w 1 is half. So, this implies alpha equals 104 00:27:32,620 --> 00:27:45,120 to beta equals to half. So, therefore, y n plus 1 is y n plus h x 105 00:27:45,120 --> 00:28:04,090 n plus h by 2 y n plus k 1 by 2, where k 1 is. So it 106 00:28:04,090 --> 00:28:12,929 is a recursive because if you substitute we keep on getting k 1 recursively k 1 there 107 00:28:12,929 --> 00:28:16,029 k 1. Again if you substitute again you get k 1, 108 00:28:16,029 --> 00:28:21,690 but now the less up to second order by 109 00:28:21,690 --> 00:28:27,259 .comparing by we get the coefficient and then this is explicit. Why it is explicit? You 110 00:28:27,259 --> 00:28:36,250 cannot recall. K 1 we are expecting to compute, but it is given the right hand side. So, 111 00:28:36,250 --> 00:28:43,339 this is a very important observation in implicit R K method. 112 00:28:43,339 --> 00:28:44,339 . 113 00:28:44,339 --> 00:28:54,710 So, let us solve some problems, but one remark before we proceed is generally 114 00:28:54,710 --> 00:29:03,039 expanding in a tell a series is very difficult because recursively how long we do it. So 115 00:29:03,039 --> 00:29:08,240 it is. So, let us see through this example slightly. 116 00:29:08,240 --> 00:29:28,779 Different story with h equals to point 3 using 117 00:29:28,779 --> 00:29:48,639 second order implicit Runge - Kutta method right. So just now we have derived by 118 00:29:48,639 --> 00:30:19,350 expansion now we would like to solve a problem. So, this was our implicit R K method. For 119 00:30:19,350 --> 00:30:33,820 the given problem f of x y is this x 0 0 y 0 is 1 120 00:30:33,820 --> 00:30:55,740 right. Now let us try to compute k 1 h f of this so therefore minus 2 x n plus h by 2 121 00:30:55,740 --> 00:31:31,700 y n plus square. So, minus h 2 x n plus h, which 122 00:31:31,700 --> 00:32:05,820 is an implicit equation for k 1. And one may use any iterative method because we have to 123 00:32:05,820 --> 00:32:13,169 solve for k 1. See this we have to solve the problem if you keep on substituting the cursively 124 00:32:13,169 --> 00:32:18,460 so that is not end. The method has been obtained in that fashion, but now we would 125 00:32:18,460 --> 00:32:29,080 like to compute the solution. So this is an implicit equation. So we have to solved using 126 00:32:29,080 --> 00:32:31,049 any itorative method. 127 00:32:31,049 --> 00:32:32,049 .. 128 00:32:32,049 --> 00:33:00,710 So to this extent let us define f of k 1 as k 1 plus h. So, this is k 1, which is point 129 00:33:00,710 --> 00:33:21,590 3. Now since it is any itorative method we try to 130 00:33:21,590 --> 00:33:48,830 use Newton - Rophson method we propose to use Newton - Rophson method. So, therefore 131 00:33:48,830 --> 00:34:31,210 k 1 s plus 1 say l plus 1 minus. So let us propose to have Newton - Rophson method. So, 132 00:34:31,210 --> 00:34:45,280 accordingly let us compute. Now we need an initial guess. Assume k 1 0 equals 133 00:34:45,280 --> 00:35:12,560 h. So, this is f or f s minus 2 x 0 square y 0 134 00:35:12,560 --> 00:35:25,700 square this is minus 2 point 3 x 0 square 0. So, k 1 is 0. 135 00:35:25,700 --> 00:35:26,700 . 136 00:35:26,700 --> 00:35:54,370 .Now let us compute f dashed. Say f dashed 137 00:35:54,370 --> 00:36:16,860 k 1 is 1 plus 2 times half. So, this is 1 plus 138 00:36:16,860 --> 00:37:01,880 0.3 2 x n 2, 2 get cancelled, Y n plus this. Now so this will be x 0, y 0 so 1 plus k 1 139 00:37:01,880 --> 00:37:35,810 0, 0. So, this equals, then f of k 1 0. This will 140 00:37:35,810 --> 00:37:42,530 be… so this will be. . 141 00:37:42,530 --> 00:38:39,250 So, therefore... So, we have f of this is f dashed of is. So, therefore k 1 1 is. So, 142 00:38:39,250 --> 00:38:48,520 this is minus. So, this k 1 prime now we have to compute 143 00:38:48,520 --> 00:39:01,390 f of k 1 sorry not k 1 prime k 1 1. Now we have to compute this so we may do using 144 00:39:01,390 --> 00:39:34,750 calculator and also we need this. And hence k 1 2 we get. So, one may stop here 145 00:39:34,750 --> 00:40:09,130 or proceed until. So, we proceed until two consecutive. The difference the difference 146 00:40:09,130 --> 00:40:11,080 was the two consecutive values is less then x 147 00:40:11,080 --> 00:40:18,540 large some pre assigned we will proceed. So, let us say here we stop. So, one we stop we 148 00:40:18,540 --> 00:40:54,330 get. So this is y 1 y 0 plus k 1. So, this is the answer. So, this is how to sole using 149 00:40:54,330 --> 00:41:06,810 implicit R K method. 150 00:41:06,810 --> 00:41:07,810 .. 151 00:41:07,810 --> 00:41:16,000 Now we have solve lot of stability problems for 152 00:41:16,000 --> 00:42:39,030 the express it so let us do it for implicit. Find the reason of stability for the implicit 153 00:42:39,030 --> 00:42:42,870 Runge - Kutta method given by this for the I 154 00:42:42,870 --> 00:42:54,230 V P? Please make a note. So, this is a case of f of x y equals. So, that is no explicit 155 00:42:54,230 --> 00:43:07,070 dependency on x. So, this is a kind of a special case. Now for this we would like to have 156 00:43:07,070 --> 00:43:17,250 stability interval, stability analysis. So, now let us proceed with our reference equation. 157 00:43:17,250 --> 00:43:18,250 . 158 00:43:18,250 --> 00:44:03,690 y dashed equals to lambda y this implies k 1 is h and k 2 is h. so you can see k 2 is 159 00:44:03,690 --> 00:44:53,350 implicit. So, k 1 lambda h y n, so since k 2 is explicit we try to collect the co efficient 160 00:44:53,350 --> 00:45:21,600 .and solve as an algebraic equation. So this implies. So, this is kind of algebraic equation 161 00:45:21,600 --> 00:45:23,210 let. . 162 00:45:23,210 --> 00:46:00,770 So, then we have k 2 equals. So, this our k 2. So, therefore y n plus 1 is y n plus. 163 00:46:00,770 --> 00:46:20,970 So, what was our method? Y n plus 1 by 4, k 1 164 00:46:20,970 --> 00:47:10,450 plus. So, this is y n plus 1 by 4. So, this is our 165 00:47:10,450 --> 00:47:55,850 difference equation, is the difference equation whose characteristic equation is. So, this 166 00:47:55,850 --> 00:48:06,270 is a characteristic equation. So, now once we 167 00:48:06,270 --> 00:48:11,570 have the characterise equation. So, the procedure is for absolute stability we have 168 00:48:11,570 --> 00:48:24,440 to put the condition of on the roots and then try to determine. So, let us do that. 169 00:48:24,440 --> 00:48:25,440 .. 170 00:48:25,440 --> 00:49:03,970 For absolute stability, where lamda is negative. So, this implies minus 1, so this implies 171 00:49:03,970 --> 00:49:53,230 right. So, from from this we get, we get look at it so if you bring it this side so we get 172 00:49:53,230 --> 00:50:11,550 h bar. So, h bar by 6 h bar 6 plus h bar less 173 00:50:11,550 --> 00:50:31,330 than or equals to 0 and since lamda h s d 0 h or 174 00:50:31,330 --> 00:50:48,850 h bar is equal to the minus 6. So, this is one side. So, then we have to see while the 175 00:50:48,850 --> 00:50:51,970 left. So, this is the right inequality now we have 176 00:50:51,970 --> 00:50:54,580 to see the left. . 177 00:50:54,580 --> 00:51:47,780 So, the left inequality. So this this gives so minus 2. So, this gives 178 00:51:47,780 --> 00:51:55,930 and which is true for. So, this holds and true for h bar greater 179 00:51:55,930 --> 00:52:06,300 than 2 minus 6, so therefore stability interval. 180 00:52:06,300 --> 00:52:15,660 .From the left we, from the right way got h bar greater than equal to 6. And the left 181 00:52:15,660 --> 00:52:39,030 inequality this and this holds for this, so the stability interval minus 6 to 0. So, for 182 00:52:39,030 --> 00:52:51,830 implicit, the problem with implicit is for deriving a method we have use to tell a series. 183 00:52:51,830 --> 00:53:00,660 But then for a specific method we have to solve an algebraic equation. Sometimes it 184 00:53:00,660 --> 00:53:05,980 is nor linear and that we have solved using using 185 00:53:05,980 --> 00:53:22,820 Newton - Rephson method. Now let us have some exercises for your for benefit of 186 00:53:22,820 --> 00:53:27,730 practice. . 187 00:53:27,730 --> 00:54:02,060 Obtain solution of the system y dashed equals to z. z dashed equals to minus 4 y minus 2 188 00:54:02,060 --> 00:54:48,760 z y of 0 is 1 z of 0 is 1 by Euler’s method. Two Runge - Kutta fourth order 189 00:54:48,760 --> 00:54:54,160 using step 190 00:54:54,160 --> 00:55:14,170 size h equals to 0.2. Obtain the solution of the system using step size h is equal 0.2 191 00:55:14,170 --> 00:55:28,400 compute y of 0.2, y of 0.4. 192 00:55:28,400 --> 00:55:29,400 .. 193 00:55:29,400 --> 00:56:08,410 Right two use implicit Runge - Kutta method of second order to solve y dashed equals to 194 00:56:08,410 --> 00:56:39,980 x plus y y of point 4 is this with a step size h is equals to 0.2. Compute y of 0.6. 195 00:56:39,980 --> 00:56:46,240 So, These are some exercises for you you can try 196 00:56:46,240 --> 00:56:54,150 and then feel more confident on both explicit and implicit R K methods. However 197 00:56:54,150 --> 00:56:58,440 as I mention we discuss in detail what is an 198 00:56:58,440 --> 00:57:06,300 explicit method, when we proceed to multi step methods. So, let us wait for the lectures 199 00:57:06,300 --> 00:57:10,880 on multi step methods to hear more on implicit methods. 200 00:57:10,880 --> 00:57:19,230 Thank you until then bye. 201 00:57:19,230 --> 00:57:19,230 .