 Hi, we are learning numerical methods for initial value problem of first order ODE's. We have learnt Euler method, Rangikutta methods. We have also learnt some modified Euler methods. In the last class, we have derived midpoint method and the trapezoidal method. Midpoint method is a two step method and trapezoidal method is an implicit method. In this lecture, we will generalize these ideas and develop multi step methods involving explicit and implicit methods. Recall that we are interested in approximating solution of the initial value problem, y dash is equal to f of x, y where the equation is posed on a closed and bounded interval a, b and we are also given an initial condition y of x naught equal to y naught, where x naught is some point in the interval a, b. Generally, we take x naught to be equal to a just for the sake of simplicity. The first step towards developing a numerical method is to generate a partition for the interval a, b. Let us take it to be equally spaced partition with the step size as h given by b minus a by n. Thereby, we have n plus 1 node points which is also called grid points and they are given by x j equal to x naught plus j into h. The general form of the multi step method that we are interested in is given by this expression. You can see that here y j plus 1 which is the approximate value of y at the point x j plus 1 is given by the first term involving the linear combination of y j s and the second term involves the linear combination of the function value at x j comma y j s, where the function f is coming from our initial value problem. If we are interested in this, if you recall the Euler forward formula is given by y j plus 1 is equal to y j plus h into f of x j comma y j. You can clearly see that this method is also a particular case of this general multi step method, where a 1 is equal to 1 and all a k's are equal to 0 for k equal to 2 to m. Similarly, you can see that from this term b naught equal to 0, b 1 equal to 1 and all b k's are 0 for k equal to 2 to m. So, that gives us the Euler forward formula. If you carefully observe, you can see that the formula involves y j y j minus 1 up to y j minus m minus 1 and also f of x j minus from here, you can see that the formula involves the value of f at y j plus 1 y j and so on up to y j minus m minus 1, thereby you can apply this formula again only for j starting from m minus 1 onwards, whereas for first m minus 2 points, the value of the solution cannot be obtained from this method, whereas you have to use some lesser step methods, something considered or Runge-Kutta method to find y 1 y 2 up to y m minus 2, then y m minus 1 plus 1 onwards, you can go with this method. Recall that we have derived the midpoint method in the last class and it is given by y j plus 1 equal to y j minus 1 plus 2 h into f of x j comma y j, you compare this with the general form of the multi step method that we have given in the previous slide, you can see that we have to take a 1 equal to 0, a 2 equal to 1 and that will match the first term and similarly, b naught equal to 0 and b 1 equal to 1 to match with the second term of the general form and therefore, midpoint method is also a particular case of the general multi step method. If you observe Euler method is a 1 step method, whereas midpoint method is a 2 step method, the method that we have shown in this general form is a m step method for some given positive integer m. We are interested in particular in a class of methods called Adams multi step methods and these methods are written in the general form as this where you can observe that this is also a particular case of the general form that we have stated in the last slide and this form of the method is of interest to us. Here you can observe that when you take b naught equal to 0, recall that the first term b naught appears with f of x j plus 1 comma y j plus 1. So, if b naught is 0, then this term will not appear and you will have all the terms involved in this expression are known to us already from our previous calculation. In that way we obtained a explicit relation for y j plus 1. Such methods are called Adams bash forth method and they are basically explicit methods, whereas if b naught is not equal to 0, then the right hand side involves the function value evaluated at y j plus 1. In that way we have an implicit relation just like what we got in the trapezoidal rule and therefore, these methods are implicit methods and they are also called as Adams molten method. Let us see how to derive this Adams methods, again we will have to use the integral form of the given initial value problem and here you have to note that to derive Adams methods you have to take the limit in the integral as x j to x j plus 1. So, do not choose anything else you just have to take x j to x j plus 1 and thereby the integral equation is taken only in this form for deriving the Adams method. Now, how to derive the Adams method? You can see that we need to precisely get the values of b k right that is the only work involved in deriving Adams method of any particular number of steps. So, what you have to do is first decide the value of m and then you replace the integrand f of s comma y of s. Remember the integrand is basically a function of two variables, but since we know y in terms of x you can view f as function of x only and thereby you can construct an interpolating polynomial for the function f as a function of x at the grid points x j minus m plus 1 to x j plus 1 ok. So, once you are given these nodes and the function values for that you of course, need to know the function values then you can construct an interpolating polynomial and then say it is denoted by p of x then replace this integral by integral x j 2 x j plus 1 p of x d x or p of s d s ok. So, that is the basic idea of deriving Adams methods for Adams bash forth method remember we should not take x j plus 1 why because in Adam bash forth method which is an explicit method in the previous slide we have seen that explicit methods come with b not equal to 0 and therefore you do not need to include x j plus 1 as a node in your interpolation for Adam bash forth method and thereby the nodes for Adam bash forth method are taken as x j minus m plus 1 to x j only you do not need to include x j plus 1 because this is an explicit method on the other hand for Adams molten methods we need to have the node points starting from x j minus m plus 1 to x j plus 1. So, x j plus 1 is included in the nodes because Adam molten methods are basically implicit methods. Let us try to illustrate the construction of Adams bash forth method with three step means we are taking m is equal to 3 let us see how to derive the method in the case of m is equal to 3 we basically have to obtain the values for the coefficients b in the general expression. So, when you take m is equal to 3 Adams method in the bash forth form will be given like this note that you do not have b not f j plus 1 term here we do not have this we only have the explicit relation. So, thereby when you go for Adams bash forth method you have to take b not is equal to 0 in the general Adams expression and now we have to find this b i's where i is equal to 1 2 and 3 we do not need to find 0, but we have to find b 1 b 2 and b 3 b not is already taken as 0. So, how to obtain this well that is not very difficult what you do is you get the interpolating polynomial p 2 of x with grid points or node points as x j minus 1 x j minus 2 and x j and from there you take the integration of this polynomial to get the values of b i's remember these are given precisely as f j l not of x plus f j minus 1 l 1 of x plus f j minus 2 of x. Therefore, when you integrate you just have to integrate the Lagrange polynomials that is why we can see that this b i's are obtained as the integral of the Lagrange polynomials as I told we have to approximate the integrand by the quadratic polynomial interpolating the function f at the node points x j x j minus 1 and x j minus 2 and in the Lagrange form p 2 of s is given like this where l i's are the Lagrange polynomials. And now you can see that if you take the integral you have to perform these three integrals in order to get b 1 b 2 and b 3. So, in order to simplify our calculation we will use a change of variable formula where by we will change the variable s to u given by this expression with this you can see that the nodes x j x j minus 1 and x j minus 2 are transformed to 1 2 and 3 and thereby integrating the Lagrange polynomials becomes little easier if you use this change of variable formula that is why we are going for this with respect to the variable u the quadratic interpolating polynomial is denoted by p 2 tilde and that is precisely equal to p 2 of s which we want to actually use in our calculation, but just for the sake of easy evaluation of the integrals we are going for p 2 tilde with the variable u. Let us see how p 2 tilde looks like p 2 tilde is precisely f j into l naught tilde plus f j minus 1 into l 1 tilde plus f j minus 2 into l 2 tilde where l tilde are the Lagrange polynomials with respect to the variable u. And now you can also see that integral x j to x j plus 1 p 2 of s is precisely h into integral 0 to 1 p 2 tilde of u d u if you recall we want to replace the integral in our integral equation y j plus 1 equal to y j plus integral x j to x j plus 1 f of s comma x of s d s right. So, here we want to replace f by p 2 of s, but for the sake of simplicity we are now going to replace this integral here and thereby get a approximate value for our solution. Let us go to do that. So, we want to replace our original integral by this let us see how this integral looks like it is nothing, but h into f j into integral 0 to 1 l naught tilde of u plus f j minus 1 into integral 0 to 1 l 1 tilde of u plus f j minus 2 into integral 0 to 1 l 2 tilde of u right. So, let us evaluate these three integrals and see what they look like. Let us take the first integral integral 0 to 1 l naught tilde of u d u. Now you see the Lagrange polynomial is given like this it is more easy for us to integrate it because the grid points are now the integers and that can be easily evaluated and obtained as 23 by 12 it is not very difficult you can directly get it. Similarly, integral 0 to 1 l 1 tilde is given by minus 4 by 3 recall this is v 1 this is v 2 and similarly integral 0 to 1 l 2 tilde is given by 5 by 12 and that is v 3. So, we got v 1 v 2 and v 3 we can substitute these values to get the Adam Bashforth method which is a three step method for that we just have to replace the integral in our original integral equation by this quadrature formula now let us do that and that gives us v 1 equal to 23 by 12 v 2 equal to minus 4 by 3 and v 3 equal to 5 by 12 which gives us finally the three step Adam Bashforth method as this expression. So, it is not very difficult for us to derive this method similarly you can also get the Adam Bashforth method with step 2 3 4 and so on let us have some observations here you can see that y naught is of course given from our initial condition once we have this can we get y 1 from the three step Adam Bashforth method just observe that in order to get y 1 you need to take j equal to 0 in this expression that gives us y 1 equal to y naught plus h by 12 into 23 f of x naught comma y naught that is what is denoted by f naught here up to here it is ok no problem let us see the next step the next step is 16 times f of x minus 1 comma x minus 1 comma x minus 1 what is x minus 1 x minus 1 is nothing, but x naught minus h again you can see that x naught minus h is not in our domain of interest because we have only the interval a to b on which we have defined our initial value problem we always take x naught equal to a and therefore x naught minus h is lying outside the domain of interest right therefore we do not know whether y minus 1 exists or not even if it exists we have no interest to calculate it right therefore we cannot apply the three step Adam Bashforth method for computing y 1 because we do not know these terms similarly you can also cannot get y 2 because to get y 2 you can see that you have to put j equal to 1 and that makes this term to be f minus 1 right up to this it is ok, but this term is outside our domain of interest therefore even y 2 cannot be obtained from this method. So, what we have to do is we have to use some other one step method like Euler method or Runge-Kutta method to get y 1 and when you go to y 2 you may use a one step method or two step method to get y 2 and then y 3 onwards you can use the three step Adam Bashforth method ok. So, that is the idea of implementing the three step Adam Bashforth method now coming to the local truncation error we can see that the m step Adam Bashforth method is of order m if you recall we have seen that the forward Euler method is of order 1 whereas we have also derived Runge-Kutta method of order 2 and order 4 you can see that Adam Bashforth method with m step is of order m why it is so well it is not very difficult for you to see what we are doing in the derivation of the Adam Bashforth method we are replacing this function which is appearing as the integrand in the integral equation right we are replacing this by the interpolating polynomial and thereby we are committing an error which from the interpolating polynomial theory we call it as the mathematical error we can also call it as a local truncation error here and if you recall from theory of polynomial interpolations that the mathematical error involved in the interpolating polynomial is given by this expression here you can see that s belongs to the interval t j to t j plus 1 right therefore this is something like h may be less than h and this is something like some constant times h and similarly everything in this product will be some constant times h and therefore this product will be some constant times h to the power of how many terms are there here there are m terms therefore this contributes to h to the power of m thereby you can say that the function is approximated by the polynomial interpolating the function at some node points with the truncation error of order m right then what we are doing we are taking the integral of this function because in our integral equation this function is appearing with an integral over x j to x j plus 1 remember x j to x j plus 1 is the interval with length h right we have this integral plus the error that we are committing in this function this quadrature formula is of order already you have h m now when you integrate that error you are again accumulating one more h coming from the length of the integral over which we have taken the integral right so that contributes one more h here and thereby the integral will have the truncation error with order m plus 1 now if you recall in Euler forward method we had the truncation error of order 2 but we have seen that the method is of order 1 similarly when we derived the Runge-Kutta method of order 2 the truncation error was of order 3 ok so this is because when we go to find the order we are precisely taking the way we are approximating y dash when we go to approximate y dash we have to divide by h on both sides of the approximation right that will generally reduce the order of the method by 1 when compare to the truncation error right so the same idea goes here also you can see that the approximation that we have taken for the quadrature rule is obtained with the error of order m plus 1 therefore the truncation error is of order m plus 1 and that implies that the method will be of order 1 less that is m so in that way the Adams Bashforth method with m steps will be of order m this is a important point you have to keep this in mind now as I told you we have derived the 3 step Adam Bashforth method similarly you can also derive 4 step Adam Bashforth method even 2 step you can easily derive 1 step is trivial but if you go on like this 5, 6 and so on you can derive them these expressions are there in the literature however these calculations are little difficult we will not go to do any problem with Adams Bashforth method of order 5, 6 or so on maximum we will restrict ourselves to Adam Bashforth method with step 4 not more than that once you got the idea of how to derive the Adam Bashforth method you can also derive Adams molten method similarly the only difference is that you have to include 1 more grid point that is node point x j plus 1 and thereby you will be constructing a polynomial of degree 1 greater than the degree that you had with Adam Bashforth method otherwise the derivation goes exactly the same as we have illustrated in the 3 step Adam Bashforth method you can easily derive the Adams molten method with step 1, 2, 3, 4 and so on you can also go on but we will only restrict ourselves to maximum 3 or at most 4 ok we will not go more than that of course from the examination point of view we will not go more than 2 because it is very difficult for us to remember these formulas and even in the Adams Bashforth method we will not go more than step 3 in the examination and coming to the order of Adam molten methods you can see that the order of the Adams molten method will be 1 more than what step you have taken say for instance 2 step Adam Bashforth method will be of order 3 similarly this will be of order 4 that is the 3 step Adam molten method will be of order 4 and so on why it happens like that because if you recall in the Adam Bashforth method we approximated the integrand F by the interpolating polynomial of degree P M minus 1 right whereas here you will be adding one more node x j plus 1 and thereby you are approximating the integrand by the interpolating polynomial of degree P M right so in that way the truncation error of the Adam molten method will be of order M plus 1 and therefore the order of the method will be 1 less that is M plus 1 that is how the Adam molten method just because it is implicit you have to include one more node point into your polynomial construction and that will increase one order in the Adam molten method. Now let us illustrate the predictor corrector method using the Adam Bashforth and Adam molten method in this what you have to do is first you have to fix the M value which will tell what is the step that you are taking in Adam Bashforth method and then you have to go and choose one step less in the Adam molten method because if you take M step method in the Adam Bashforth method thereby you get the order M in the explicit form to match that with the Adam molten method you have to take one less because Adam molten methods order is one greater than its step because of the implicit term right so that is the important point you have to keep in mind. So, use one step method of order at least M and compute y 1 y 2 up to y N minus 1 remember since we are fixing M step method you cannot use Adam Bashforth and similarly Adam molten method for computing the values of y at first M minus 1 grid points right therefore, you have to go for some one step method it is better to choose a method which is of order M something like Runge Kutta method of higher order you can take to compute these values once you have these values then to compute y j plus 1 for j equal to M minus 1 and so on. You will now go with the predictor character approach if you recall in the last class we have introduced the predictor character approach for the trapezoidal method right the same idea will go on here what you do is first find y j plus 1 using the Adam Bashforth method there is no problem in doing this because Adam Bashforth method is an explicit method you have an explicit formula for y j plus 1 once you obtain the value of y j plus 1 from the Adam Bashforth method you denote it by y j plus 1 star and this is the predictor step once you have the predicted value of y j plus 1 you plug in that on the right hand side of the Adam molten method remember Adam molten method is an implicit method therefore, you have y j plus 1 term on the right hand side also right. So, substitute this predicted value on the right hand side of the Adam molten method and get y j plus 1 that is the character step in our predictor character method. So, this is the procedure you have to follow for the predictor character method let us just illustrate it with M is equal to 4 remember to implement a predictor character method you first have to decide what is M let us fix M as 4 once you fix M you first go to the table given for Adam Bashforth we have fixed it as 4 therefore, you have to take this formula for the predictor step that is what I am writing here the predictor step will have this formula and for the character step sorry this is character step for the character step you have to take the 3 step Adam molten formula right in order to match the order you have to take 1 step less that is you have to take the 3 step Adam molten method and that is given by this formula so that will give you this formula where the first term that is the implicit term is now obtained by plugging in the predicted value here and thereby the right hand side now becomes explicit. So, you can get y j plus 1 without going for any non-linear iterative method so that is the idea of predictor and character method so there is also another important class of methods called backward differentiation method remember backward differentiation method can also be obtained by approximating the function f by a corresponding interpolating polynomial only thing is in the Adam's method we will use the polynomial interpolation of f to approximating the integral right. So, we will use the polynomial approximation to approximate the integral in the interval x j to x j plus 1 ok. So, that is approximated by x j to x j plus 1 p of s d s right that is for the Adam's method whereas, in BDF method we will approximate the unknown function y by the polynomial and then we will differentiate p dash and use this as an approximation in our equation. So, that is the idea we will go for the interpolating polynomial for the function y of x at these node points for some given m and then replace y dash by p m dash and that gives us a general expression like this recall what we had the general expression for m step methods it is given like this where the first term is given as it is whereas, the second term is taken with B naught not equal to 0 whereas, B 1 equal to B 2 equal to everything else is equal to 0. So, that gives us BDF method whereas, if you recall Adam's method general form is given like this where a 1 is not equal to 0 whereas, a 2 equal to a 3 equal to everything else is 0 whereas, B's are kept as it is ok. So, similarly you can also get this a k's and B naught by just replacing y by the corresponding interpolating polynomials, but we will not give any weightage for BDF methods in our course with this we will end this lecture. Thank you for your attention.