Hello and welcome to lecture 5 of module 7. We have been considering numerical methods for solving ordinary differential equations, the initial value problems in this particular module. So far we have covered the Runge Kutta family of method and specifically we have covered RK2. and RK4 methods. In the RK2 method what we do is we write our yi plus 1 equal to yi plus h times slope where slope is computed as sum of two slopes k1 and k2. So, I will write this as h times w1 k1 plus w2 k2 that is the RK2 method.
is the function f, which is the function f of and the other one is the same. So, this is the same as the previous one, but this is the same as the previous one. So, this is the same as the previous one, but th So, we have to consider the following questions, which are So, this is the weight the first row.
So, this is going to be the representation for R k 2. Now, the R k 4 method is going to be the representation for R k 2. So, R k 2 is going to be the representation for R k 2. Now, R k 2 is going to be the representation for R k 2. So, R k 2 is going to be the representation for R k 2. Now, the R k 4 method is going to be the representation for R k 2. So, R So, what we are going to do is, we are going to write the equation for the mass also as before. So, what we are going to do is we are going to write the expression for the value of k 2 comma T i plus T 3 multiplied by h and k 4 is f of y i plus h multiplied by q 4 1, k 1, q 4 2, k 2, q 4 3, k 3. So, now, we have our k 1, k 2, k 3 and k 4 for our R k 4 method and in R k 4 method, the same kind of a table will have w 1, w 2, w 3 and w 4 and then instead of having just one row above this particular guy, we will have three rows above this guy p 2, p and the other one is the RK4 method. Let us start from essentially the overview of this particular module.
In the RK family of method, we have considered the RK2 and RK4 as higher order methods. RK3 method is also there and usually it is RK2, RK3 and RK4 methods that are typically more popular with RK4 being the most popular. And the reason for that is better accuracy of RK4 method compared to RK4. the the So, this is the general formulation of the problem. So, this is the general formulation of the problem.
P2, P3 and P4 are the slopes in computing T i plus H multiplied by P, these are the P values and Q values are the weights that are used in computing the intermediate y points using the RK method. For example, the classical RK method was P2 was equal to half, P3 was equal to half and P4 was equal to 1. Q 2 1 was also equal to half in and then for computing k 3 we had used only k 2 we had not used k 1 at all. So, therefore, Q 3 1 was 0 Q 3 2 was half and p 3 was half.
So, if you recollect what we did was we computed the slope at the initial point then we computed the slope at midpoint, midpoint means the weights are going to be equal to half. So, we have to do the same thing, So, this is the equation for the So, this is the classical Runge-Kutta fourth order method, various different people have since devised different methods for computing. So, this is the first step of the analysis of the RK-GIL method.
The second step is to find out the error of the RK-GIL method. The third step is to find out the error of the RK-GIL method. The fourth step is to find out the error of the RK-GIL method. the weights that are obtained for the RK Gill method perhaps is one of the most popular RK 4 methods when it comes to non-adaptive RK 4 methods.
And finally we have the Runge Kutta Fehlberg method, the Runge Kutta Fehlberg method comes under the category of embedded RK methods and the embedded RK methods I will cover very briefly in the next lecture. So, this is the RK method, So, this is the way to do it, So, now to summarize what we get with the RK4 method, what I have done is I have used the solution using the RK4 method using the previous solver that we had developed, recall that we had developed this particular solver using the RK4 method and what I did was I changed H equal to 2.5. So, what we are going to do is we are going to do a simple problem solving. So, what we are going to do is we are going to do a simple problem solving and we are going to do a simple problem solving. So, what we are going to do is we are going and the midpoint I have showed the midpoint because in computing the classical RK 4 method we are going to use projections at the midpoint.
So, we will start at this particular point and compute K 1, so the K 1 is computed at the point shown by this black circle, so K 1 is the midpoint of the RK 4 method. So, this is the midpoint of the RK 4 method, and then we project along this slope up to the midpoint okay to compute our k 2 keep in mind the k 2 was computed at f of i plus half for time t and f of i plus half for time t and k 2 was computed at f of i plus half for time t and and the other one is the the slope of is the slope k 2 and using the slope k 2 we are going to project over here in order to get our k 3, k 3 again is obtained at the midpoint. So, we take this particular arrow this slope is unchanged and we will just bring it back to the point t i comma y i and then project it to the midpoint. So, the t point t i comma y i is projected at the midpoint and that we will get as k 3 and the k 3 is f computed at the midpoint.
So, this is the point t i comma y i and this is the point t i comma and the value of and then we will compute the slope at that point t i plus 1. So, this is the point at which we will compute our fourth slope which will be given by this green line. So, this is the slope computed at this particular guy k 4 computed at i plus 1. So, this is the and the other one is the two multiplied by by k 2. and the final slope is the final slope of the So, we have seen that the and the slope is the slope of So, we have to do the same thing for the other two variables, and the value of and the value of and then we will have the same thing for the other two terms, so the slope of A predictor corrector form of Juhn's method which is exactly the same as the RK2 method, but there is no need to stop at this point. This is going to be the average of the two slopes, the average of the red line over here and the black line over here is shown by this particular thin line.
Now, this thin line we can use to project once again to get y bar i plus 1 2. and the slope is going to be the same as the slope of the previous slope. So, we have to compute the slope of the slope at this point, we project it back that the slope computed at this point, discard the red lines which represent the slope at this point, and we compute the slope at this point. So, we have to compute the slope at this point, the first iteration, so now we have the character form for the second iteration, now we have this black line and this blue line and we can get the average of the black and blue line and we can keep repeating this again and again multiple number of times in order to get the Eun's method, the predictor character.
So what I have done is I have shown you the Eun's method in the predictor character form. So, this is the general RK2 method, which is the one which is used for the prediction of the RK2. So, we will get this as h by 2, k 1 was nothing but f computed at y i comma t i and k 2 is f computed at y i plus 1 multiplied by h k 1. That was what Ewan's method was, our q 2 1 and our p 2 were both equal to 1. So, we will get this as h by 2, k 1 was nothing but f computed at y i comma t i and k 2 was nothing but f computed at y i plus 1 multiplied So, what we do is we call this particular guy, we call this as a predicted value.
So, this is going to be our k 2. So, now, what we do is we call this particular guy, we call this as a predicted value. So, this is going to be our k 2. So, now, what we do is we call So, this is the first step, we will go through this and then we will go through the second step, which is the second step, which is the third step. So, this is the third step, which is the fourth step, which is the fourth step, which is the fifth the Eun's method predictor character with the character used once only. Now the predictor character form of Eun's method where we use the predictor, the character multiple times is what I am going to write now. So, the first thing to do is to derive the predicted value.
So, first item in our agenda is to choose the predictor which uses the value k 1 only. So, our predicted value y i plus 1 bar i plus 1 bar is equal to k 1. So, k 1 is the predicted value of the value y i plus 1 bar i plus 1 bar. So, k 1 is the predicted value of the value of the value So, what we are going to do is we are going to take the value of the value of the value So, this is the same equation that I have written in a slightly different form over here. Now, let us look at the corrector form of the equation. Corrector was nothing but a trapezoidal rule that we use.
the function f as function just of the time t. Likewise, the corrector form is going to be implementation of trapezoidal rule. In the corrector form, what we do is y i plus 1 corrected, so y i plus 1 is the function f of the time t.
So, we have the function f of the time t, which is the function f of the time t. So, we have the function f of So, what is the slope of and t i plus 1. So, I will write that down over here. So, h by 2 multiplied by f of y i comma t i plus f at y i plus 1 bar 0 comma t i plus 1. Now, if we stop at this point, the result that we get from and then we will have a new function called the variable variable. So, this is the variable variable which is used to define the variable variable. So, th So, what we are going to do is we are going to write the equation for the first time, which is the first time we have written the equation for the second time.
is the slope that is computed at the initial point. So, this means it is a slope computed over here. y bar 0 is the slope that is computed over here.
So, this is the slope that is computed over here. So, this is the slope that is computed over here. and the other one is the point of the slope.
So, this is the slope of the slope and this is the slope of the slope. So, and the other one is the one that is and this is the average slope. So, this is the average slope, this is the average slope and this is the average slope. So, this is the average slope and is the slope computed over here and that red arrow is going to be the slope computed over here and that red arrow is this particular guy.
So, then I will get I will draw this red arrow and So, this is the average slope of the is the second time I have used the character, I will use the character third time, fourth time and so on and so forth, I will use it recursively in order to get better and better guesses. So, the recursive use of this character means that this guy has to be replaced by appropriate quantity. So, we will replace this with m plus 1 equal to yi plus h by 2 i ti plus and the other one is the the vector vectorization.
So, we have to do the same thing with the So, we are going to use the character equation five times. So, we will use the predictor equation once, we will use y y 0 in order to compute y bar 1, y bar 1 we will use to compute y bar 2, y bar 2 to y bar 3, y bar 3 to y bar 4 and y bar 4 to compute y bar 5. When we reach y bar 5 that is when we said that the solution So, this is the idea behind the predictor character method, we will take up predictor character methods once again in the last lecture of this module, when I very briefly I am going to cover some of the more advanced methods and why this idea of predictor character method. So, in summary what we have covered so far is we have covered RK methods, we have covered the error analysis of RK methods and we have covered the predictor character methods.
The error analysis of the predictor character methods is fairly straight forward, this is nothing but an Euler's explicit method. the error for the predictor equation is that its order of h squared whereas the corrector equation is kind of like using the trapezoidal method and because it is kind of like using the trapezoidal method. So, this is the error of the order of h cube, this error is of the order of h square.
Now, why is this particular method actually useful? The reason why predictor character methods are useful is because, and the other one is the total 1 is changing compared to y bar m plus m. So if we go from y bar 0 to y bar 0, we have and the error is very small, then if we are going to substitute that in this particular equation, the equation that we are going to get is y bar m plus 1 plus 1 minus is equal to yi plus h by 2 multiplied by f of yi comma ti plus f of y bar m i plus 1 comma ti plus 1. If m is large enough, we replace the yi by t by m. So, we have a very simple solution.
We have a very simple solution. We have a and the other one is the same. So, this is the same as the previous one, but this is the same as the previous one. So, this is the same as the previous one, but this is the same as the previous one. So, th h by 2 multiplied by f of y i comma t i plus f of y i plus 1 bar comma t i.
Keep in mind that this bar just represents a dummy type of variable. Now, if you see this particular equation, this equation is if you recollect something that we did in So, this is the first step, which is the first step, which is the first step, which is the second step, which is the third step, which is the fourth step, which is the fifth step, So, this is the first step, which is the second step, which is the third step, which is the third step, which is the fourth step, which is the fifth step, which is the fourth step, which is the fifth step, which is the fifth step, which is the fourth step, which is the fifth step, which is the fifth step, which is the fourth So, what we are going to do is we are going to convert that RK2 method into a predictor corrector Ewan's method. So, what we are going to do is we are going to convert that RK2 method into a predictor corrector Ewan's method.
So, what we are going to do is we are going to convert that RK2 method into a predictor corrector Ewan's method. So, this is what we do in order to use the predictor corrector Ewan's method. Now, instead of stopping at the first value, we are going to stop at the second value. So, this is what we are going to do.
So, we are going to use the predictor corrector Ewan's method. Now, we are going to use the predictor corrector Ewan's method. So, we are going to use the is the non-linear equation of this type.
We have solved this equation using the fixed point iteration method, the method of successive evaluations. So, if we actually do that we will get crank Nicholson method. So, this is the non-linear equation of So, what we are going to do is we are going to take the number of iterations, we are going So, this is the first step, the second step is to get the RK2 method. So, this is the first step, the second step is to get the RK2 method.
So, this is the first step, the third step is to get the RK2 method. So, this is the first step, the fourth step is to get the RK2 method. So, this is the first step, the fifth step is to get the RK2 method. So, this is the first step, the sixth step is to get the RK2 method. So, this is the first So, the question comes is, what is the accuracy of the RK 2 method?
So, the RK 2 method is the same as the RK 2 method, but the accuracy of the RK 2 method is higher than the RK 2 method. So, the RK 2 method is the same as the RK 2 method, but the accuracy of the RK 2 method is higher than the RK 2 method. So, the accuracy of the RK 2 method is higher than the RK 2 method.
So, the question comes is, what is the accuracy of the RK 2 method? is, what do we mean by stability? So, we have a very simple question, which is, what is the probability of a So, let us again go back to the Microsoft excel and try to see what we actually mean by stability. So, now let us consider what we mean by stability, what I have done over here is from the same excel sheet that we have been looking at in the past few lectures, I have opened up the same Euler's explicit method sheet. So, this is where we computed the So, what we are going to do is we are going to use the Euler's method, we are going to use the Euler's method to compute the solution for V equal to 5, given that concentration C 0 equal to 1. What we had seen is as we decrease the value of our step size H, we get more and more accurate results.
Likewise, as we increase the value of our step size, equal to 1. Let me increase this to h equal to 1.5. What happens when we increase this to h equal to 1.5? What I will do is I will just take this figure a little bit away so that it does not distract us from our discussion.
So, what happens when we go from h equal to 1 to h equal to 1.5 is that the error that we get increases. So, this is the first step, the second step is to find out the error. So, the first step is to find out the error, the second step is to find out the error, the third step is to find out the error, the fourth step is to find out the error, the fifth step is to find out the error, the sixth step is to find out the error, the seventh step is to find So, this is the first step, the second step is to find out the value of the concentration of the volume.
So, the first step is to find out the value of the concentration of the volume. So, So, this is the problem, this is the problem of and if we go to h equal to 2 to h equal to 2.1, this is what we observe. What we observe is quite clearly that the concentration goes to a negative value and beyond that our method cannot proceed.
The reason why the method cannot proceed is because the concentration to the power 1.25, it is a fractional power as a result of the fractional power because we get negative concentration, we are not able to proceed further. So, what we will do is we will go back to h equal to 0.5 and let us see what happens. Now let us consider the case where we have f to the power 1 instead of f to the power 1.25.
So, we have f to the power 1.25 and we have f to the power 1.25. So, we have f to So, what we are going to do is we are going to take the value of and the true values are also going to change. True values are going to be for the first order reaction, basically the true values are going to be e to the power minus t by 2. So, with this particular change, what we have is d c by d v. d c by d v is going to be equal to minus 0.5 into c.
So, what we can do is d c, we can write this as d c divided by c is going to be equal to minus 0.5 into d v. So, this is the the So, this is the value of the concentration, so this is the value of the concentration and this is the value of the concentration. So, and the error is the same as the error of the previous one. So, the error is the same as is the concentration of the liquid. So, this is the concentration of the liquid, and this is the concentration of the liquid. So, this and then we will have the same thing in the next class.
So, we will have the same thing in the next class. So, we will have the same thing in So, this is the first step, so this is the second step, so this is the third step, so this is the fourth step, so this is the fifth step, so this is the sixth step, so this is the seventh step, so this is the seventh step, so this is the eighth step, so this is the fourth step, so this is the fifth step, so this is the sixth step, so this is the seventh So, what is the solution for this? What I have said over here is implicit methods are more stable, we are investigating what it means by stability.
So, what happened, what we saw over here is we were, if we were to plot the concentration C against the volume, the numerical method for getting concentration C against the volume if we were to use say h equal to 1. we will perhaps get the results something like this. If we were to use h equal to 2, we will get perhaps the result going something like this. When we used h equal to 2, we got So, this is the first step, we have to do is to find out the value of the type of results that we got when h was equal to 4. So, this is the curve that we got when h was equal to 4. Now, what do we get when h is increased to beyond 4? What we get when h is increased to beyond 4 is this particular value goes beyond minus 1. So, what we are going to do is, we are going to take the value of h, we are going to take the value of h plus 1, So, we have a problem here, and plus infinity as v tends to infinity.
This is known as an unstable solution. So, I am going to end the lecture over here in this in the lecture 5 of this module I am going to end over here. In the next lecture, I am going to consider the stability issues.
Specifically, I will talk about the equation. So, the equation that we had d c by d v was equal to minus c by 2. For this particular condition, we saw that when h becomes equal is greater than 4 at that time the explicit Euler's method becomes unstable. We will do some theoretical analysis of this particular condition to find out under what conditions do the explicit Euler's method becomes unstable. is the condition for which explicit Euler's method becomes stable is going to be when H is greater than 2 divided by the coefficient of this term. When that H is greater than 2, then the condition for which explicit Euler's method becomes stable is going to be when H is greater than 2 divided by the coefficient of this term.
the H is greater than 2 divided by 1 by 2 that is when the explicit Euler's method is going to be unstable. That is something that we are going to start off in the next lecture in this particular module. Thank you.