APPLICATION OF VARIATIONAL METHODS AND IN SOLVING PROBLEMS REPRESENTED BY ORDINARY DIFFERENTIAL EQUATIONS

1B.V. SIVA PRASAD REDDY, 2K. RAJESH BABU

1,2Department of Mechanical Engineering, Sri Venkateswara University college of Engineering, Tirupati, India E-mail: [email protected], [email protected];

Abstract – Nowadays the accuracy of problem solving is very important. In olden days the Variational methods were used to solve all engineering problems like structural, heat transfer and fluid problems. With the emergence of (FEM) those methods are become less important, although FEM is also an approximate method of numerical technique. The concept of variational methods is inducted to solve majority of engineering problems, which gives more accurate results than any other type of approximate methods. The engineering problems like uniform bar, beams, heat transfer and fluid flow problems are used in our daily life and they play an important role in the development of our society. To achieve drastic development in the society, it is a must to focus on adopting approximation methods that improve the accuracy of engineering solution. Of all the methods, Galerkin method is emerging as an alternative and more accurate method than those of Ritz, Rayleigh – Ritz methods. Any physical problem in nature can be transformed into an equivalent mathematical model by idealization process and describing its behavior by a suitable governing equation with associated boundary conditions. Against this backdrop, the present work focuses on application of different variational methods in solving ordinary differential equations. The reason behind choosing second order (ODE) is that most of the structural and heat transfer problems can well be represented by an ODE. As an illustration the work herein reported highlights the utility of above cited methods with a simple bar problem. Furthermore the numerical part of this work is carried out on a MATLAB platform.

Keywords— Variational methods, Second order differential equation, elastic bar, Ritz method, Rayleigh – Ritz method, Galerkin method and MATLAB

I. INTRODUCTION problems. The Robert D. Cook and David S. Malkus [2] are introduced variational methods on The objective of this research is to evaluate and engineering problems. J. N. Reddy [1], The Robert examine the variational methods like Ritz, Rayleigh D. Cook and David S. Malkus [2], S. S. Rao [3], O.C – Ritz and weighted residual methods like Galerkin Zienkiewicz, R.L. Taylor & J. Z. Zhu [4] are used methods based on MATLAB. these principles to Finite Element Method in Solutions for field problems are widely used engineering applications. Recently the Sanjay mathematical tools in engineering analysis. These Govindjee [5] introduced the variational methods methods are applied in such areas as the analysis of solving with the MATLAB software. solids and structures, heat transfer, fluids and almost Any physical problem in nature can be transformed any other areas of engineering analysis. The into an equivalent mathematical model by variational methods are introduced to solve the idealization process and describing its behavior by a Engineering problems around 1820. The variational suitable governing equation with associated method was first used by Lord Rayleigh in 1870. boundary conditions. Some real engineering However, the approach did not receive much problems are shown in the following figures. recognition by the scientific community. Nearly 40 years later, due to the publication of two papers by Ritz, the method came to be called the Ritz method. To recognize the contributions of both men, the theory was later renamed the Rayleigh – Ritz method. The Ritz method proposed by the Swiss Walther Ritz in between 1878 to Fig 1 Beam having transverse load 1909. After that the Galerkin method is proposed by Russion mathematician “Boris Galerkin” in 1915. The Galerkin method is one of best method of weighted residual method. In the Galerkin method, it only requires that the residual of the differential Fig 2 A cantilever beam clamped at one end equation be orthogonal to each term of the series that satisfy the boundary conditions. These methods are In the present study we have chosen a simple second discussed in much research paper to apply on order differential equation, whose solution is sought different engineering problems. The J. N. Reddy [1] by different variational methods which include Ritz, was applied on his book to solve bar, beam Rayleigh – Ritz and Galerkin method. All of these

Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 36 Application of Variational Methods and Galerkin Method in Solving Engineering Problems Represented by Ordinary Differential Equations methods seek an approximate solution in the form of III. ANALYSIS OF 2nd ORDER ODE BY a linear combination of suitable approximate APPROXIMATE METHODS function, preferably power series. The parameters or coefficients are determined such that the approximate The given second order ODE has been analyzed by solution satisfies weak or variational form or adopting Ritz method, Rayleigh – Ritz method and minimizes the quadratic functional of the equation Galerkin method for one and two – parameter (as in Rayleigh – Ritz method) under study. Various approximation. The corresponding results were methods differ from each other in the choice of the tabulated and illustrated as detailed below. And also approximate functions. the comparisons of those results with exact results In addition an elastic bar subjected to uniformly were shown below. distributed load is also analyzed and solved for displacement field by Galerkin method. The 3.1 Solution by Ritz Method approximate solution so obtained is validated by a Governing equation suitable numerical data. The following sections will − − + = 0 For 0 < x < 1 briefly highlight the various variational methods to be adopted in solving the selected governing Boundary conditions u (0) = 0, u (1) = 0 equation and an elastic bar problem. The given governing equation is in strong form. In II. CHOSEN SECOND ORDER GOVERNING Ritz method first of all strong form is converted into EQUATIONS weak form. Then the governing equation written as ∫ ∗ [− − + ] = 0 The following governing equation is selected for its − ∗ + ∫ ∗ − ∫ ∗ + analysis by different variational methods like Ritz, Rayleigh – Ritz method and Galerkin methods. ∫ ∗ = 0 A. − − + = 0 For 0 < x < 1 SET: 1 Boundary conditions u (0) = 0, u (1) = 0 The above weak form can be expressed as leaner and ( ) bilinear forms (, ) = (). Bilinear form of SET: 2 Boundary conditions 0 = 0, = 1 above equation B (w, u) = ∫ ∗ − Exact solution of second order ODE for set:1 boundary condition ∫ ∗ and linear form is L (w) 2 sin(1 − x) + sin x () = + ( − 2) = − ∫ + ∗ sin 1 Exact solution of second order ODE for set:2 To get solution in Ritz method select approximate boundary condition equation with satisfy above boundary conditions 2 cos(1 − x) − sin x conditions ɸ = (1 − ) , which is the simplest () = + ( − 2) cos 1 function satisfying the boundary conditions The following governing equation is selected for its analysis by Galerkin method = C(1 − ) + C (1 − ) involving two different approaches that include + … … … . +C (1 − ) formulation by variational method and weighted residual method. This equation also governs an By substituting approximate function (w, u) elastic bar element subject to uniformly distributed becomes load and end load as well. ɸi ɸ , ɸ = ∗ ( C ɸ ) L P

− ɸ ( C ɸ) A, E q = Cx ɸ ɸ = ∑ C ∫ ∗ − ɸ ∗ ɸ this is also Fig 3 Uniform elastic bar, loaded by axial tip force called stiffness matrix D and linear term ɸ = The above physical modal is converted into mathematical governing equation as bellow − ∫ ɸ this is a force matrix F. B. + = 0 For 0 < x < L The algebraic equations can be expressed in matrix Boundary conditions are u (0) = 0, = from [D]{C} = {F} by solving this the coefficients of Exact solution of 1-D elastic bar approximate function (,,……., ) are obtained.. 3 − + 6 () = 6

Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 37 Application of Variational Methods and Galerkin Method in Solving Engineering Problems Represented by Ordinary Differential Equations

Table 1 Ritz coefficients values for one and two − ∗ + ∫ ∗ − ∫ ∗ + parameter approximation ∫ ∗ = 0 The above weak form can be expressed as leaner and bilinear forms B (w, u) = ∫ ∗ − ∫ ∗ L (w) = − + [] ∗ 1 ∫ The functional is () = (, ) + () These coefficients are finally submitted in approximate function, one can get the desired () = ∫ − − 2 + (1) approximate solution To get solution in Rayleigh – Ritz method, select an approximate function which will satisfy above Table 2 Ritz field variable’ u’ at various points for boundary conditions ɸ = , which is the simplest one and two parameter approximation function satisfying the boundary conditions. = C + C + … … … . +C

Substituting in functional

The necessary condition for the minimizing of  ()  functional “I” is that Apply = 0 , =   ɸ ɸ ∫ 2 ∑ − 2ɸ ∑ ɸ − 2ɸ + (1) = 0 From above equation the bi – linear and linear terms ɸ ɸ Graphical reprasentation of the above results are separated as = ∫ ∗ − ɸ ∗ ɸ ( ) and = − ∫ ɸ + 1 .The algebraic equations can be expressed in matrix from [B]{C} = {F} by solving this the coefficients of approximate function (,,……., ) are obtained..

Table 3 R – R coefficients values for N=1and N=2

Fig 4 Comparison of Ritz results with exact method for set1 boundary conditions

3.2 Solution by Rayleigh – Ritz method Table 4 Comparison of Rayleigh – Ritz results with In the Rayleigh – Ritz method, functional is exact method for set two boundary conditions constructed and is minimized to obtain unknown coefficients of an approximate function. Let us assume the following second order ODE − − + = 0 For 0 < x < 1 Boundary conditions (0) = 0, = 1 The functional in Rayleigh – Ritz method is () = (, ) + () , The given governing equation is in strong form. In Rayleigh – Ritz method first of all strong form is converted into weak form

Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 38 Application of Variational Methods and Galerkin Method in Solving Engineering Problems Represented by Ordinary Differential Equations Graphical reprasentation of the above results Table 6 Comparison of Galerkin results with exact method for set1 boundary conditions

Fig 5 Comparison of Rayleigh – Ritz results with exact method for set 2 boundary conditions

3.3 Solution by Galerkin method Let us assume the following second order ODE, for high lighting the Galerkin method. − − + = 0 For 0 < x < 1 Graphical reprasentation of the above results. Boundary conditions u (0) = 0, u (1) = 0 In Galerkin method the weighting function treated as same as trivial functions (or) shape functions themselves.

= () = 0 Ω Residue is given as R = − − + ≠ 0

Where = so = ∫Ω ∗ () = 0 for = 1, 2, 3 … … . . , Fig 6 Comparison of Galerkin results with exact method for set1 boundary conditions = ∗ − − + = 0 IV. ANALYSIS OF AN ELASTIC BAR BY The given governing equation is converted APPROXIMATION METHODS into residual form. In Galerkin method next step is to alter the form by applying integration by parts The given elastic bar has been analyzed by adopting Galerkin method wherein two different approaches – = − ∗ + ∫ ∗ − ∫ ∗ + weak formulation approach and weighted residual ∫ ∗ = 0 method approach have been used. To get solution in Galerkin method, select an approximate function which will satisfy boundary L conditions. Functions (1 − ) , which is the P simplest function satisfying the boundary conditions. For one – parameter approximate function () = A, E q = Cx (1 − ) Weight function is same as shape function in Galerkin method = (1 − ). For two Fig 7 Uniform elastic bar – parameter approximate function () = (1 − ), = 2 − 3 Weight function is The governing differential equation for the above bar is same as shape function in Galerkin method = + = 0 For 0 < x < L, (1 − ) and = (2 − 3) , the algebraic equations can be solved for the coefficients of Boundary conditions are u (0) = 0, = 2 approximate function (,,……., ) Numerical data E = 200 GPa, A =600 mm , f = 5000 N/m, L = 600mm and P = 200 KN Table 5 Galerkin coefficients values for one and two And f A = C x , = , = ∗ , = = parameter approximation

4.1 Solution by Galerkin method – Approach 1 In Galerkin method the weighting function treated as same as trivial functions (or) shape functions

themselves. = ∫Ω () = 0 Where =

so = ∗ () = 0 for = 1, 2, 3 … … . . , ∫Ω

Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 39 Application of Variational Methods and Galerkin Method in Solving Engineering Problems Represented by Ordinary Differential Equations

Residue is given as R= + ≠ 0 4.2 Solution by Galerkin method – Approach 2 In Galerkin method the weighting function treated as = ∫ + = 0 same as trivial functions (or) shape functions Ω The given governing equation is converted themselves. into residual form. In Galerkin method next step is to alter the form by applying integration by parts = ∫ + ∫ = 0 Doing integration by parts the above equation is converted into Cx = ∗ − + = 0 Choosing approximate function is satisfy the boundary conditions. Approximate function U(x) = + + + ⋯ For one – parameter approximate function u(x) = and trail function = . By Substitute approximate function in equation we get the coefficient = + . For two – parameter approximate function approximate function u(x) = + and trail function = and = by Substitute approximate function in equation we get the coefficients = + , = −

Table 7 Galerkin Coefficients values for one and two parameter approximation with approach 1

Table 8 Comparison of Galerkin – Approach 1 results with exact results

Table 9 Galerkin coefficients values for one and two parameter approximation with approach 2

Table 10 Comparison of Galerkin – Approach 2 results with exact results

Graphal reprasentation of the above results

Fig: 8 Comparison of Galerkin – Approach 1 results with exact results

Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 40 Application of Variational Methods and Galerkin Method in Solving Engineering Problems Represented by Ordinary Differential Equations Graphal reprasentation of the above results coefficients of power series function have been determined for one – parameter approximate and two – parameter approximate functions. The resultant plots were drawn to illustrate the variation of dependent variable, u (x) with respect to the independent variable, x. It has been observed that there exists a linear relationship between x and u (x) when dealing with set 2 boundary conditions. In addition one – dimensional analysis of an elastic bar has been carried out by Galerkin method of Weighted Residual Methods. Two approaches of Fig 9 Comparison of Galerkin – Approach 2 results with Galerkin method have been utilized in solving a One exact results dimensional (1D) elastic bar problem. The solution by Weighted Residual Method (WRM) has been V. RESULTS AND DISCUSSION compared with that of exact one and it was found that approximate solution was same as that of exact The chosen second order ordinary differential one. It was further noted that displacement function u equation (ODE) has bean solved by Ritz method, (x) varies linearly along the length of an elastic bar. Rayleigh – Ritz method and Galerkin method. The This relationship is in concurrent with the established approximate function selected was a power series fact that the Hooke’s law holds good in the static function. The solution has bean obtained for different analysis of a linear structure. numbers of coefficients, which include N=1 and The suitable numerical data have been substituted in N=2. The corresponding coefficients were the relevant equations and the results were validated. determined and the associated plots were drawn. The numerical part of the thesis has been carried out Besides, Ritz method, Rayleigh – Ritz method and on MATLAB platform. Galerkin method were also employed in solving the given ordinary differential equation (ODE). The REFERENCES corresponding results and the associated plots were also depicted in Table 1 to 6 and Fig 4 to 6 [1] J.N. Reddy, An Introduction to the Finite Element respectively. Method, reprinted in India, 2006, Tata McGraw – Hill. [2] Robert D. Cook, David S. Malkus, Michael E. Plesha, Similarly, the results of the one dimensional elastic Robert J. Witt, Concepts And Applications Of Finite bar for Galerkin method with two different Element Analysis, reprinted in Delhi,2009, Wiley India(p) approaches were employed. The corresponding Ltd results and the associated plots were also depicted in [3] S. S. Rao, Finite Element Method in Engineering, reprinted in India, 2001, Butterworth – Heinemann Table 7 to10 and Fig 8 to 9 respectively. [4] O.C Zienkiewicz, R.L. Taylor & J.Z.Zhu, The Finite Element Method Its Basis & Fundamentals in CONCLUSIONS Engineering, re printed 2014,University of California, Berkeley [5] Sanjay Govindjee, A First Course on Variational Methods In this work, an attempt has been made to solve the in Structural Mechanics and Engineering, Department of given ODE by different variational methods. It has Civil and Environmental Engineering University of also been found that the results as obtained by Ritz, California, Berkeley, 2014,CA 94720-1710 Rayleigh – Ritz and Galerkin method were almost in [6] Mark S. Gockenbach, MATLAB Tutorial to accompany Partial Differential Equations, Analytical and Numerical agreement with each other. Further the approximate (SIAM, 2010) solutions were obtained by assuming their different [7] Abraham Asfaw, Solving Differential Equations Using approximate functions (power series functions) that MATLAB November 28, 2011 would satisfy their different set of boundary conditions associated with the given ODE. The



Proceedings of IRF International Conference, 28th February 2016, Goa, India, ISBN: 978-93-85973-54-3 41