/ / Article

Research Article | Open Access

Volume 2012 |Article ID 605741 | https://doi.org/10.1155/2012/605741

M. Zarebnia, M. Birjandi, "The Numerical Solution of Problems in Calculus of Variation Using B-Spline Collocation Method", Journal of Applied Mathematics, vol. 2012, Article ID 605741, 10 pages, 2012. https://doi.org/10.1155/2012/605741

# The Numerical Solution of Problems in Calculus of Variation Using B-Spline Collocation Method

Academic Editor: Saeid Abbasbandy
Revised10 Jul 2012
Accepted10 Jul 2012
Published29 Aug 2012

#### Abstract

A B-spline collocation method is developed for solving boundary value problems which arise from the problems of calculus of variations. Some properties of the B-spline procedure required for subsequent development are given, and they are utilized to reduce the solution computation of boundary value problems to some algebraic equations. The method is applied to a few test examples to illustrate the accuracy and the implementation of the method.

#### 1. Introduction

Minimization problems that can be analyzed by the calculus of variations serve to characterize the equilibrium configurations of almost all continuous physical systems, ranging between elasticity, solid and fluid mechanics, electromagnetism, gravitation, quantum mechanics, string theory, many, many others. Many computational methods as motivated by optimization problems use the technique of minimization. Methods of search, finite elements, and iterative schemes are part of optimization theory. The classical calculus of variation [1, 2] answers the question: what conditions must the minimizer satisfy? while the computational techniques are concerned with the question: how to find or approximate the minimizer? The list of main contributors to the calculus of variations includes the most distinguished mathematicians of the last three centuries such as Leibnitz, Newton, Bernoulli, Euler, Lagrange, Gauss, Jacobi, Hamilton, and Hilbert. In recent years, many different methods have been used to estimate the solution of problems in calculus of variations [3โ12]. In this work, we consider collocation method based on using B-spline basis functions, for finding approximate solution of differential equations which arise from problems of calculus of variations. The application of the method to differential equations leads to an algebraic system.

The organization of this paper is as follows: in Section 2, we introduce the general form of problems in calculus of variations, and their relations with ordinary differential equations are highlighted. In Section 3, we describe the cubic B-spline function and basic formulation of B-spline collocation method required for our subsequent development and present a clear overview of this method. Also in this section, we illustrate how the cubic B-spline method may be used to replace boundary value problems by explicit systems of algebraic equations. In Section 4, we report our numerical results and demonstrate the efficiency and accuracy of the proposed numerical scheme by considering some numerical examples. Section 5 ends this paper with a conclusion. Note that we have computed the numerical results by Mathematica programming.

#### 2. Calculus of Variation Problems and Their Relations with BVPs

The general form of a variational problem can be considered as finding the extremum of the functional

To find the extreme value of , the boundary points of the admissible curves are known in the following form:

The necessary condition for (2.1) to extremize is that it should satisfy the Euler-Lagrange equations with boundary conditions given in (2.2). The system of boundary value problems (2.3) does not always have a solution, and if the solution exists, it may not be unique. Note that in many variational problems, the existence of a solution is obvious from the physical or geometrical meaning of the problem, and if the solution of Euler's equation satisfies the boundary conditions, it is unique. Also this unique extremal will be the solution of the given variational problem [2]. Thus, another approach for solving the variational problem (2.1) is finding the solution of the system of ordinary differential equations (2.3) which satisfies the boundary conditions (2.2). The simplest form of the variational problem (2.1) is with the given boundary conditions Here, the necessary condition for the extremum of the functional (2.4) is to satisfy the following second-order differential equation: with boundary conditions given in (2.5). In the present work, we find the variational problems by applying cubic B-spline collocation method on the Euler-Lagrange equations.

#### 3. Cubic B-Spline Method

##### 3.1. B-Spline Preliminaries

Consider the partition of . Let denote the set of piecewise polynomials of degree on subinterval of partition . In this work, we consider cubic B-spline method for finding approximate solution of variational problems. B-spline functions are discussed thoroughly in [13].

Consider the grid points on the interval as follows: where . Let be the B-spline function of degree , where , and satisfy the following conditions: (i), (ii), (iii).

The zero-order polynomial B-spline is defined as and also, the general-order B-spline is given by

Note that this definition means that is nonzero only in the range . The cubic B-splines , at the grid points , are defined as

##### 3.2. Approximate Solution of the Problems in Calculus of Variation

Now let us consider the general form of the variational problem (2.1). Finding the solution of the problem (2.1) needs to solve the corresponding ordinary differential equations (2.3) with boundary conditions (2.2). We assume be the exact solution of the boundary value problem (2.3). By considering (3.5), the functions defined over the interval are approximated by the following linear combinations of the cubic B-spline functions: where are unknown coefficients and are cubic B-spline functions which are defined in (3.5). For convenience, consider the second-order boundary value problem (2.3) as follows: and also consider . By using (3.6)โ(3.8), we can approximate , and as follows:

By substituting in (3.9) and setting , as collocation points, we obtain the system (3.11) consists of equations with unknowns . Now, consider the equations from boundary conditions (2.2) as follows:

Adding (3.12) and (3.13) to the system of (3.11), we obtain equations with unknowns . Solving the system (3.11)โ(3.13), the coefficients are obtained. Then, we can obtain an approximation to the solution of (3.9) that is equivalent to the solution of the variational problem (2.1) as

#### 4. Numerical Examples

In order to illustrate the performance of the cubic B-spline collocation method and the efficiency of the method, the following examples are considered. The examples have been solved by the presented method with different values of . We define the error function where and denote exact and approximate solutions, respectively. The errors are reported on the set of uniform grid points with step size , The error on this grid is Tables 1โ3 exhibit the absolute errors.

 ๐ โ โ ๐ธ โ 8 1 / 8 6 . 9 1 0 9 ร 1 0 โ 2 16 1 / 1 6 1 . 7 1 6 5 ร 1 0 โ 2 32 1 / 3 2 4 . 2 8 4 5 ร 1 0 โ 3 64 1 / 6 4 1 . 0 7 0 7 ร 1 0 โ 3 128 1 / 1 2 8 2 . 6 7 6 4 ร 1 0 โ 4 256 1 / 2 5 6 6 . 6 9 0 6 ร 1 0 โ 5
 ๐ โ โ ๐ธ โ 8 1 / 8 2 . 1 8 4 6 ร 1 0 โ 6 16 1 / 1 6 5 . 4 3 9 6 ร 1 0 โ 7 32 1 / 3 2 1 . 3 5 4 4 ร 1 0 โ 7 64 1 / 6 4 3 . 3 5 0 0 ร 1 0 โ 8 128 1 / 1 2 8 8 . 0 1 7 2 ร 1 0 โ 9 256 1 / 2 5 6 1 . 6 4 6 9 ร 1 0 โ 9
 ๐ โ โ ๐ธ 1 โ โ ๐ธ 2 โ 8 ๐ / 1 6 8 . 9 8 5 5 ร 1 0 โ 4 8 . 9 8 5 5 ร 1 0 โ 4 16 ๐ / 3 2 2 . 2 5 0 7 ร 1 0 โ 4 2 . 2 5 0 7 ร 1 0 โ 4 32 ๐ / 6 4 5 . 6 3 2 1 ร 1 0 โ 5 5 . 6 3 2 1 ร 1 0 โ 5 64 ๐ / 1 2 8 1 . 4 0 8 2 ร 1 0 โ 5 1 . 4 0 8 2 ร 1 0 โ 5 128 ๐ / 2 5 6 3 . 5 2 0 7 ร 1 0 โ 6 3 . 5 2 0 7 ร 1 0 โ 6 256 ๐ / 5 1 2 8 . 8 0 1 8 ร 1 0 โ 7 8 . 8 0 1 8 ร 1 0 โ 7

Example 4.1. We first consider the following variational problem with the exact solution [11]: subject to boundary conditions
Considering (4.3), the Euler-Lagrange equation of this problem can be written in the following form:
By considering (3.6), (3.10), and (3.11) and also substituting in (4.5) and setting , we obtain where . The linear system (4.6) consists of equations with unknowns . Now, consider the two equations from (3.12) to (3.13) and boundary conditions (4.4) as follows:
Adding (4.7) and (4.8) to the system of (4.6), we obtain equations with unknowns . In order to determine these unknowns, we can now rewrite (4.6)โ(4.8) in the matrix form where is a square matrix of order and is defined as follows:
Solving the linear system (4.9), the coefficients are obtained. Then, we can obtain an approximation to the solution as
The maximum absolute errors in numerical solution of Example 4.1 are tabulated in Table 1.

These results show the efficiency and applicability of the presented method.

Example 4.2. In this example, we consider the following variational problem [2]: which satisfies the conditions
The exact solution of this problem is . In this case, the Euler-Lagrange equation is written in the following form:
Substituting (3.6) into (4.13)-(4.14) and evaluating the result at the B-spline grid points (3.2), we obtain
Solving nonlinear algebraic equations (4.15) by Newton's method and substituting the for to (4.11), the approximation solution can be found. In Table 2, we give the maximum absolute errors for different values of .

From Table 2, we see the errors decrease as increases.

Example 4.3. In this example, consider the following problem of finding the extremals of the functional [2, 11]: with boundary conditions
The system of Euler's differential equations is of the form
The exact solutions of the problem are and . In this example, according to the general form of variational problem (2.1), we have . Thus, we use (3.6) and (3.7) to approximate and . Now substituting and into (4.18) and evaluating the result at the grid points (3.2), we obtain
Solving linear algebraic Equations (4.19) and by substituting the and for to and , the approximate solutions can be found. Suppose that and are the maximum absolute errors for and , respectively. Table 3 shows and for different values of .

#### 5. Conclusions

This paper described an efficient method for finding the minimum of a functional over the specified domain. The main objective is to find the solution of an ordinary differential equation which arises from the variational problem. Our approach was based on the cubic B-spline method. Properties of the B-spline method are utilized to reduce the computation of this problem to some algebraic equations. The method is computationally attractive, and applications are demonstrated through illustrative examples. The obtained results showed that this approach can solve the problem effectively.

#### Acknowledgment

The authors thank the referees for their valuable comments that helped them in revising this paper.

#### References

1. I. M. Gelfand and S. V. Fomin, Calculus of Variations, Prentice-Hall, Englewood Cliffs, NJ, USA, 1963.
2. L. Elsgolts, Differential Equations and the Calculus of Variations, Mir Publishers, Moscow, Russia, 1973.
3. C. F. Chen and C. H. Hsiao, โA Walsh series direct method for solving variational problems,โ Journal of the Franklin Institute, vol. 300, no. 4, pp. 265โ280, 1975.
4. R. Y. Chang and M. L. Wang, โShifted Legendre direct method for variational problems,โ Journal of Optimization Theory and Applications, vol. 39, no. 2, pp. 299โ307, 1983.
5. C. Hwang and Y. P. Shih, โLaguerre series direct method for variational problems,โ Journal of Optimization Theory and Applications, vol. 39, no. 1, pp. 143โ149, 1983.
6. I. R. Horng and J. H. Chou, โShifted Chebyshev direct method for solving variational problems,โ International Journal of Systems Science, vol. 16, no. 7, pp. 855โ861, 1985.
7. O. von Stryk and R. Bulirsch, โDirect and indirect methods for trajectory optimization,โ Annals of Operations Research, vol. 37, no. 1–4, pp. 357โ373, 1992.
8. H. Jaddu, โDirect solution of nonlinear optimal control problems using quasilinearization and Chebyshev polynomials,โ Journal of the Franklin Institute, vol. 339, no. 4-5, pp. 479โ498, 2002.
9. P. Williams, โA quadrature discretization for solving optimal control problems,โ in Proceedings of the AAS/AIAA Space Flight Mechanic Meeting, vol. 119 of Advances in the Astronautical Sciences, Spaceflight Mechanics, pp. 703โ722, Maui, Hawaii, USA, February 2004. View at: Google Scholar
10. W. Glabisz, โDirect Walsh-wavelet packet method for variational problems,โ Applied Mathematics and Computation, vol. 159, no. 3, pp. 769โ781, 2004.
11. A. Saadatmandi and M. Dehghan, โThe numerical solution of problems in calculus of variation using Chebyshev finite difference method,โ Physics Letters A, vol. 372, pp. 4037โ4040, 2008. View at: Google Scholar
12. S. Abbasbandy and A. Shirzadi, โThe series solution of problems in the calculus of variations via the homotopy analysis method,โ Z. Naturforsch, vol. 64a, pp. 30โ36, 2008. View at: Google Scholar
13. C. de Boor, A practical Guide to Splines, vol. 27, Springer, New York, NY, USA, 1978.

Copyright © 2012 M. Zarebnia and M. Birjandi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.