Numerical Solution of Linear Second Order Ordinary Differential Equations with Mixed Boundary Conditions by Galerkin Method

In this paper, the Galerkin method is applied to second order ordinary differential equation with mixed boundary after converting the given linear second order ordinary differential equation into equivalent boundary value problem by considering a valid assumption for the independent variable and also converting mixed boundary condition in to Neumann type by using secant and Runge-Kutta methods. The resulting system of equation is solved by direct method. In order to check to what extent the method approximates the exact solution, a test example with known exact solution is solved and compared with the exact solution graphically as well as numerically.


Introduction
The goal of numerical analysis is to find the approximate numerical solution to some real physical problems by using different numerical techniques, especially when analytical solutions are not available or very difficult to obtain. Since most of mathematical models of physical phenomena are expressed in terms of ordinary differential equations, and these equations due to their nature and further applications to use computers, it needs to establish appropriate numerical methods corresponding to the type of the differential equation and conditions that govern the mathematical model of the physical phenomena. The conditions may be specified as an initial Value (IVP) or at the boundaries of the system, Boundary Value (BVP) [1].
Many problems in engineering and science can be formulated as two-point BVPs, like mechanical vibration analysis, vibration of spring, electric circuit analysis and many others. This shows that the numerical methods used to approximate the solutions of two-point boundary value problems play a vital role in all branches of sciences and engineering [2].
Among different numerical methods used to approximate two-point boundary value problems in terms of differential equations are shooting method, finite difference methods, finite element methods (FEM), Variational methods (Weighted residual methods, Ritz method) and others have been used to solve the two-point boundary value problems [3]. Both in FEM and Variational methods the main attempts were to look an approximation solution in the form of a linear combination of suitable approximation function and undetermined coefficients [4]. , this method is known as the weighted-residual method. (3), then the special name of the weighted-residual method is known as the Galerkin method. Thus Galerkin method is one of the weighted residual methods in which the approximation function is the same as the weight function and hence it is also used to find the approximate solution of two-point boundary value problems [4]. The Galerkin method was invented in 1915 by Russian mathematician Boris Grigoryevich Galerkin and the origin of the method is generally associated with a paper published by Galerkin in 1915 on the elastic equilibrium of rods and thin plates. He published his finite element method in 1915. The Galerkin method can be used to approximate the solution to ordinary differential equations, partial differential equations and integral equations [5].

Galerkin Method
Many authors have been used the Galerkin method to find approximate solution of ordinary differential equations with boundary condition. Among this, a spline solution of two point boundary value problems introduced in [6], a method for solutions of nonlinear second order multi-point boundary value problems produced in [7], in [8] linear and non-linear differential equations were solved numerically by Galerkin method using a Bernstein polynomials basis, in [9] a numerical method is established to solved second order ordinary differential equation with Neumann and Cauchy boundary conditions using Hermite polynomials, in [10] a parametric cubic spline solution of two point boundary value problems were obtained, a second-order Neumann boundary value problem with singular nonlinearity for exact three positive solutions were solved [11], a Numerical solution of a singular boundary-value problem in non-Newtonian fluid mechanics were established [12], a Fourth Order Boundary Value Problems by Galerkin Method with Cubic B-splines were solved by considering different cases on the boundary condition [13] and a special successive approximations method for solving boundary value problems including ordinary differential equations were proposed. [14] In this paper Galerkin method will be applied to the linear second order ordinary differential equation of the form

Chebyshev Polynomial
The polynomials whose properties and applications are discussed in this paper were 'discovered' almost a century ago by the Russian mathematician Chebyshev. It is a function defined using trigonometric functions cosθ and sinθ for [ 1,1] Here the coefficient of n x in ( ) The figure 1 below shows the graph of the first seven Chebyshev polynomials for [ 1,1] x ∈ − .

Runge-Kutta Method for Second Order ODE
Runge-Kutta method is a numerical method used to find approximate solution for initial value problems. In order to use Runge-Kutta method to find an approximate solution of second order ODE, it needs to convert in to a system of two first order ODEs. For two evaluation of f the method is given by 1   , k=1,2, ...

Secant Method
x are two consecutive iterates. In this method there are two initial approximations 0 x and 1 x . This method is also called Secant method.

Mathematical Formulation of the Method
Consider a general linear second order differential equation with two type boundary conditions Type I: Type II: constants and * ( ) y x is unknown function or exact solution of the boundary value problem which is to be determined.
In a BVP with mixed boundary condition, the solution is required to satisfy a Dirichlet or a Neumann boundary condition in a mutually exclusive way on disjoint parts of the boundary. Now Consider the BVP of type II (Neumann type). To use an approximating polynomial defined for [ 1,1] x ∈ − the given BVP defined on arbitrary interval [a, b] must be converted into an equivalent BVP defined on [-1, 1]. So that the approximating polynomial should be defined on [-1, 1]. Since Chebyshev polynomial is defined on [-1, 1], it is possible to use Chebyshev polynomial after converting the BVP defined on arbitrary interval [a, b] into an equivalent BVP defined on [-1, 1].

Conversion of the Domain of the BVP
The differential equation in (5) together with the Neumann boundary condition can be converted to an equivalent problem on [-1, 1] by letting Then equation (4) with boundary condition is equivalent to the BVP given by Now equating the D. E in (4) with (6), Therefore, the DE in (5) with Neumann boundary condition is an equivalent BVP with the BVP in (6).

Applying Galerkin Method
To apply the technique of Galerkin method to find an approximate solution of (4), say ( ) y x , written as a linear combination of base functions and unknown constants. That is; Integrating the first term by parts on the left hand side of (10), that is Upon substitution of (11) into (10), yields But from equation (9) the approximate solution is given by Substituting this into equation (12) yields, In the left hand side of equation (13) above it needs to know the values of (-1) y′ and (1) y′ which approximately equal to (-1) y′ and (1) y′ respectively, where y is the exact solution of the BVP in equation (6).

The Resulting System of Equation
Since the values of ( 1) y′ − and (1) y′ are known from the boundary condition, substituting these values into (13), and equation (13) gives a system of n n × equations to solve the parameters thus equation (13) in matrix form becomes: Where (1) and Now, the unknown parameters are determined by solving the system of equation in (14) by direct method and substituting these values into (9) yields the approximate solution ( ) y x of the DE in (4) satisfying the given boundary conditions in (6). Consider a BVP of type I. In this case it is impossible to use the above method directly; since ( ) y a ′ is not given and hence instead it needs to convert the BVP in to type II. The conversion is made by using different numerical methods.
Consider to solve the following boundary-value problem: With boundary condition To do this, follow the steps below. Step1:-select 0 The guess for 0 z Step 2:-Now the objective is simply to solve for ( ) 0 z ψ = , hence secant method can be used.
Step 3:-How to compute z Suppose that the solutions 0 ( ) from guesses 0 z and 1 z respectively.
Step 4:-Now using secant method to find 2 z given by;      gives the following result for the 3 rd iteration.
The equivalent BVP for the above problem on 1 1 Now, using the given boundary condition in to (22), equation (22) becomes For equation (23) there is a system of equation given by: where and [ ]

T T T T T T T = and '
T is the transpose of T.
To find the value of the coefficient matrix in equation (24) use The graph of the exact and approximate solution, to look the convergence of the approximate solution to the graph of the exact solution, looks like figure 2 below. The above graph shows that the graph of the approximate solution approaches the graph of the exact solution for the differential equation with boundary condition in problem 1.
Considering n=8, then the approximate solution and the Chebyshev polynomials are given by:

[ ] T T T T T T T T T = and '
T is the transpose of T.
Using MATLAB code;  Approx. solution for n=6 (2) The graph of the exact and approximate solution, to look the convergence of the approximate solution to the graph of the exact solution, looks like figure 3 below.  As observed from table 5 the approximate solution is approaching to the exact value as the value of n increases. Take n=10, the graph of the corresponding approximate solution together with the graph of the approximate solution for n=6 and n=8 in the same plane with the exact solution is shown below.  As the number of Chebyshev polynomial increases the corresponding approximate solution of the differential equation with mixed boundary condition in problem 1 approaches the graph of the exact solution.

Conclusion
This study introduces that, by applying Galerkin method to linear second order ordinary differential equations with mixed and Neumann boundary conditions, it is possible to find their approximate solutions. The numerical results that are obtained using this method converges to the exact solution as the number of Chebyshev polynomial increases, that will be used as a trial function; and also using small step size h , while converting the given linear second order ordinary differential equation from mixed type to Neumann boundary condition, increases the accuracy of the approximate solution. So that using this method better results will be obtained as the number of Chebyshev polynomial increases and using small step size while using Rung-Kutta method.

Future Scope
This study has led to an attentiveness of several topics that require further investigation, for instance linear ordinary differential equations with different order, non-linear ordinary differential equations. In order to fill the gap in terms of accuracy it is important to analyze the error of the method. Thus analyzing the error and increasing the accuracy of this method is left for future investigation.