CHAPTER 05.04: NM SHOOTING METHOD: Example 2 of 4 

 

So let's go and take a few steps and see that how this all works out and see that what kind of value of y do we get. So eventually what our model is, our aim is to find out the value of y at x equal to 9 and to see that how far it is from the original boundary condition which is given at x equal to 9 which is y(9)=0. So if I'm going going to choose i=0, I am going to get y1 = y0 + f1( x0, y0, z0)*h and z1 = z0 + f2(x0, y0, z0)*h now let's go and see that what these values are. We know that x0=0, that's where we are starting from. We know that y0=0 because that's the value of y at x=0, and then z0, which is the value of the derivative of y at x=0, which is an assumed value which is 4. And we also know that h=3 because that is our step size which we have chosen. And we will also know what f1 and f2 are because that's what we derived just now. So we get y1 = 0 + f1(0, 0, 4)*3 and what is f1? f1 is nothing but z, so z, what is the value of z, 4, 4 times 3, so I get 12. So that's the value of y1. Let's go and see that what the value of z1 is. z1 = 4 + f2(0, 0, 4)*3 That's 4 plus, so what is the value of the function f2(0, 0, 4)? It's 2*y, which is the value 0, plus 8*x, which is 0, times (9-x) which is (9-0), times 3 and that just turns gives me 4+(0*3) because 2*0=0, 8*0=0, so I get just 0 from here and I get here 4. So that's the value of y1 and z1 at i=1 which means that x=3. So these are the values, so y1, which is y1, is the approximate, I should say y at x1 is the approximate value at y1, is approximately equal to y1 which is 12 and z at x1 is the approximate value of z1, is approximately equal to z1 which is equal to 4. And x1 is what? x1 is nothing but 3, x1 is nothing but 3. So that isn't, we never stop here. The reason we are not going to stop here is because we have to find y3 because that's what the value of y at x=9 is. So if we follow the same procedure this is what we are going to get. We are going to say i=1 now, we are going to get y2 = y1 + f1(x1, y1, z1)*h and z2 = z1 + f2(x1, y1, z1)*h Let's go and see that what arguments and what values need to go in here. We just said x1 is 3 because it is equal to x0+h which is 0+3 and that's what we get is 3, that's where this 3 comes from. And then we know that y1 we calculated from the previous step, not interation, previous step, which y1=12 and z1=4. So from there we will get y2 is equal to y1, which is 12, plus the value of the function being calculated at x1 which is 3, y1 which is 12, z1 which is 4, times 4, and since we know that f1 is nothing but z, that is just 4, 4 times 4, so that gives us 16+12 is 28. 16+12=28. Sorry, 4 times, this is, h is 3, h is 3. So it is 4 times 3 and that makes it 24. Assumingly, what is the value of z2? The value of z2 is z1 which is 4 plus the value of the function f2. The arguments are the same, 3, 12, and 4, times 3. So in this case what is f2, f2 is nothing but 2 times y, so it would be 2*12, plus 8 time x, which is 3, times 9-x which is 3, times 3. And this value here will turn out to be 4 plus 168*3 and we get 508. So what we have now is that the value of y at x2 is 24. The value of z at x2 is 508, which we just found out here and that's at x2 equal to 6 because we are at the step x2. So what we need to figure out now is that, hey, we need to find y at 9, but these are the values at 6 so these are approximately equal to. So we need to find out what the values of 6 is, so we need to conduct one more step. So let's see if we are going to conduct one more step what we get. So again, I am going to choose i=2, we are going to get y3 = y2 +f1(x2, y2, z2)*h z3 = z2 +f2(x2, y2, z2)*h Let's go and figure out what each of these parameters which we have in here, what we need to substitute in there. x2 is nothing but x1+h sorry x3=x2+h, x2 we just found out is 6, so 6 plus, no we need to put x2 in there right? We need to put x2 in there, so x2 will be equal to x1+h, x1 is 3, 3+3 is 6. We also know that y2 is 24 from the previous step. We also know that z2 is 508 from the previous step. So based on this we are now going to find what the value of y3 and z3 are, so y3 will be equal to y2, which is 24, plus the value of the function at these arguments of x2, which is 6, y2 is 24, and z2 is 508, times h which is 3. So we get 24, we know f1 is nothing but z which is 508 times 3, and this value here [24 + 508*3] turns out to be 1548. And now we are going to calculate, we don't need to calculate z3 because all we are is after y3, so what y3 is is the value of y at x3 which is approximately y3 which is 1548 which we just found out. So what you are finding out is that by assuming y'(0)=4, what you have obtained is y3=1548. That's what you are getting. Or I should say, let's just write it down here, by assuming y'(0)=4, what you have found is that y(9) is approximately equal to 1548, but what is y(9) actually? y(9) is actually 0 so what we need to do is we need to assume y'(0) to be something else so that we get a different value for y(9) equal to something which hopefully will be close to 0 and that's something which we will do in the next segment.