1. Introduction
Real-world problems in science and engineering often involve mathematical models described by higher-order ordinary differential equations (ODEs). These equations are typically solved analytically, numerically, or approximately. When analytical or exact solutions are unavailable, approximate methods are employed. Numerical methods and algorithms have been extensively developed to approximate solutions for higher-order ODEs.
Polynomial or piecewise polynomial functions are frequently used for this purpose [
1]. By interpolating the function and connecting its values, approximate solutions can be constructed. Bézier curves are widely utilized for approximating functions, polynomial functions, and data [
2,
3,
4,
5,
6,
7]. Control points-based methods, which rely on Bézier curves, have proven effective and computationally advantageous for solving dynamic systems involving differential equations [
3,
4,
5,
6,
7,
8,
9].
Bézier curves are particularly useful for solving boundary value problems (BVPs) of ODEs and singular nonlinear equations [
5,
10]. If the desired level of accuracy is not achieved, the degree of Bézier curves can be increased. Conversely, unnecessary degrees can be reduced to minimize computational overhead if the approximate solution is already acceptable [
11].
In the 1970s, the Ball curve’s basis functions were introduced as more efficient and effective alternatives to Bézier curves [
12,
13,
14,
15,
16]. Generalized Ball curves share similar properties with Bézier curves in terms of shape preservation but offer computational advantages, particularly when using recursive algorithms such as de Casteljau’s [
15,
17]. Degree raising and lowering is also more efficient with Ball curves than with Bézier curves [
18].
The Ball curve’s control points framework has become a valuable tool for achieving precise curvature, making the computation of control points an attractive technique. Ball initially introduced the cubic polynomial function while designing aircraft shapes in the conic lofting surface program CONSURF [
12,
13,
14]. Extensions of the Ball curve, such as the DP Ball, Said–Ball, and Wang–Ball curves, generalize it to higher-degree
polynomials [
15,
16,
19]. Subsequent studies have focused on theoretical approaches to degree modification for optimizing curve accuracy [
10,
15,
18,
19,
20,
21,
22,
23].
The following equation represents the basis function of the cubic Ball curve, both mathematically and graphically:
where
represent the basis functions, and
denote the control points of a cubic Ball curve (see
Figure 1).
The first advantage of the cubic basis function of Ball curves is that it can be reduced to the quadratic basis function of Bézier curves when combined with its internal control points. Secondly, the basis function of Ball curves demonstrates better computational performance than Bézier curves when represented in a generalized form [
15]. As a result, the Said–Ball curve is slightly more computationally efficient than Bézier curves while maintaining similar shape-preserving properties [
15,
24,
25].
Our study aims to achieve the best approximate solutions for ODEs by enhancing error accuracy through numerical methods. Various algorithms have been developed to solve higher-order ODEs approximately, with a focus on attaining high accuracy [
26,
27,
28,
29,
30,
31,
32]. However, challenges such as extensive programming effort, increased human effort, and computational burden can affect the accuracy of these methods.
In the 1960s, Rutishauser introduced a direct method for solving higher-order ODEs without reducing them to systems of first-order ODEs [
28], offering an efficient alternative to reduction methods. Earlier, in 1795, Gauss introduced the least squares method (LSM), one of the first direct approaches, which utilizes polynomial or piecewise polynomial functions to approximate solutions to higher-order ODEs and discretize integrals [
29]. For solving ODEs, the LSM combined with Bézier curves has been employed as an alternative to integral discretization and has minimized an objective function to determine the Bézier curve’s control points [
30]. Additionally, the LSM has been successfully applied to various differential equations in combination with other techniques [
4,
33,
34,
35,
36,
37,
38,
39,
40]. Its simplicity and ability to improve the accuracy of approximate solutions make the LSM advantageous for solving higher-order ODEs [
3,
25,
39,
41].
To the best of our knowledge, the use of Said–Ball curves combined with the LSM to improve error accuracy in ODE solutions has not been explored. This research aims to determine the optimal control points of Said–Ball curves using the LSM for improved approximate solutions of ODEs.
Specifically, the objectives are as follows:
- i.
To identify the best control points of Said–Ball curves by minimizing the residual error through the sum of the squares of the residual function.
- ii.
To achieve better approximate solutions by substituting these optimized control points into Said–Ball curves.
- iii.
To significantly improve error accuracy compared to existing methods.
- iv.
To establish Said–Ball curve representations with the LSM as a suitable alternative method, contributing to analytical approximations for solving BVPs of ODEs.
The content of this paper is organized as follows:
Section 2 provides an overview of Bezier curve representations.
Section 3 introduces the representations and properties of Said–Ball curves.
Section 4 describes the proposed method, using Said–Ball curves with the LSM to approximate ODE solutions.
Section 5 provides a convergence analysis of the method. Numerical examples validating the proposed method are presented in
Section 6, followed by the results in
Section 7. Finally,
Section 8 concludes the study.
2. Bézier Curves
From [
30], Bézier curves of degree
can be defined using
control points
as follows:
where
are the Bézier control points (or Bézier coefficients), and the polynomials of Bézier curves
in the interval [
a,
b] are as follows:
The function is a parametric Bézier curve if it is a polynomial in the form of a vector-valued function. Moreover, its control polygon contains of the line segments where . If is a scalar-valued function, then the function is known as an explicit Bézier curve, represented by .
4. Least Squares Method for Solving ODEs
4.1. Exploration of Said–Ball Curve’s Control Points Technique
The Said–Ball curves are proposed as a technique based on their control points, as the basis function of Said–Ball curves offers better computational capability than the basis function of Bézier curves.
The strategies involved in the study are as follows:
Consider the following
-order ODE:
with initial conditions:
and boundary conditions:
where
is the
-order differential operator with the polynomial coefficients
and
is a polynomial function.
The residual error is measured by minimizing the residual function as follows:
The minimization of the residual function is achieved by summing the squares of the residual values at the control points. This summation becomes zero when the residual error at all control points is zero, indicating that the approximate solution matches the exact solution.
To address this, a new algorithm is proposed to obtain the approximate solution of Equation (9) while satisfying the initial conditions in Equation (10) and the boundary conditions in Equation (11). The algorithm is described as follows:
Step 1: Represent the approximate solution using Said–Ball curves of degree
, where
the order of the differential equation, i.e.,
where the
control points
need to be calculated.
Step 2: Compute the residual function
by substituting
into Equation (9) while incorporating the initial and boundary conditions given in Equations (10) and (11). The residual function can be expressed as a polynomial:
which is represented using Said–Ball curves of degree
, where
Here, are the control points of , expressed as linear functions of the unknowns , with .
Step 3: Develop the objective function for Said–Ball curves:
Step 4: Solve for the control points
by addressing the constrained optimization problem:
subject to the following conditions
To solve this constrained optimization problem, any suitable method can be applied, such as the Lagrange Multiplier Method.
Step 5: Substitute the calculated control points back into Equation (13) to obtain the approximate solution of Equation (9).
4.2. Degree-Raising Scheme
In
Section 4.1, the control points-based method using the LSM provides an approximate solution to the ODEs. By substituting the values of Said–Ball curve control points
back into the objective function
, the Euclidean norm of the Said–Ball curve’s control points can be computed. This enables determining an upper bound for the residual function
based on the values of
, expressed as
If the obtained error values are not sufficiently small, the approximate solution does not meet the expected accuracy level. To address this, the degree of the Said–Ball curve, which serves as the approximate solution, can be increased. By repeating the process outlined in
Section 4.1 with the updated curve degree, an improved solution can be achieved, meeting the desired level of accuracy and reducing the error.
4.3. Performance Comparison
The proposed method was implemented in MATLAB-R2020a and applied to solve BVPs for second-order and fourth-order ODEs. The error metrics, including error accuracy, maximum absolute error, maximum relative error, and maximum percent relative error of the exact and approximate solutions based on Said–Ball curves, were compared with existing methods such as the Bézier curve method [
30], the direct inverse method, the steepest descent method, and FMARI [
36].
The formulas for the three types of errors are as follows:
The method with the smallest error across all metrics is considered the best-performing approach.
5. Convergence Analysis
A convergence analysis of the proposed technique is conducted based on the Said–Ball curve’s control points. The analysis focuses on a two-point BVP with a unique smooth solution, ensuring the method’s robustness in producing solutions that converge to the exact values under appropriate conditions.
Consider the following BVP:
with
where
, and
are polynomials in terms of
.
By averaging the control points of Said–Ball curves, the square of the norm polynomial can be approximated over the interval based on the control points of the Said–Ball curve.
Lemma 1. If the Said–Ball curves represented in the form of a polynomial arethenwhere are the control points of Said–Ball curves after increasing the degree to . Proof. By using the degree-raising rule
hence,
This demonstrates that the sequence
is monotonically decreasing and converges as
, with the lower bound being zero. It remains to prove that
is equal to the limit of the above sequence.
Using the definition of the definite integration, we have
From the convergence property of the Said–Ball curves’ degree raising, there exists an arbitrarily small positive number
such that
with
Now, we estimate the last two terms in the right-hand side of the equation as follows:
and
Theorem 1. Let be the -continuous and unique solution of the two-point BVP (15). The approximate solution constructed using the control points of Said–Ball curves, converges to the exact solution g(x) as the degree of the approximate solution tends to infinity.
Proof. The proof is divided into several steps:
Given an arbitrarily small number
, the Weierstrass theorem [
25,
37,
38] guarantees the existence of a polynomial
of degree
such that
where
denotes the
-norm over
.
However,
may not generally satisfy the given boundary conditions. By applying a small perturbation in the form of a linear polynomial
, we construct another polynomial
such that
satisfies the boundary conditions
and
and
Hence, the residual function can be estimated as follows:
where
is a constant.
In this step, we represent the residual in the form of the Said–Ball curve as follows:
From Lemma 1, there exists an integer
such that if
, then
Now, suppose that
is the approximate solution of (15) with degree
constructed using the control points of Said–Ball curves. Let
with degree
.
Further, we estimate the Sobolev norm of the difference in the exact solution
and the approximate solution
as follows:
Here, is a constant. Since the average of the squared residuals at the control points of the Said–Ball curves is minimized using the control points-based method, the average value of the approximate solution is smaller than .
Hence, the approximate solution converges to the exact solution as the degree of the approximate solution approaches infinity. □
6. Numerical Examples
Four numerical examples from related works were considered to demonstrate the proposed method. The basis function of the Said–Ball curve was used to approximate the solution of BVPs involving second-order and fourth-order ODEs, as well as second-order non-homogeneous ODEs, utilizing the LSM. The results and accuracy, in terms of error, were compared with those from existing studies.
The maximum absolute error, relative error, and percent relative error between the exact and approximate solutions based on Said–Ball curves were compared with those obtained using the Bézier curve method [
30], the direct inverse method, the steepest descent method, and FMARI [
36].
6.1. Example 1: [30]
To illustrate the method, a very simple example is considered as the first case.
The exact solution of the above BVP is .
Suppose that a degree-2 Said–Ball curve is used to represent the approximate solution.
The residual function is obtained by substituting
into the given ODE:
The objective function is developed as follows:
The values of were determined by applying the proposed technique with the boundary conditions , resulting in and .
These control points values were substituted into Equation (16); yielding the approximate solution as follows:
The exact solution and the approximate solution using a degree-2 Said–Ball curve are presented graphically in
Figure 6.
Next, Example 1 is reconsidered by increasing the degree of the Said–Ball curve to 3 to enhance error accuracy.
The control points values of the Said–Ball curve in
Table 1 were calculated by applying the proposed method with the boundary conditions
.
Thus, the approximate solution was obtained by substituting the above control points values into Equation (18).
The exact solution and the approximate solution using a degree-3 Said–Ball curve are presented graphically in
Figure 7.
In Example 1, the maximum absolute error of 0.147578 occurs at , between the exact solution and the approximate solution of degree 2. However, when the degree of the Said–Ball curve is increased to 3, the approximate solution becomes equivalent to the exact solution.
6.2. Example 2: [30]
The exact solution of the above problem is
Firstly, Bézier curves of degrees 5 and 8 are demonstrated as existing methods. For the approximate solution, a Bézier curve of degree 5 is assumed.
The control points values of the Bézier curve method in
Table 2 were calculated with the boundary conditions
Equation (21) is an approximate solution of degree 5, obtained by substituting the control points into Equation (20):
Let the approximate solution be the Bézier curve of degree 8:
The control points values of the Bézier curve method in
Table 3 were calculated with the boundary conditions
Therefore, the approximate solution of degree 8 is found as follows:
The exact solution and the approximate solution using degree-5 and -8 Bézier curves are illustrated graphically in
Figure 8.
Next, we apply the proposed method to obtain an approximate solution for a BVP involving a fourth-order ODE.
Initially, we assume that the approximate solution is a Said–Ball curve of degree 5.
The control points values of the Said–Ball curve in
Table 4 were calculated by applying the proposed method with the boundary conditions
.
Therefore, the approximate solution is obtained by substituting the values of the control points into Equation (22). Thus, the approximate solution of degree 5 is given by Equation (23):
The exact solution and the approximate solution using a degree-5 Said–Ball curve are presented graphically in
Figure 9.
Since the approximate solution of degree 5 did not achieve the expected level of accuracy, the degree of the Said–Ball curve is increased. Assume that the approximate solution is the Said–Ball curve of degree 8.
Then, the control points
and
are obtained by adopting the proposed method via minimization of the objective function. Their conditions are
. (see
Table 5).
Therefore, the approximate solution is obtained by substituting the values of the control points into the above equation. Thus, the approximate solution of degree 8 is given by
Figure 10 provides a schematic illustration of the exact and approximate solutions of degree 8.
6.3. Example 3: A Non-Homogeneous 2nd Order Linear ODE with BVP [36]
The exact solution of the above BVP is
Firstly, assume the Said–Ball curve of degree 3 is the approximate solution to the problem in Example 3.
Secondly, the minimization of the objective function with the boundary conditions
is performed using the LSM. After that, the constrained optimization problem must be solved in order to obtain the values of the control points for the Said–Ball curve (see
Table 6).
By substituting the calculated values of the control points of the Said–Ball curve into (24), the approximate solution of the BVP for the 2nd-order non-homogeneous ODE is obtained. Hence, the approximate solution of degree 3 is given in Equation (25).
Figure 11 presents the approximate and exact solutions graphically.
Hence, the error accuracy is not at an acceptable level with the degree 3 Said–Ball curve. Now, by increasing the degree of the Said–Ball curve to degree 4, assume the approximate solution of the BVP for the 2nd-order non-homogeneous ODE in the same Example 3.
The values of the Said–Ball curve’s control points were determined using the proposed method, along with the given conditions y (0) = 0 and y (1) = 2, after resolving the constrained optimization problem (see
Table 7).
By substituting the calculated values of the control points of the Said–Ball curve into (26), the approximate solution of the BVP for the 2nd-order non-homogeneous ODE is obtained. Therefore, the approximate solution of degree 4 is given in Equation (27).
Figure 12 shows the approximate solution of degree 5 and the exact solution graphically.
6.4. Example 4: A Non-Homogeneous 2nd Order Linear ODE with BVP [36]
The exact solution of the above problem is
Firstly, suppose the approximate solution is the Said–Ball curve of degree 3.
The values of the Said–Ball curve’s control points were determined using the proposed method, along with the given conditions
y (0) = 0 and
y (1) = 2, after resolving the constrained optimization problem (see
Table 8).
By substituting the calculated values of the control points of the Said–Ball curve into (28), the approximate solution of the BVP for the 2nd-order non-homogeneous ODE is obtained. Therefore, the approximate solution of degree 3 is given in Equation (29).
Figure 13 shows the approximate and exact solutions graphically.
Thus, the error accuracy between the exact and approximate solutions does not meet the expected level. Therefore, by increasing the degree of the Said–Ball curve to 4.
The control points values of the Said–Ball curve in
Table 9 were calculated by applying the proposed method with the boundary conditions
.
Thus, the approximate solution is computed by substituting the values of the control points into (30). Consequently, the approximate solution of degree 4, using the LSM with the Said–Ball curve, is as follows:
The approximate solution of degree 4 and the exact solution are presented graphically in
Figure 14.