C1 monotone cubic Hermite interpolant

C1 monotone cubic Hermite interpolant

Applied Mathematics Letters 25 (2012) 1161–1165 Contents lists available at SciVerse ScienceDirect Applied Mathematics Letters journal homepage: www...

190KB Sizes 236 Downloads 109 Views

Applied Mathematics Letters 25 (2012) 1161–1165

Contents lists available at SciVerse ScienceDirect

Applied Mathematics Letters journal homepage: www.elsevier.com/locate/aml

C1 monotone cubic Hermite interpolant R.J. Cripps a,∗ , M.Z. Hussain b a

School of Mechanical Engineering, University of Birmingham, Birmingham, B15 2TT, UK

b

Department of Mathematics, University of the Punjab, Lahore, Pakistan

article

info

Article history: Received 16 May 2011 Received in revised form 3 January 2012 Accepted 20 February 2012 Keywords: Bézier Rational Weights Monotonic Interpolation

abstract Constraining an interpolation to be shape preserving is a well established technique for modelling scientific data. Many techniques express the constraint variables in terms of abstract quantities that are difficult to relate to either physical values or the geometric properties of the interpolant. In this paper, we construct a piecewise monotonic interpolant where the degrees of freedom are expressed in terms of the weights of the rational Bézier cubic interpolant. © 2012 Elsevier Ltd. All rights reserved.

1. Introduction There exist many interpolating methods which derive sufficient conditions to ensure the resulting interpolant preserves some geometric aspect of the data, for example, monotonicity. All develop constraints based on parameters of the interpolating polynomial which either has no correspondence with the data or the natural geometry of the interpolant. For example, Fritsch and Butland [1], Fritsch and Carlson [2] and Higham [3] used piecewise cubic Hermite polynomials to interpolate monotone data (increasing data with positive derivatives). Although the cubic Hermite schemes interpolate data and derivatives, they did not preserve the shape of monotone data. The authors in [1–3] proposed different remedies of the problem, for example, the schemes. [2,4] first identified the interval in which monotonicity was lost by ordinary cubic Hermite interpolant then modified the derivatives to obtain the required results. The scheme of [3] Higham inserts extra knots to preserve monotonicity. The scheme proposed by Schumaker [5] was economical due to piecewise quadratic polynomial interpolant and preserved monotonicity. However, its drawback is that it is of degree two only. Gregory and Delbourgo [4] introduced a family of rational quadratic functions with quadratic denominator. They exploited the free parameters of the rational quadratic function to preserve the shape of monotone data. Hussain and Hussain [6] used a rational cubic function to preserve the shape of monotone curve data, again by exploiting the free parameters of the function. Hussain and Sarfraz [7] used a rational cubic function with four free parameters. Two parameters are the constraints for the shape preserving monotone data while two parameters are free for the user to refine the shape of monotone curve. Hussain et al. [8] used a rational cubic function and imposed the shape preserving constraints on the functions one free parameter. The aim of this paper is to develop a monotonicity preserving curve interpolant based on rational cubic Bézier basis functions where the sufficient conditions are expressed in terms of the weights. We first derive the sufficient conditions for a rational cubic Bézier univariate function to preserve monotonicity. This is then readily extended to vector valued data.



Corresponding author. E-mail address: [email protected] (R.J. Cripps).

0893-9659/$ – see front matter © 2012 Elsevier Ltd. All rights reserved. doi:10.1016/j.aml.2012.02.050

1162

R.J. Cripps, M.Z. Hussain / Applied Mathematics Letters 25 (2012) 1161–1165

2. Basics Given two end points, P0 and P3 with P3 > P0 , and two end derivatives, D0 and D3 , construct a monotonically increasing rational Hermite interpolant. Expressed as a rational cubic Bézier, we have

P (u) =

3 

p(u)

=

ω(u)

bi,3 (u) ωi Pi

i=0 3 

, bi,3 (u) ωi

i=0

where bi,3 (u) =3 Ci (1 − u)3−i ui are the Bernstein basis functions and Pi i = 0, . . . , 3 are the control points of the Bézier curve. Let the input data be the end points and end derivatives, i.e. P0 = P (0), P3 = P (1); D0 = P˙ (0) & D3 = P˙ (1). Then we require the conditions on the weights, ωi i = 0, . . . , 3 such that R˙ (u) > 0. 3. Analysis The sufficient conditions on the weights of the rational cubic Bézier interpolant to preserve monotonicity is

ω0 ω3 > 3.  ω1 ω2

(1)

Proof Writing ω(u) P (u) = p(u) and differentiating with respect to u gives

ω( ˙ u) P (u) + ω(u) P˙ (u) = p˙ (u). Rearranging gives P˙ (u) =

1

ω(u)

[p˙ (u) − ω( ˙ u) Pu] =

1

ω(u)2

[ω(u) p˙ (u) − ω( ˙ u) p(u)] .

We note that P˙ (0) =

3ω1

(P1 − P0 ) ω0 3ω2 P˙ (1) = (P3 − P2 ) . ω3 Thus for monotonicity we require S (u) = ω(u) P˙ (u) − ω( ˙ u) p(u) = [S0 (u) − S1 (u)] > 0





since ω(u)2 > 0. Now S0 (u) = 3

5 

bi,5 (u)P0,i

and S1 (u) = 3

i =0

5 

bi,5 (u)P1,i ,

i=0

where

P0,0 = ω0 (ω1 P1 − ω0 P0 )

 P0,1 =

3 5

 P0,2 =

 2 ω1 (ω1 P1 − ω0 P0 ) + ω0 (ω2 P2 − ω1 P1 )

1 10

 P0,3 =

3 10

5

ω0 (ω3 P3 − ω2 P2 ) + ω1 (ω3 P3 − ω2 P2 ) +



P0,4

6 10 6 10

ω1 (ω2 P2 − ω1 P1 ) + ω2 (ω2 P2 − ω1 P1 ) +

 3 2 = ω2 (ω3 P3 − ω2 P2 ) + ω3 (ω2 P2 − ω1 P1 ) 5

P0,5 = ω3 (ω3 P3 − ω2 P2 )

5

3 10 1 10

 ω2 (ω1 P1 − ω0 P0 )  ω3 (ω1 P1 − ω0 P0 )

R.J. Cripps, M.Z. Hussain / Applied Mathematics Letters 25 (2012) 1161–1165

and

P1,0 = (ω1 − ω0 ) ω0 P0

 P1,1 =

3

P1,2 =

3 10



1

(ω2 − ω1 ) ω0 P0

5

(ω1 − ω0 ) ω2 P2 +

6 10



(ω2 − ω1 ) ω1 P1 +

6

(ω1 − ω0 ) ω3 P3 +

1 10

(ω3 − ω2 ) ω0 P0

3

(ω2 − ω1 ) ω2 P2 + (ω3 − ω2 ) ω1 P1 10 10 10   3 2 = (ω2 − ω1 ) ω3 P3 + (ω3 − ω2 ) ω2 P2

P1,3 = P1,4

(ω1 − ω0 ) ω1 P1 +

5



2

5

 

5

P1,5 = (ω3 − ω2 ) ω3 P3 . Now 5 

S=3

bi,5 (u) P0,i − P1,i = 3





i=0

5 

bi,5 (u)Pi ,

i=0

where

P0 = ω0 ω1 (P1 − P0 )

 P1 =

1 5

 P2 =

 2 ω0 ω1 (P1 − P0 ) + ω0 ω2 (P2 − P0 ) 5

2 10



1

ω0 ω2 (P2 − P0 ) +

10

ω0 ω3 (P3 − P0 ) +

3

3 10 2

ω1 ω2 (P2 − P1 )

ω1 ω2 (P2 − P1 ) + ω1 ω3 (P3 − P1 ) 10  1 2 ω1 ω3 (P3 − P1 ) + ω2 ω3 (P3 − P2 ) P4 = P3 =

10

ω0 ω3 (P3 − P0 ) +

1

 

10



5

5

P5 = ω2 ω3 (P3 − P2 ) . This quintic is in fact only a quartic, since the sum of all the u5 terms is zero, which can be expressed as B(u) = 3

4 

bi,4 (u)Bi ,

i=0

where

B0 = ω0 ω1 [P1 − P0 ] B2 = B3 =

1 2 1 2

B1 =

1 2

ω0 ω2 [P2 − P0 ]

1

ω1 ω2 [P2 − P1 ] + ω0 ω3 [P3 − P0 ] 6

ω 1 ω 3 [P 3 − P 1 ]

B4 = ω3 ω2 [P3 − P2 ].

Expressing Bi in terms of the input data gives

 ω0 1 ω0 D0 − P0 = ω0 ω1 · D0 = ω02 D0 , 3ω1 3ω1 3   ω0 ω2 ω0 ω2 ω3 B1 = · [P2 − P0 ] = · P3 − D3 − P0 2 2 3ω2 

B0 = ω0 ω1 · [P1 − P0 ] = ω0 ω1 · P0 +

1

[ω0 ω3 · (P3 − P0 ) + 3ω1 ω2 (P2 − P1 )] 6   1 ω3 ω0 = D3 + D0 (ω0 ω3 + 3ω1 ω2 ) (P3 − P0 ) − 3ω1 ω2 6 3ω2 3ω1

B2 =

   ω0 · P3 − P0 − D0 2 2 3ω1   ω3 ω3 1 B4 = ω2 ω3 · [P3 − P2 ] = ω2 ω3 · P3 − P3 + D3 = ω2 ω3 · D3 = ω32 D3 . 3ω2 3ω2 3

B3 =

ω1 ω3

· [P3 − P1 ] =

ω1 ω3

1163

1164

R.J. Cripps, M.Z. Hussain / Applied Mathematics Letters 25 (2012) 1161–1165

Now ωi > 0; Pi > 0 for all i thus if the control values (Bi ) are positive, the bounding box property implies B(u) > 0. Therefore, we require sufficient conditions such that Bi > 0. Considering each Bi in turn. 1

B0 =

3

ω02 D0 ,

and since D0 > 0, B0 > 0.

ω0 ω2

B1 =

  ω3 D3 − P0 . · P3 − 3ω2

2

For B1 > 0, we require

 3

P3 − P0



D3

>

ω3 ω2

(2)

as P2 > 0. 1

B4 =

3

ω32 D3 ,

and since D3 > 0, B4 > 0.

ω1 ω3

B3 =

ω0 · P3 − P0 − D0 3ω1 

2





.

For B3 > 0, we require

 3

P3 − P0



D0

>

ω0 . ω1

(3)

Finally,

B2 =

   ω3 ω0 D3 + D0 . (ω0 ω3 + 3ω1 ω2 ) (P3 − P0 ) − 3ω1 ω2 6 3ω2 3ω1 1

For B2 > 0, we require

(ω0 ω3 + 3ω1 ω2 ) (P3 − P0 ) > 3



1 3

1



ω3 ω1 D3 + ω0 ω2 D0 . 3

(4)

Now, using constraints (2) and (3) in constraint (4) (ensuring B1 & B3 > 0), gives 3ω1 ω2



ω3 D3 ω0 D0 + 3ω2 3ω1



< 3ω1 ω2 [(P3 − P0 ) + (P3 − P0 )] = 6ω1 ω2 (P3 − P0 ) .

Therefore, if (ω0 ω3 + 3ω1 ω2 ) (P3 − P0 ) > 6ω1 ω2 (P3 − P0 ), then

(ω0 ω3 + 3ω1 ω2 ) (P3 − P0 ) > 3ω1 ω2



 ω3 D3 ω0 D0 + . 3ω2 3ω1

Hence,

ω0 ω3 + 3ω1 ω2 > 6ω1 ω2 i.e.

ω0 ω3 > 3.  ω1 ω2

(5)

It is interesting to note that the constraints on the weights, ωi , given in (1) impose conditions on the input data as expected. For example, using constraints (2), (3) and (1) implies D0 D3 < 9



ω1 ω2 ω0 ω3



(P3 − P0 )2

which means that the end slopes are constrained by the chord P3 P0 . This, of course, is a constraint on the initial data and can be used as a pre-check that the original input data is itself monotonic. 4. Conclusion and future research In this study, the rational Bézier cubic interpolant is used to construct a C 1 monotone curve to monotone data. The control points of rational Bézier cubic interpolant are estimated by the cubic Hermite interpolation properties. A range of weight functions is determined for monotone interpolation of irregular curve data. The proposed interpolation scheme works for both computed and prescribed derivatives. Future research will be to extend the approach for the construction of monotonic surface interpolants [9].

R.J. Cripps, M.Z. Hussain / Applied Mathematics Letters 25 (2012) 1161–1165

1165

Acknowledgements The authors would like to thank the anonymous referees for their constructive suggestions for improving the presentation of the article and highlighting the relationship between the weights and end slopes. References [1] F.N. Fritsch, J. Butland, A method for constructing local monotone piecewise cubic interpolants, SIAM Journal of Scientific and Statistical Computing 5 (1984) 300–304. [2] F.N. Fritsch, R.E. Carlson, Monotone piecewise cubic interpolation, SIAM Journal of Numerical Analysis 17 (2) (1980) 238–246. [3] D.J. Higham, Monotone piecewise cubic interpolation with applications to ODE plotting, Journal of Computational and Applied Mathematics 39 (1992) 287–294. [4] J.R. Gregory, R. Delbourgo, Piecewise rational quadratic interpolation to monotonic data, SIAM Journal of Numerical Analysis 3 (1983) 141–152. [5] L.L. Schumaker, On shape preserving quadratic spline interpolation, SIAM Journal of Numerical Analysis 20 (1983) 854–864. [6] M.Z. Hussain, M. Hussain, Visualization of data preserving monotonicity, Applied Mathematics and Computation 190 (2007) 1353–1364. [7] M.Z. Hussain, M. Sarfraz, Monotone piecewise rational cubic interpolation, International Journal of Computer Mathematics 86 (3) (2009) 423–430. [8] M.Z. Hussain, M. Sarfraz, M. Hussain, Scientific data visualization with shape preserving C1 rational cubic interpolation, European Journal of Pure and Applied Mathematics 3 (2) (2010) 194–212. [9] L. Han, L.L. Schumaker, Fitting monotone surfaces to scattered data using C 1 piecewise cubics, SIAM Journal of Numerical Analysis 23 (2) (1997) 569–585.