CHAPTER 08.04: FINITE DIFF METHOD FOR ODEs: Example Part 2 of 2
Now, this is the equation at any node. I already know what the values of the, value of y are at node 1 which is 0 and I already know the value of the node, of y at node 4 which is 0. So all I need to do is I need to write down this equation for i equal to 2 and i equal to 3. So when I write down the equation for i=2 I get [[y_3 - 2(y_2) + y_1]/(25)^2] - (2*10^-6)y_2 = 75*10^-6(75-25) [y_3 - 2(y_2) + y_1]/(25)^2 - (2*10^-6)y_2 = 75*10^-6(75-25) [y_3 - 2(y_2) + y_1]/(25)^2 - (2*10^-6)y_2 = 75*10^-6(75-25) [y_3 - 2(y_2) + y_1]/(25)^2 - (2*10^-6)y_2 = 75*10^-6(75-25) [y_3 - 2(y_2) + y_1]/(25)^2 - (2*10^-6)y_2 = 75*10^-6(75-25) The value of node x_i, which is x_2 is 25 because that's the value of node at x_2 times (75-25) because that's the value of the node x_2. So it's very important to understand what needs to be substituted and how we are substituting these of a particular node. So same thing, I'm going to use for i=3. I am going to write down the same equation for i equal to 3. So this general equation which I have here, this general equation which I have here, I am going to write for i equal to 3, which means that I substitute node i=3 there. I get: [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) [y_4 - 2(y_3) + y_2]/(25)^2 -(2*10^-6)y_3 = 75*10^-6(50)(75-50) So I have to be careful about what I substitute for the proper values of x and so on and so forth. So I have basically, first equation, last equation, second equation, third equation, so I write down the equation, so this is going to give you the equation for the first node, the equation for the second node, the equation for the third node, and the equation for the fourth node and that's how I'm going to write down my equations. So when I write down these equations in matrix form, this what I get for my coefficient matrix, so I have four unknowns; y_1, y_2, y_3, y_4 and then I'll have certain right hand sides. I already know that the first equation is y_1=0 so I get 1, 0, 0, 0 and of course it is 0 at that particular point and the last equation would be the equation for the last node, again y_4=0 so the other two equations which I will get by making the calculations, I get 0.0016, -0.003202, 0.0016 and then 0. And here I get 0, 0.0016, -0.003202 and 0.0016. So that's what I get as my, as my four four equations, four unknowns. The right hand side here is 0.9375 and 0.9375 here. So I have four equations, four unknowns. Again, you got to realize that you have four equations, four unknowns. This is a tridiagonal system of equations and also this is a diagonally dominant system of equations, so you do need to figure out what does that help us. The tridiagonal system of equations will help us to directly use Thomas's Algorithm to be able to solve this set of equations.Since this particular matix is diagonally, the coefficient matrix is diagonally dominant that's also going to help us to be able to use iterative methods and be guaranteed a solution. So the solution turns out to be y_1, y_2, y_3, and y_4 is equal to, of course we know that, first one will be zero, last one will be 0 because those are the boundary conditions and this turns out to be -0.5852 and -0.5852. So those are the deflection which you get at node 2 and node 3. You can solve this particular differential equation exactly. The value of y at 25 because that's the value at y_2, let's suppose, is, is y_25. So y(25) is same as y_2, y_2 is same as y(25) is exactly equal to -05365, so I am going to leave this as homework that use your ordinary differential equation knowledge which you have learned and be able to find out what the exact solution to this particular problem is. So it turns out that the value of y at 25 turns out to be -0.5365 and the corresponding true error to that will be 9.07%. So it will be up to you to now maybe break the segments between 0 and 75 into more segments and see that whether you are able to get closer to the exact value of, let's suppose, y at 25 and other points which are there because once you find the exact solution you will be able to find the value of y at any point you are interested in but specifically for this case, are you able to reduce the amount of true error by choosing more segments for the length of 75 inches. And that's the end of this segment. |