A one-dimensional monotone interpolation method based on interface reconstruction with partial volumes in the slope-space utilizing the Hermite cubic-spline, is proposed. The new method is only quartic, however is C 2 and unconditionally monotone. A set of control points is employed to constrain the curvature of the interpolation function and to eliminate possible nonphysical oscillations in the slope space. An extension of this method in two-dimensions is also discussed.
Existing monotone cubic interpolation methods [
In this article, we propose an unconditionally monotone interpolation method that is only quartic, with the C2 continuity over the entire domain. The new method has no nonphysical oscillation with its derivative and is 3rd order accurate in space.
A set of points { x i , s i } are specified for i = 0 , 1 , 2 , ⋯ , N with { x i } ordered increasingly as well as { s i } , i.e. x i < x i + 1 and s i < s i + 1 hold for each integer i in range, as shown in
The problem is to construct an explicit polynomial curve g ( x ) that passes all the given data points, i.e., g ( x i ) = s i , for 0 ≤ i ≤ N , and has a continuous second derivative. In addition, the curve must be strictly increasing (being monotonic g ′ ( x ) > 0 ). Furthermore, the derivative of the interpolation function, g ′ ( x ) should have no unnecessary oscillations.
We consider a reduced problem in the slope space of the original problem. Let the slope function f ( x ) ≡ g ′ ( x ) , then if f ( x ) satisfy that
f ( x ) > 0 , (1)
∫ x i x i + 1 f ( x ¯ ) d x ¯ = Δ s i ≡ s i + 1 − s i , (2)
and f ( x ) has a continuous first derivative (being C1). Then, we can see that the integral of f ( x )
g ( x ) = s 0 + ∫ 0 x f ( x ¯ ) d x ¯ , (3)
not only passes through all the data points, but also has a well-defined second derivative. Therefore, we pursue the solution of the reduced problem by finding certain f ( x ) that satisfy the above given constraints.
The domain [ x 0 , x N ] is divided to N intervals with interval i defined by [ x i , x i + 1 ] . The partial area Δ s i is bounded by two lines: y = h i , y = 0 , and the boundaries of interval i, here
h i ≡ Δ s i / Δ x i , (4)
where Δ x i ≡ x i + 1 − x i . A solution of the problem must satisfy Equations (1), (2), and (3), and without unnecessary oscillation.
The above description corresponds to certain statistics problems such as re-binning of a radioactive particle energy distribution (see
There can be an infinite number of candidates of the solution. To limit the choices we consider a Hermite cubic-spline between an arbitrarily given pair of data points ( x L , y L ) and ( x R , y R ) (here L and R stand for the “left” and “right” boundaries of an interval) such that
x ( u ) = x L H 00 ( u ) + x R H 01 ( u ) + p L H 10 ( u ) + p R H 11 ( u ) , y ( u ) = y L H 00 ( u ) + y R H 01 ( u ) + q L H 10 ( u ) + q R H 11 ( u ) , (5)
where 0 ≤ u ≤ 1 is a non-dimensional parameter. p L , p R are the estimates of ( d x / d u ) , q L , q R are the estimates of ( d y / d u ) on the left and the right ends of a given interval. H i j ( u ) are the Hermit cubic spline base functions that
H 00 ( u ) = 1 + u 2 ( 2 u − 3 ) , H 01 ( u ) = u 2 ( 3 − 2 u ) , H 10 ( u ) = u ( u − 1 ) 2 , H 11 ( u ) = u 2 ( u − 1 ) . (6)
Next, we will show that how f ( x ) can be constructed with the above Hermite spline to satisfy Equations (1), (2), and (3), by properly choosing a set of control points.
The slope of f ( x ) , f ′ ( x ) ≡ g ″ ( x ) at each inner data point can be estimated numerically. For example, using a quadratic interpolation on the three points ( x i − 1 , s i − 1 ) , ( x i , s i ) and ( x i + 1 , s i + 1 ) , one is able to obtain an estimate of f ′ ( x i ) , except at the left and right boundaries. We consider the reduced problem as an interface reconstruction problem for volume conservation. The approach is to construct the geometry of the interface contained in interval i and to match the partial volume (area) Δ s i for each i. The interface piece constructed in interval i in general does not match with the pieces constructed in its neighbor intervals on boundaries. We will apply a Hermit spline later to eliminate the gaps and ensure a global slope continuation of f ( x ) .
To start with, we consider a given internal [ x i , x i + 1 ] as shown in
η = a ξ 2 + b ξ + c .
For slope match at the left end ξ = − Δ 2 and the right end ξ = + Δ 2 , we have
− a Δ + b = f ′ L , a Δ + b = f ′ R .
The area matching means the integral of η over the interval is 0, or
a 12 Δ 3 + c Δ = 0.
Solving for a, b and c, one arrives at
a = f ′ R − f ′ L 2 Δ , b = f ′ R + f ′ L 2 , c = Δ 24 ( f ′ L − f ′ R ) . (7)
The constant term c carries the position of the interface at the middle of the interval to the 3rd order accuracy (for our fitting here is quadratic).
We will use these mid interval interface positions obtained from the above quadratic fitting as a set of control points to construct our first approximation of the solution. Each interval wall x = x i intersects the Hermit spline curve passing the set of the mid-interval control points and the intersection is taken as a fixed control point. We have ( 2 N + 1 ) control points C k , ( k = 0 , 1 , 2 , ⋯ , 2 N ) . The ( N + 1 ) of them with even subscripts are on the walls of the intervals and are fixed, the rest N of them above the middle points of intervals are to be shifted vertically by matching volumes again.
We are to construct a Hermit spline that passes all the control points. For an exact area match, we break each original interval into two subintervals about the control point in the middle of the interval, see
In
A H = ∫ 0 1 y ( u ) x ′ ( u ) d u . (8)
Let the control point immediately left to x = x L be L L = ( x L L , y L L ) , and the
one immediately right to x = x R be R R = ( x R R , y R R ) . Evaluation of the above area integral provides that
A H = σ 00 y L + σ 01 y R + 1 2 ( σ 10 ( y R − y L L ) + σ 11 ( y R R − y L ) ) , (9)
where
σ 00 = x L I 0000 + x R I 0001 + p L I 0010 + p R I 0011 , σ 01 = x L I 0100 + x R I 0101 + p L I 0110 + p R I 0111 , σ 10 = x L I 1000 + x R I 1001 + p L I 1010 + p R I 1011 , σ 11 = x L I 1100 + x R I 1101 + p L I 1110 + p R I 1111 . (10)
Our choices of the x-slope terms are
p L = 1 2 ( x R − x L L ) , p R = 1 2 ( x R R − x L ) ,
and the y-slope terms are
q L = 1 2 ( y R − y L L ) , q R = 1 2 ( y R R − y L ) . (11)
They have been explicitly substituted in Equation (9) the expression of the physical area. The σ i j terms depend only on the x-coordinates of the boundaries of an interval. The terms I i j k l are area integrals of the Hermit spline defined as
I i j k l = ∫ 0 1 H i j ( u ) H ′ k l ( u ) d u . (12)
Each of i , j , k , l takes the values 0 or 1. These integrals are evaluated as the following
I 0000 = − 1 2 , I 0010 = 1 10 , I 0001 = 1 2 , I 0011 = − 1 10 ,
I 1000 = − 1 10 , I 1010 = 0 , I 1001 = 1 10 , I 1011 = − 1 60 ,
I 0100 = − 1 2 , I 0110 = − 1 10 , I 0101 = 1 2 , I 0111 = 1 10 ,
I 1100 = 1 10 , I 1110 = 1 60 , I 1101 = − 1 10 , I 1111 = 0.
Now let us consider the ith interval, with which 3 control points are involved, see in
need to enforce that the sum of the area contribution from the left subinterval and the right subinterval to equal an known value that
A H left + A H right = h i Δ x i ≡ s i + 1 − s i . (13)
Utilizing Equation (9) one arrives at
A H left = σ 00 left y i + σ 01 left y i + 1 2 + 1 2 ( σ 10 left ( y i + 1 2 − y i − 1 2 ) + σ 11 left ( y i + 1 − y i ) ) ,
A H right = σ 00 right y i + 1 2 + σ 01 right y i + 1 + 1 2 ( σ 10 right ( y i + 1 − y i ) + σ 11 right ( y i + 3 2 − y i + 1 2 ) ) .
Because each of the σ i j terms involves only the x-coordinates of the control points, it is a constant. The sum of areas under each Hermit cubit splines defined on a subinterval is simply a linear combination of y i − 1 2 , y i + 1 2 , and y i + 3 2 . Therefore, we have a tri-diagonal linear system involving all intervals to solve in order to match the area exactly in each interval, with certain boundary conditions provided for the left-most and the right-most intervals.
For the interval on the left boundary, we must specify the slope terms p L , q L . For the interval on the right boundary, we must provide the slope terms p R , q R as well. Currently we assume two kinds of boundary conditions. The first is a symmetrical boundary condition with which one sets a ghost control points at the reflection point of the nearest inner control point. The other one is a counter-symmetric condition by setting a ghost control point out of the boundary by extending the line-segment defined by the two nearest known control points involved (see
We have obtained f ( x ) with a Hermite cubic spline on the control points computed in the previous sections. This solution may not necessarily be positive when h i is close or equal to zero. Thus, we need to have a treatment in the possible case this negativity occurs. Fortunately, we have a nearly trivial treatment that is rather easy to perform, at least for isolated cases.
Considering the worst case that Δ s i = 0 , in the ( g ( x ) , x ) space this means g ( x ) must be a constant in the corresponding interval. Equivalently, the slope f ( x ) must be zero everywhere in interval i, otherwise any variation would create some negative slopes then the monotone condition is violated. Specifically, the slopes at the two ends must be zeros.
Thus, we choose to enforce the slope terms q L , q R to zeros in the Hermite cubic spline in case an interval contains a point with a negative f ( x ) . This means the two control points on interval boundaries are at the same height. Since we also assume a troubled interval is isolated, we lift the neighbor control
points at ( x i − 1 2 , y i − 1 2 ) and ( x i + 3 2 , y i + 3 2 ) to match the areas in the two neighbor
intervals. Because the area match condition is linear for a single variable y i − 1 2 or y i + 3 2 in either neighbor interval so the solution is trivial and does not affect rest of the intervals.
After the above treatment there will be no occurrence of f ( x ) < 0 anymore. Therefore, the monotonicity of g ( x ) is satisfied unconditionally, see
We have obtained a Hermite cubic spline in previous sections. The spline is non-negative, differentiable, and the area under it bounded by the walls of intervals and the x-axis exactly matches a specified area for each interval. Therefore, the integration of f ( x ) provides a monotone interpolation of the data set { x i , s i } , i = 0 , 1 , 2 , ⋯ , N with an excellent quality. We have picked a general parametric form of x = x ( u ) and y = y ( u ) in Equation (5). In practice one can simply pick that
u = x − x i Δ x i , f ( x ) = y ( u ) ,
for interval “i”. All the previous discussions would still hold. This means we have an unconditionally monotone interpolation that is only quartic. It is an integral of the Hermit-cubic splines. Its order is lower than some of the existing monotone interpolation methods. Although we have split each interval to two, thus increased the number of knots. Nevertheless, since our analysis is done in the slope space for a cubic spline, the proposed method may be easier to handle than other monotone interpolation methods. The new monotone interpolation can be explicitly expressed as the follows
g ( x ) = s i + ( x i + 1 2 − x i ) ∫ 0 u f ( u ) d u = s i + ( x i + 1 2 − x i ) ( y i G 00 ( u ) + y i + 1 2 G 01 ( u ) + q i G 10 ( u ) + q i + 1 2 G 11 ( u ) ) , (14)
for the left subinterval of the original interval “i” with u ≡ ( x − x i ) / ( x i + 1 2 − x i ) .
The quartic functions G i j ( u ) are integrations of the Hermite base functions H i j ( u ) and
G 00 ( u ) = u ( 1 − u 2 − u 3 2 ) , G 01 ( u ) = u 3 ( 1 − u 2 ) ,
G 10 ( u ) = u 2 12 ( 3 u 2 − 8 u + 6 ) , G 11 ( u ) = u 3 12 ( 3 u − 4 ) .
Let us define that
s i + 1 2 = g ( x i + 1 2 ) = s i + 1 2 ( x i + 1 2 − x i ) ( y i + y i + 1 + 1 6 ( q i + q i + 1 2 ) ) .
Then for the right subinterval ( x i + 1 2 , x i + 1 ) , we have
g ( x ) = s i + 1 2 + ( x i + 1 − x i + 1 2 ) ∫ 0 u f ( u ) d u = s i + 1 2 + ( x i + 1 − x i + 1 2 ) ( y i + 1 2 G 00 ( u ) + y i + 1 G 01 ( u ) + q i + 1 2 G 10 ( u ) + q i + 1 G 11 ( u ) ) , (15)
with u = ( x − x i + 1 2 ) / ( x i + 1 − x i + 1 2 ) this time. The slope terms are defined as
q i = 1 2 ( y i + 1 2 − y i − 1 2 ) , q i + 1 2 = 1 2 ( y i + 1 − y i ) , q i + 1 = 1 2 ( y i + 3 2 − y i + 1 2 ) ,
if interval “i” contains no negativeness. In the case of a possible isolated negativeness the corresponding q terms are taken to zeros. Because the y (thus q) terms in the above equations are obtained with area matching, Equations (1), (2), and (3) are all satisfied. Because f ( x ) is differentiable, g ( x ) is an unconditionally monotone C2 quartic spline. Besides all the above, the proposed method does not have nonphysical oscillations on its derivative for we have explicit slope control with a Hermite cubic spline. This is a desirable feature. It is possible to further refine the solution by minimize the curvature (say) of f ( x ) to adjust the level of the control points for minimal variation in slope. However, we are confident that the proposed solution is of third order accuracy with a quadratic interface reconstruction. Therefore, the control points are almost right on the ideal solution assuming which exists. Then, a further refinement is hardly necessary for a practical purpose.
Consider a set of data triplets { x i , y j , s i , j } given for i = 1 , 2 , ⋯ , ( I − 1 ) , I and j = 1 , 2 , ⋯ , ( J − 1 ) , J with the properties x i + 1 > x i , y j + 1 > y j , and s ( i + 1 ) , j > s i , j , s i , ( j + 1 ) > s i , j for an arbitrary pair of integers i, j in the range. Can one construct a polynomial surface S ( x , y ) that passes every data point (i.e. S ( x i , y j ) = s i , j for all feasible integer pair ( i , j ) ), and has positive spatial derivatives
f ( x , y ) ≡ ∂ S ( x , y ) ∂ x > 0 , g ( x , y ) ≡ ∂ S ( x , y ) ∂ y > 0 ,
with no oscillation for both f and g ?
If the given dataset is also consistent with a sufficient condition for data monotonicity
v i , j ≡ s i + 1 , j + 1 + s i , j − s i , j + 1 − s i + 1 , j > 0 , (16)
for all valid i and j, then, a method for interface-reconstruction in three-dimensions using volume conservation may be applied to constructing a two-dimensional monotone spline that is at least twice differentiable, with no oscillation on the first derivatives of S ( x , y ) .
Without loss of generality, we assume s i , j > 0 and modify a given data set satisfying Equation (16), by adding a layer of phantom data points by simply choosing x 0 < x 1 , y 0 < y 1 , and assigning s i , 0 = 0 , s 0 , j = 0 for all 0 ≤ i ≤ I , 0 ≤ j ≤ J . The monotone feature that s ( i + 1 ) , j > s i , j , s i , ( j + 1 ) > s i , j can be derived from Equation (16) using the boundary values.
The interface reconstruction is done in the ( ∂ 2 s / ∂ x ∂ y ) space. The “fluid volume” confined in each rectangular cell x i ≤ x ≤ x i + 1 , y j ≤ y ≤ y j + 1 , is defined by Equation (16), which is a difference expression for the cross-derivative at the cell center. Because slope estimates can be computed with certain difference schemes, there are enough data to support the definition of a local quadratic polynomial (or some other algebraic expression) that bounds v i , j exactly in this cell.
The average of the intersections between the straight line x = x i , y = y i and the reconstructed local interface expressions in the surrounding cells can be used as a fixed control point. The control points above the middle point of each edge of a given cell can be set similarly (see
Finally, the monotone spline can be obtained with an integral of the bicubic spline V ( x , y ) described above
S ( x , y ) = ∫ x 0 x ∫ y 0 y V ( x ¯ , y ¯ ) d x ¯ d y ¯ .
Because V = ( ∂ 2 S / ∂ x ∂ y ) > 0 holds everywhere by construction and on the boundaries x = x 0 and y = y 0 the first derivatives of S are nonnegative, as the spatial integrals of ( ∂ 2 S / ∂ x ∂ y ) , ∂ S / ∂ x > 0 and ∂ S / ∂ y > 0 must hold everywhere inside the computational domain. Thus the spline is monotone. Because explicit slope control is provided for V ( x , y ) with setting the control points by volume conservation, there is no oscillation on the derivatives of S ( x , y ) for ( ∂ 2 S / ∂ x ∂ y ) has no oscillation. In addition, the spatial slopes is continuous for a bicubic polynomial V ( x , y ) ≡ ( ∂ 2 S / ∂ x ∂ y ) , S ( x , y ) is then at least twice differentiable.
A set of statistical data pair { x i , s i } , ( i = 0 , 1 , 2 , ⋯ , N − 1 , N ) is given. Which can be considered as density of radioactive particle counts vs. energy, as shown in
At each internal knot x i , we find its neighbor knots x i − 1 and x i + 1 and fit a quadratic polynomial
S ( x ) = α i ( x − x i ) 2 + β i ( x − x i ) + γ i
that passes the three data points and the solution is explicit that
α i = h i − h i − 1 x i + 1 − x i − 1 , β i = ( h i ( Δ x i − 1 ) + h i − 1 ( Δ x i ) ) , γ i = s i .
For an estimate of slopes we can differentiate S ( x ) and take
f ( x i ) ≈ S ′ ( x i ) = β i , f ′ ( x i ) ≈ S ″ ( x i ) = 2 α i .
For each interval [ x i , x i + 1 ] , we fit a quadratic polynomial
F ( x ) = a ( x − x i + 1 2 ) 2 + b ( x − x i + 1 2 ) + ( c − h i )
with F ′ ( x i ) = 2 α i , F ′ ( x i + 1 ) = 2 α i + 1 the slope estimates described above. One
finds that
a = ( S ″ ( x i + 1 ) − S ″ ( x i ) ) / ( 2 Δ x i ) , b = ( S ″ ( x i ) + S ″ ( x i + 1 ) ) / 2 , c = − a ( Δ x i ) 2 12 .
The value of c = F ( x i + 1 2 ) provides the estimate of the height of the mid interval control point C 2 i + 1 . The quadratic area fitting function F ( x ) described
above has the 3rd order spatial accuracy and provides the initial heights of the mid interval control points.
A Hermit cubic spline passing the set of mid interval area matching points obtained above intersects the line x = x i and the intersection is taken as the position of control point C 2 i . In the unlikely case that this control point is below the x-axis, for positivity, we would lift it to ( x i , 0 ) thus move this control-point closer to the true solution which is by definition above the x-axis. These control points are not to be moved.
At this step, each original interval is broken to two subintervals of equal lengths. Each interval [ x i , x i + 1 ] corresponds to a mid-interval control point
C 2 i + 1 = ( x i + 1 2 , y i + 1 2 ) . y i + 1 2 is computed by solving a tri-diagonal linear system
defined by the area-matching Equation (13) for all i’s.
All the control points are now determined. They define a unique Hermit spline curve f ( x ) that passes all the control points, has a continuous derivative crossing the bin-walls, and matches the counts in each bin. We are able to integrate f ( x ) to construct the monotone interpolation function g ( x ) as described with Equation (14), Equation (15).
Because g ( x ) is monotone, one is able to evenly divide the vertical axis in the ( g ( x ) , x ) space between ( g ( x 0 ) , g ( x N ) ) to M intervals. Let the new accumulated bin counts be
S j = s 0 + j ( s N − s 0 ) M , ( j = 0 , 1 , 2 , ⋯ , M ) .
Then one solves for each j that g ( x j ) = S j for the new bin-system. Because the derivative g ′ ( x ) = f ( x ) is available at any point in the domain, a Newton- Raphson method
x j k + 1 = x j k − ( g ( x k ) − S j ) / f ( x k ) ,
will generate the solution quickly for g ( x ) is monotone. The first guess can be picked with a search to find the ith bin that contains the solution, i.e.
s i < S j < s i + 1 then, simply taken to x j 0 = x i + 1 2 .
A solution in the case of N = 28 and M = 40 is shown in
A one dimensional monotone C2 quartic interpolation method is proposed. The original problem is reduced to a volume matching problem in the slope space to locate a set of control points on the solution curve. A quadratic fitting in each interval is employed to first approximately locate the control points with area matching. The solution of a tri-diagonal linear system is employed to relocate the control points above the middle of each interval to exactly matching the areas under a Hermit-cubic spline curve while fixing the control points above the original knots. The integration of the solution in the slope-space provides the desired unconditional monotone C2 interpolation. The proposed method has the feature of being of lower order (quartic) and with no undesired oscillation in the slope space. An application to the practical problem of rebinning a set of nonnegative statistical data shows the proposed method is effective in one-dimension. The proposed method may be extended to two-dimensions in a similar fashion with a higher smoothness for data sets that satisfy an extra constraint.
This work is performed under the auspices of the US Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
The authors would like to express appreciation to Simon Labov and Chad Noble of Lawrence Livermore National Laboratory for their encouragement and support.
Yao, J. and Nelson, K.E. (2018) An Unconditionally Monotone C2 Quartic Spline Method with Nonoscillation Derivatives. Advances in Pure Mathematics, 8, 25-40. https://doi.org/10.4236/apm.2018.81003