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 [312]. 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 (7) 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 𝐽𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛=(𝑡)𝑏𝑎𝐺𝑡,𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡),𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡)𝑑𝑡.(2.1)

To find the extreme value of 𝐽, the boundary points of the admissible curves are known in the following form: 𝑢𝑖(𝑎)=𝛾𝑖𝑢,𝑖=1,2,,𝑛,𝑖(𝑏)=𝛿𝑖,𝑖=1,2,,𝑛.(2.2)

The necessary condition for (2.1) to extremize 𝐽[𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡)] is that it should satisfy the Euler-Lagrange equations 𝜕𝐺𝜕𝑢𝑖𝑑𝑑𝑡𝜕𝐺𝜕𝑢𝑖=0,𝑖=1,2,,𝑛,(2.3) 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 𝐽[]=𝑢(𝑡)𝑏𝑎𝐺𝑡,𝑢(𝑡),𝑢(𝑡)𝑑𝑡,(2.4) with the given boundary conditions 𝑢(𝑎)=𝛾,𝑢(𝑏)=𝛿.(2.5) Here, the necessary condition for the extremum of the functional (2.4) is to satisfy the following second-order differential equation: 𝜕𝐺𝑑𝜕𝑢𝑑𝑡𝜕𝐺𝜕𝑢=0,(2.6) 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 Δ={𝑡0,𝑡1,𝑡2,,𝑡𝑁} of [𝑎,𝑏]𝑅. Let 𝑆𝑘(Δ) denote the set of piecewise polynomials of degree 𝑘 on subinterval 𝐼𝑗=[𝑥𝑗1,𝑥𝑗] 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: 𝑎=𝑡0<𝑡1<𝑡2<,𝑡𝑁1<𝑡𝑁𝑡=𝑏,(3.1)𝑗=𝑡0+𝑗,𝑗=0,1,2,,𝑁,(3.2) where =(𝑏𝑎)/𝑁. Let 𝐵𝑘,𝑗 be the B-spline function of degree 𝑘, where 𝑗, and satisfy the following conditions: (i)Supp(𝐵𝑘,𝑗)=[𝑡𝑗,𝑡𝑗+𝑘+1], (ii)𝐵𝑘,𝑗(𝑡)0,forall𝑡, (iii)𝑗=𝐵𝑘,𝑗(𝑡)=1,forall𝑡.

The zero-order polynomial B-spline is defined as 𝐵0,𝑗𝑡(𝑡)=1,𝑡𝑗,𝑡𝑗+1,0,otherwise,(3.3) and also, the general-order B-spline is given by 𝐵𝑘,𝑗(𝑡)=𝑡𝑡𝑗𝑡𝑘+𝑗𝑡𝑗𝐵𝑘1,𝑗𝑡(𝑡)+𝑘+𝑗+1𝑡𝑡𝑘+𝑗+1𝑡𝑗+1𝐵𝑘1,𝑗+1(𝑡).(3.4)

Note that this definition means that 𝐵𝑘,𝑗(𝑡) is nonzero only in the range 𝑡𝑗𝑡𝑡𝑘+𝑗+1. The cubic B-splines 𝐵𝑘,𝑗(𝑡), at the grid points 𝑡𝑗, are defined as 𝐵3,𝑗1(𝑡)=63𝑡𝑡𝑗3𝑡,𝑡𝑗,𝑡𝑗+1,3+32𝑡𝑡𝑗+1+3𝑡𝑡𝑗+123𝑡𝑡𝑗+13𝑡,𝑡𝑗+1,𝑡𝑗+2,3+32𝑡𝑗+3𝑡𝑡+3𝑗+3𝑡2𝑡3𝑗+3𝑡3𝑡,𝑡𝑗+2,𝑡𝑗+3,𝑡𝑗+4𝑡3𝑡,𝑡𝑗+3,𝑡𝑗+4.(3.5)

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 (𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡)) be the exact solution of the boundary value problem (2.3). By considering (3.5), the functions (𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡)) defined over the interval [𝑎,𝑏] are approximated by the following linear combinations of the cubic B-spline functions: 𝑢1(𝑡)𝑢1,𝑁(𝑡)=𝑁1𝑗=3𝑤1,𝑗𝐵3,𝑗𝑢(𝑡),(3.6)2(𝑡)𝑢2,𝑁(𝑡)=𝑁1𝑗=3𝑤2,𝑗𝐵3,𝑗𝑢(𝑡),(3.7)𝑛(𝑡)𝑢𝑛,𝑁(𝑡)=𝑁1𝑗=3𝑤𝑛,𝑗𝐵3,𝑗(𝑡),(3.8) where 𝑤𝑖,𝑗,𝑖=1,2,,𝑛,𝑗=3,2,,𝑁1 are unknown coefficients and 𝐵3,𝑗(𝑡) are cubic B-spline functions which are defined in (3.5). For convenience, consider the second-order boundary value problem (2.3) as follows: 𝐹𝑢1(𝑡),𝑢2(𝑡),,𝑢𝑛(𝑡),𝑢1(𝑡),,𝑢𝑛(𝑡),𝑢1(𝑡),,𝑢𝑛(𝑡)=0,(3.9) and also consider 𝐵3,𝑗(𝑡)=𝐵𝑗(𝑡). By using (3.6)–(3.8), we can approximate 𝑢𝑖(𝑡), 𝑢𝑖(𝑡) and 𝑢𝑖(𝑡),𝑖=1,2,,𝑛 as follows: 𝑢𝑖(𝑡)𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗(𝑡),𝑢𝑖(𝑡)𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗(𝑡),𝑢𝑖(𝑡)𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗(𝑡).(3.10)

By substituting in (3.9) and setting 𝑡=𝑡𝑙,𝑙=0,1,2,,𝑁, as collocation points, we obtain 𝐹𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡𝑙,,𝑁1𝑗=3𝑤𝑛,𝑗𝐵𝑗𝑡𝑙,𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡𝑙,,𝑁1𝑗=3𝑤𝑛,𝑗𝐵𝑗𝑡𝑙=0.(3.11) the system (3.11) consists of 𝑛(𝑁+1) equations with 𝑛(𝑁+3) unknowns {𝑤𝑗}𝑛1𝑗=3. Now, consider the 2𝑛 equations from boundary conditions (2.2) as follows: 𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗𝑡0=𝛾𝑖,𝑖=1,2,,𝑛,(3.12)𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗𝑡𝑁=𝛿𝑖,𝑖=1,2,,𝑛.(3.13)

Adding (3.12) and (3.13) to the system of (3.11), we obtain 𝑛(𝑁+3) equations with 𝑛(𝑁+3) unknowns 𝑤𝑖,𝑗,𝑖=1,2,,𝑛,𝑗=3,2,,𝑁1. Solving the system (3.11)–(3.13), the coefficients 𝑤𝑖,𝑗,𝑖=1,2,,𝑛,𝑗=3,2,,𝑁1 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 𝑢𝑖(𝑡)𝑢𝑖,𝑁(𝑡)=𝑁1𝑗=3𝑤𝑖,𝑗𝐵𝑗(𝑡),𝑖=1,2,,𝑛.(3.14)

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 𝑈=(𝑏𝑎)/100, 𝑧𝑈=0,𝑧1,,𝑧100,𝑧𝑗=𝑎+𝑗𝑈,𝑗=0,1,,100.(4.1) The error on this grid is 𝐸=max0𝑗100||𝐸𝑧𝑗||.(4.2) Tables 13 exhibit the absolute errors.

Example 4.1. We first consider the following variational problem with the exact solution 𝑢(𝑡)=𝑒3𝑡 [11]: min𝐽=10𝑢(𝑡)+𝑢(𝑡)4𝑒3𝑡2𝑑𝑡,(4.3) subject to boundary conditions 𝑢(0)=1,𝑢(1)=𝑒3.(4.4)
Considering (4.3), the Euler-Lagrange equation of this problem can be written in the following form: 𝑢(𝑡)𝑢(𝑡)8𝑒3𝑡=0.(4.5)
By considering (3.6), (3.10), and (3.11) and also substituting in (4.5) and setting 𝑡=𝑡𝑙,𝑙=0,1,2,,𝑁, we obtain 𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑙𝐵𝑗𝑡𝑙=8𝑒3𝑡𝑙,𝑙=0,1,2,,𝑁,(4.6) where 𝑡𝑙=𝑡0+𝑙,=1/𝑁. The linear system (4.6) consists of (𝑁+1) equations with (𝑁+3) unknowns {𝑤𝑗}𝑁1𝑗=3. Now, consider the two equations from (3.12) to (3.13) and boundary conditions (4.4) as follows: 𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡0=1,(4.7)𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑁=𝑒3.(4.8)
Adding (4.7) and (4.8) to the system of (4.6), we obtain (𝑁+3) equations with (𝑁+3) unknowns 𝑤𝑗,𝑗=3,2,,𝑁1. In order to determine these (𝑁+3) unknowns, we can now rewrite (4.6)–(4.8) in the matrix form 𝐴𝑊=𝑃,(4.9) where 𝐴 is a square matrix of order (𝑁+3)×(𝑁+3) and is defined as follows: 𝑎𝐴=𝑘,𝑙𝑎,𝑘=1,2,,𝑁+3,𝑙=1,2,,𝑁+3,1,𝑙=𝐵𝑗𝑎(0),𝑗=𝑙4,𝑙=1,2,,𝑁+3,𝑘,𝑗=𝐵𝑗𝑡𝑖𝐵𝑗𝑡𝑖𝑎,𝑖=𝑘2,𝑘=2,3,,𝑁+2,𝑗=𝑙4,𝑙=1,2,,𝑁+3,𝑛+3,𝑗=𝐵𝑗𝑤(1),𝑗=𝑙4,𝑙=1,2,,𝑛+3,𝑊=3,𝑤2,,𝑤𝑁1𝑇,𝑃=1,𝑒3𝑡0,𝑒3𝑡1,,𝑒3𝑡𝑁1,𝑒3𝑡𝑁,𝑒3𝑇.(4.10)
Solving the linear system (4.9), the coefficients 𝑤𝑗,𝑗=3,2,,𝑁1 are obtained. Then, we can obtain an approximation to the solution as 𝑢(𝑡)𝑢𝑁(𝑡)=𝑁1𝑗=3𝑤𝑗𝐵𝑗(𝑡).(4.11)
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]: min𝐽=101+𝑢2(𝑡)𝑢2(𝑡)𝑑𝑡,(4.12) which satisfies the conditions 𝑢(0)=0,𝑢(1)=0.5.(4.13)
The exact solution of this problem is 𝑢(𝑡)=sinh(0.4812118250𝑡). In this case, the Euler-Lagrange equation is written in the following form: 𝑢(𝑡)+𝑢(𝑡)𝑢2(𝑡)𝑢(𝑡)𝑢2(𝑡)=0.(4.14)
Substituting (3.6) into (4.13)-(4.14) and evaluating the result at the B-spline grid points (3.2), we obtain 𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡0=0,𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑖+𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑖𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑖2𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑖𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑖2=0,𝑖=0,1,2,,𝑁,𝑁1𝑗=3𝑤𝑗𝐵𝑗𝑡𝑁=0.5.(4.15)
Solving (𝑁+3) nonlinear algebraic equations (4.15) by Newton's method and substituting the 𝑤𝑗 for 𝑗=3,2,,𝑁1 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]: 𝐽𝑢1(𝑡),𝑢2=(𝑡)0𝜋/2𝑢12(𝑡)+𝑢22(𝑡)+2𝑢1(𝑡)𝑢2(𝑡)𝑑𝑡,(4.16) with boundary conditions 𝑢1(0)=0,𝑢1𝜋2𝑢=1,2(0)=0,𝑢2𝜋2=1.(4.17)
The system of Euler's differential equations is of the form 𝑢1(𝑡)𝑢2𝑢(𝑡)=0,2(𝑡)𝑢1(𝑡)=0.(4.18)
The exact solutions of the problem are 𝑢1(𝑡)=sin(𝑡) and 𝑢2(𝑡)=sin(𝑡). In this example, according to the general form of variational problem (2.1), we have 𝑖=2. Thus, we use (3.6) and (3.7) to approximate 𝑢1(𝑡) and 𝑢2(𝑡). Now substituting 𝑢1(𝑡) and 𝑢2(𝑡) into (4.18) and evaluating the result at the grid points (3.2), we obtain 𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡0=0,𝑁1𝑗=3𝑤2,𝑗𝐵𝑗𝑡0=0,𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡𝑖𝑁1𝑗=3𝑤2,𝑗𝐵𝑗𝑡𝑖=0,𝑖=0,1,2,,𝑁,𝑁1𝑗=3𝑤2,𝑗𝐵𝑗𝑡𝑖𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡𝑖=0,𝑖=0,1,2,,𝑁,𝑁1𝑗=3𝑤1,𝑗𝐵𝑗𝑡𝑁=1,𝑁1𝑗=3𝑤2,𝑗𝐵𝑗𝑡𝑁=1.(4.19)
Solving 2(𝑁+3) linear algebraic Equations (4.19) and by substituting the 𝑤1,𝑗 and 𝑤2,𝑗 for 𝑗=3,2,,𝑁1 to 𝑢1(𝑡) and 𝑢2(𝑡), the approximate solutions can be found. Suppose that 𝐸1 and 𝐸2 are the maximum absolute errors for 𝑢1(𝑡) and 𝑢2(𝑡), respectively. Table 3 shows 𝐸1 and 𝐸2 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.