A New Approach of Constrained Interpolation Based on Cubic Hermite Splines

Suppose we have a constrained set of data and wish to approximate it using a suitable function. It is natural to require the approximant to preserve the constraints. In this work, we state the problem in an interpolating setting and propose a parameter-based method and use the well-known cubic Hermite splines to interpolate the data with a constrained spline to provide with a 
 
 
 
 C
 
 
 1
 
 
 
 interpolant. Then, more smoothing constraints are added to obtain 
 
 
 
 C
 
 
 2
 
 
 
 continuity. Additionally, a minimization criterion is presented as a theoretical support to the proposed study; this is performed using linear programming. The proposed methods are demonstrated with illustrious examples.


Introduction
In the industrial design, it is often required to generate a smooth function approximating a given set of data which preserves certain shape properties of the data such as positivity, monotonicity, or convexity, that is, a smooth shapepreserving approximation [1].
Shape-preserving approximation is a subfield of computer aided design (CAD) and has extensively been applied in various areas of engineering such as ship design, car body design, and aerospace industry; it also plays a crucial role in aerography and even in animation and games. Now, some emerging research fields, such as modern data analysis, mathematical finance, image processing, visualization, and digital watermarking techniques, are putting forward higher standards for curve and surface shape-preserving modeling systems [2].
Here, it is generally assumed that the given data are sufficiently accurate to warrant interpolation, so we focus on the shape-preserving interpolation techniques; however, for more oscillatory data, one may prefer to use other approximation methods such as least squares.
In a shape-preserving interpolation problem, we seek for a smooth curve/surface passing through a given set of data in which we priorly know that there is a shape feature in it and one wishes the interpolant to inherit these features [1,[3][4][5][6][7][8][9]. Positivity, monotonicity, and convexity are the basic and fundamental shape features which normally arise in everyday scientific phenomena.
During the past three decades, various shape-preserving interpolation methods have been proposed. In this problem, splines play a crucial role, and every approach to shapepreserving interpolation, more or less, uses splines as a cornerstone.
e shape-preserving problem can be handled using different bases, and innovative techniques have been employed to cope with different aspects of this generally studied problem [10,11].
A good survey of different approaches for shape-preserving interpolation techniques could be found in [2] and the references therein.
One of the hidden features in a dataset may be its boundedness. is happens, for example, when the data come from a sampling of a bounded function or they reflect the probability or efficiency of a process. Actually, any quantity which is expressed as a percentage of another quantity will necessarily lie between 0 and 100; in this case, the data satisfy m ≤ f i ≤ M, for known bounds m and M. However, the bounds could be imposed by functions (curves) as well, i.e., for known functions B 1 (x) and B 2 (x), the data satisfy B 1 (x i ) ≤ f i ≤ B 2 (x i ). When we recreate the underlying entity by interpolation from the sampled values, we need to ensure that the interpolating curve adheres to these known properties, so we wish to find a function g(x) which approximates (fits) the data and is also bounded into [m, M]; moreover, as every shape-preserving modeling, we require a reasonable degree of smoothness. Such a problem may have lots of applications, for example, in engineering and data visualization. ere is a good review of literature in [12], where Asim and Brodlie have mentioned the advantages and drawbacks of different approaches; they have also modified the knot insertion algorithm proposed in [13]. e Shepard interpolation family [14] have been used by Brodlie et al. in [15] to study this problem.
is article studies the problem in an interpolating setting and takes advantage of cubic splines to visualize the data. It proposes a parameter-based method and uses the well-known cubic Hermite splines to interpolate a constrained data with a C 1 cubic spline, which preserves the desired bounds. It furthermore proposes the work to obtain C 2 spline by adding more smoothing constraints. Additionally, an energy minimization technique is used to provide C 1 and C 2 interpolating functions. is is performed using a linear programming technique. e structure of the study is as follows. In Section 2, the cubic Hermite spline with unknown derivative parameters is used to provide with a C 1 interpolant; then, more smoothing constraints are added in Section 3 to obtain C 2 continuity. Section 4 deals with more general constraints and studies the case where the constraints are quadratic polynomials. A minimization criterion is presented in Section 5, and Section 6 is devoted for demonstration with illustrious examples.

Bounded C 1 Cubic Hermite Spline
We state the C 1 bounded interpolation problem (C1BIP) as follows.
To answer this question, we use a C 1 cubic Hermite spline (CHS) S(x), which is defined in [x i , x i+1 ] as follows: where m i � S ′ (x i ) are the unknown values. ey are the shape parameters, and we use them to force the interpolant to satisfy the bounding conditions, i.e., 0 ≤ S(x) ≤ 1. Schmidt and Hess [16] have given the necessary and sufficient conditions, for a cubic polynomial, to be positive on an interval. We use a sufficient condition extracted from their results to ensure S i (x) ≥ 0 and 1 − S i (x) ≥ 0.
Proof. It suffices to apply Lemma 1 on 1 − S i (x).

Journal of Mathematics
Proof.
e constraints resulted from Lemma 1 and Corollary 1 must be applied to each subinterval. e value of m 1 is affected by only the first interval constraints, so it suffices to satisfy (4). For every m i , i � 2, . . . , n − 1, one must consider restrictions of two consecutive subintervals, namely, So, there are 4 restrictions on m i as follows: ese inequalities must be satisfied simultaneously, so inequalities (5) is the natural presentation of these constraints. e case of m n is similar to m 1 .

Definition 1.
e set of all points satisfying inequalities (4)-(6) is defined to be the feasible region of the cubic Hermite spline method for C1BIP.

Lemma 2.
e feasible region of the Definition 1 is nonempty.
Proof. For each m i , i � 1, . . . , n, we should verify that the lower bound of the corresponding constraints, from inequalities (4)-(6), is actually lower than the upper bound.
is is obvious due to the assumption 0 ≤ f i ≤ 1. In inequalities (4)-(6), every lower bound is a nonpositive value, while each upper bound is nonnegative. □ e following theorem is a straightforward result of Lemma 2.
, there exists a C 1 cubic Hermite spline interpolant, in the form of equation (1), which provides a solution to Problem 1. Remark 1. Any point in the feasible region, presented by inequalities (4)-(6), provides with a solution to Problem 1. One may choose each m i to be the middle point of the corresponding feasible interval. In the next section, we seek for optimal solutions which provide with more smooth and visually pleasing solution curves.

Bounded C 2 Cubic Hermite Spline
e cubic Hermite spline (1) provides a family of solutions to Problem 1. Any set of m i n i�1 from the feasible region results in a C 1 bounded interpolant. We can impose more restrictions on m i values to obtain interpolants with desired properties. Imposing the C 2 continuity property, the second derivative of S(x) must be continuous at each interior point e system of linear equation (7) with inequalities (4)-(6) forms a set of constraints. To find a feasible solution, one can solve a linear programming problem subjected to these constraints. So, a question of feasibility arises here: "does a solution to the system (7) satisfies in (4)-(6)?" is is dependent upon f i values; here, we state a sufficient condition.

Lemma 3. If x i forms a uniform partition and
, then solution to the linear system (5) satisfies the inequalities (4)-(6).
one can represent For i � 2, . . . , n − 2, equation (5) leads to the following restrictions: which results in Now, for the feasibility of equation (8), it remains to verify Here, we add the assumptions (1/2) ≤ f i ≤ 1 for all i � 1, . . . , n, which leads to e latter inequality is obvious due to our assumption for f i values. Similar calculations can be used to verify (14). Using inequalities (4) and (6), respectively, one can easily handle the feasibility for i � 1 and i � n.

Constraining Cubic Hermite Interpolation
, where f i is bounded by two curves B 1 (x) and B 2 (x), i.e., , there is an interpolating function g which is also constrained by B 1 (x) and B 2 (x), i.e., We consider the case where B 1 (x) and B 2 (x) are, at most, quadratic polynomials and set some sufficient conditions on the cubic Hermite spline (1) to fulfill condition (16). Denoting one can rewrite the constraining conditions Applying Lemma 1, we have the following result:

Theorem 3. A sufficient condition for the interpolating cubic
Hermite spline S(x) (1) to be constrained by B 1 (x) and B 2 (x) (16) is to satisfy the following conditions:

Journal of Mathematics
For getting more smoothness, one can easily add C 2 continuity conditions, and the reasoning is the same as the bounded case.

Energy Minimization Technique
So far, we have solved the bounded and constrained interpolation problems, and we know that there does exist C 1 as well as C 2 solutions to these problems. However, in both cases, there may exist a number of solutions; so, a matter of choosing the "optimal solution" arises here. Moreover, to get an explicit result, one has to solve a linear programming problem.
e energy minimization method has successfully been used by Burmeister et al. [17] to obtain an interpolating spline with minimum energy. It is generally based on minimizing the curvature of the spline which is represented by Wolberg and Alfy [18] have proposed different, but closely related, quantities to express the energy of a spline. ey introduced an energy measure based on the second derivative discontinuities: ey have simplified the discontinuity energy measure, E D , to be linear with the first derivatives, so that a linear programming procedure can be applied. e simplification is performed by using the absolute values of the discontinuities: For each discontinuity point, they define a slack variable, s k , whose value is forced to be the absolute value of the discontinuity, using the following inequality constraints: E D can be written as Here, we use the same techniques and try to reach suitable splines in two stages. We state the idea for bounded case, and then, it can be easily extended to a constrained case. First, we put E D as an objective function and minimize its subject to the following constraints.  (m 0 , . . . , m n , s 1 , . . . , s n− 1 ) t , and now, we have a solution to Problem 1 (C1BIP).
At this point, we can switch to the second stage. E D reflects the sum of discontinuities in the second derivative; so, whenever it has a relatively small value, we hope that we are close to a C 2 solution. Having the solution of the mentioned LP at the hand, we try to reach a C 2 solution as well. To do so, we add the C 2 continuity constraints, i.e., equation (7) to the set of constraints. is time, we use E from equation (21) as an objective and minimize its subject to the following constraints: (i) Boundedness constraints: equation (4)-(6) (ii) C 2 continuity conditions: equation (7) is is a nonlinear programming problem and needs a starting guess; we use the solution F * of the mentioned LP as the starting point.

Examples and Illustrations
In previous sections, the bounded and constrained cubic Hermite spline problems (Problems 1 and 2) have been transformed to a linear programming problem which can be easily handled in MATLAB. To reach a smoother solution, the C 2 continuity constraints were put in a nonlinear programming problem, which also can be solved by MATLAB using "fmincon" function. e maximum vector norm of MATLAB with a discretization is used to compare the errors. We illustrate these results through some examples: the first group of examples confined to bounded interpolation and the second group presents the constrained case.

Bounded CHS Examples
Example 1. We consider the dataset in Table 1. is is a uniform sampling of the semicircle described by the function f(x) 2]. e C 1 solution as well as the original curve is illustrated in Figure 1. It is seen that the maximum error is 0.0551. e C 2 solution is more pleasing and is reported in Figure 2. e maximum error in this case reduces to 0.0531. Table 2 represents the maximum error for both solutions in each subinterval. Table 3 presents a data sampled from the function

Example 2.
ese data are oscillatory and do not fulfill the conditions of Lemma 3; however, the cubic Hermite solutions are convincing enough. e C 1 solution as well as the original curve is depicted in Figure 3. It is seen that in C 1 case, the maximum error is 0.0193. Table 4 presents the errors for each interval in both C 1 and C 2 cases.

Journal of Mathematics
In the C 2 solution, the maximum error is 0.0195, and it is depicted in Figure 4.

Example 3.
Consider the data given in Table 5, which come from the burning of coal in a furnace: the y values are the percentage of oxygen in flue gas over a range of time. If we visualize these data by cubic spline, it would give a pleasing smooth curve, but it is unfortunately physically nonsense since it generates negative percentages. is problem have been handled in [12] by Hermite and rational splines, and they have reported C 1 positive interpolants. Qin and Xu [19] got advantage of a trigonometric spline to propose a C 1 positivity preserving approximation. Here, the proposed method provides with a C 2 interpolant where its curve lies completely between maximum and minimum values of percentage ( Figure 5).

Constrained CHS Examples
Example 4. Dataset in Table 6 is a sampling of on a uniform partition in [0, 12]. We wish to find the corresponding interpolant which lies between         Figure 6. e C 2 solution is obtained by the energy minimization technique and has the maximum error 0.0120, which is very convincing and shows that this technique provides a smooth solution with lesser error. Figure 7 is the C 2 solution; in both figures, the solid line refers to the interpolant, the dotted curve is the original function, and the dashed lines are constraining functions. e ordinary cubic spline also could be used to solve this interpolating problem, but it may not fulfill the constraining conditions. However, in this example, the spline solution satisfies the constraints. Here, the C 1 and C 2 Hermite cubic solutions can be compared with the ordinary spline solution which is obtained by MATLAB. Table 7 provides the corresponding errors in subintervals. According to this report, the C 2 solution gives a more satisfying result. Also, the C 1 solution competes well enough. However, in cases where the constraints are tighter, the Hermite spline solutions, both C 1 and C 2 , are comparably better than ordinary spline solution.

Concluding Remarks
A special kind of shape-preserving approximation which deals with bounding constraints has been addressed; although it has partially been studied in the literature [12], we propose a linear programming approach and use energy minimization techniques to gain C 2 continuity. Quadratic constraints are handled, which give the positivity and linear constraints a special case. It should be mentioned here that the bounded interpolation problem may be considered as a piecewise monotonic interpolation. In every subinterval, we may select a suitable function which preserves the monotonicity. is is a problem which has extensively been studied [18]. But a monotone solution may not be a suitable approximation for a bounded phenomenon, and the monotone interpolant cannot reach values outside the minimum and maximum of the sampling. is drawback was our motivation to seek for a really bounded approximation.
It is worth indicating two experimental results: (i) e constrained/bounded cubic Hermite spline is a promising technique for interpolating scattered data (ii) e energy minimization technique is a convincing tool to gain more smoothness and reduce the approximation error

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest.