<<

Monotonicity Preserving using Rational Muhammad Abbas,Ahmad.Abd Majid,Mohd Nain Hj Awang and Jamaludin.Md.Ali

Abstract—The main spotlight of this work is to visualize The problem of monotonicity preserving has been the monotone data to envision of very smooth and pleasant considered by number of authors [1]-[19] and references monotonicity preserving curves by using piecewise rational therein. Hussain & Sarfraz [1] has developed monotonicity . The piecewise rational cubic function has three shape parameters in each interval. We derive a simpler con- preserving interpolation by rational cubic function with strains on shape parameters which assurance to preservation four shape parameters which are arranged as two are free of the monotonicity curve of monotonic data. The free shape and the other two are automated shape parameters. The parameters will provide the extra freedom to the user to authors derived data dependent constraints on automated interactively generate visually more pleasant curves as desired. shape parameters which ensure the monotonicity and also The smoothness of the interpolation is C1 continuity. provide very pleasant curves but one automated shape Index Terms—Rational cubic function, monotone data, shape parameter is dependent on the other and hence the scheme parameters, free shape parameters, Interpolation. is economically very expensive.

I.INTRODUCTION Fritch & Carlson [2] and Butland [3] have developed Moothness and pleasant shape preserving curves is very a piecewise cubic monotonicity preserving S important in Computer aided Geometric design (CAGD), interpolation. With positive derivatives and increasing data (CG), and Data Visualization (DV).In in the cubic Hermite Polynomials they still violate the these fields, it is often needed to produce a monotonicity necessary monotonicity condition. These authors are made preserving interpolating curve corresponding to the given a modification in input derivatives in their interpolating monotone data. The one very important feature from the schemes if they contravene the necessary monotonicity interpolation methods is that make good judgment to study conditions. Schumaker [5] developed a very economical is its positivity and monotonicity which are important interpolation by piecewise quadratic but the aspects of the shape. Many physical situations where author also for interpolation they put in an extra knot entities are taken only monotone. In [14], monotonicity is in each interval. The constructed interpolant preserve the applied in the specification of Digital to Analog Converters monotonicity but have degree 2.Butt [18] & Higham [4] (DACs), Analog to Digital Converters (ADCs) and sensors. also used a piecewise cubic polynomials in which the These devices are used to control system applications where derivatives are not modified but the authors inserted extra non monotonicity is not acceptable. In cancer patients, knots where the curve lost the monotonicity. Gregory & Erythrocyte sedimentation rates (ESR) and Uric acid level Delbourgo [6] has introduced a solution of monotonicity in the patients who are suffering from gout are providing without inserting an extra knot and preserves monotonicity monotone data see[14]. Approximation of couples and quasi by rational quadratic function with quadratic denominator. couples in statistics see [16], rate of dissemination of drug Fahr and Kallay [7] used a monotone rational B-spline of in blood see [16], empirical option of pricing models in degree one to preserve the shape of monotone data. finance see [16] are good examples of monotone data. Also in Engineering, the study of tensile strength of the material For the pithiness of monotonicity preserving interpolation which give the monotone data because the tensile strength the reader is referred to: Delbourgo & Gregory [8] has of a material can be defined as the maximum force that a developed piecewise rational cubic interpolation for the material can withstand before breaking see for detail[12]. preserving monotonicity with no freedom to user to refine The forced applied usually is called stress and is studied the curve. Gregory & Sarfraz [9] introduced a rational alongside the stretch of the material referred as strain. So cubic spline with one tension parameter in each subinterval. the data from these two entities is always monotone see for Sarfraz [10] & [11], Hussain & Hussain [12] and Sarfraz detail [12]. & Hussain [13], Sarfraz et al [17] have introduced rational cubic function with two shape parameters that provide the desired monotone curves but there is no freedom for Manuscript received September 03, 2010; revised December 31, 2010. the user to modify the curves hence is may be unsuitable This work was fully supported by the Universiti Sains Malaysia under Grant FRGS(203/PJJAUH/6711120). for interactive design. Hussain et al [14] also developed Muhammad Abbas is with the School of Mathematical Sciences,Universiti a rational function for the preserving monotonicity with Sains Malaysia,USM 11800 Pulau Pinang, Malaysia, Corresponding single shape parameter which is very economical and E-mail:[email protected]. Ahmad.Abd Majid is with the School of Mathematical Sciences,Universiti generates pleasant curve but have limited flexibility in Sains Malaysia,USM 11800 Pulau Pinang, Malaysia. particular curves modification. Sarfraz [15] introduced Mohd Nain Hj Awang is with the School of Distance Education, Universiti an C2 interpolant using a general piecewise rational Sains Malaysia,USM 11800 Pulau Pinang, Malaysia. Jamaludin.Md.Ali is with the School of Mathematical Sciences,Universiti cubic (GPRC) with two shape parameters to preserves Sains Malaysia,USM 11800 Pulau Pinang, Malaysia. the monotonicity but there is also no freedom to the user as well as the scheme is expansive than the proposed scheme. In this paper, ui, vi are free parameters which can be used freely for the modification of the curve and wi be the This work is particularly concerned with the monotone automated shape parameter which preserves the monotonicity data using the cubic rational function with three shape of monotone data. parameters, they are arranged in such a manner that two shape parameters are provide extra independence to the B. Determination of Derivatives user to modify the curve as desired and the other one is constrained to satisfy the monotonic properties of curves Mostly the derivative values or parameters {di} are not through monotone data. In section (I-C), we show how the given then it has been derived by two means which one single parameter produces monotonicity preserving curve from the give data set (xi, fi), i = 1, 2, 3, ...... , n or by through monotone data which are given in Tables I,II and some other methods. In this paper, we are determined from III, also providing an interactive and pleasant curve as the given data for the smoothness of interpolant (1). These compared to [14] while the other two shape parameters methods are the approximation based on many mathematical are used to refine the curve as desired by the user. In the theories.The following two method are borrowed from Hus- proposed scheme there is no insertion of extra knot and is sain & Sarfraz [1]. The descriptions of such approximations also more economical as compared to the existing schemes. are as follow: 1) Arithmetic Mean Method: This method is the three The rest of this paper is organized as follows. we construct point difference approximation with a rational cubic function in section (I-A) and the deter- ½ 0 if ∆i−1 = 0 or ∆i = 0 mination of the derivatives is given in section (I-B). The di = ∗ di otherwise , i = 2, 3, .....n − 1 construction of the monotonicity preserving interpolation for (6) monotone data in section (I-C) and some numerical examples And the end conditions are given as, are discussed in section (I-D). Finally the conclusion of the ½ ∗ paper is discussed in section (II). 0 if ∆1 = 0 or sgn(d1) 6= sgn(∆1) d1 = ∗ d1 otherwise A. Rational cubic function ½ (7) 0 if ∆ = 0 or sgn(d∗ ) 6= sgn(∆ ) 1 n−1 n n−1 In this section, a C rational cubic function [19] with dn = ∗ dn otherwise three shape parameters with cubic denominator has been (8) developed. Let {(xi, fi) , i = 0, 1, 2, ...... n} be a given set Where of data points defined over the interval [a, b], where a = ∗ 1 di = (hi∆i−1 + hi−1∆i)/(hi + hi−1) x0 < x1 < ...... < xn = b. The C piecewise rational ∗ d1 = ∆1 + (∆1 − ∆2)h1/(h1 + h2) cubic function with three parameters are defined over each ∗ dn = ∆n−1 + (∆n−1 − ∆n−2)hn−1/(hn−1 + hn−2) subinterval Ii = [xi, xi+1], i =0, 1, 2,. . . ,n -1 as: p (θ) 2) Geometric Mean Method: These are non-linear approx- S(x) = S (x) = i (1) i q (θ) imations which are defined as: i ½ with 0, if ∆i−1 = 0 or ∆i = 0 di = hi/hi−1+hi hi−1/hi−1+hi p (θ) = u f (1 − θ)3 + (w f + u h d ) θ(1 − θ)2 ∆i−1 ∆i , i = 2, 3, 4, ..., n − 1 i i i i i i i i (9) + (w f − v h d ) θ2 (1 − θ) + v f θ3 i i+1 i i i+1 i i+1 The end conditions are given as: q (θ) = u (1 − θ)3 + w θ(1 − θ) + v θ3 i i i i  f3−f1 where  0, if ∆1 = 0 or ∆3,1 = = 0 n o x3−x1 fi+1 − fi d1 = h1/h2 (10) h = x − x , ∆ = (2) ∆1 i i+1 i i  ∆1 , otherwise hi ∆3,1

(x − xi)  θ = , 0 ≤ θ ≤ 1 (3)  fn−fn−2 0, if ∆n−1 = 0 or ∆n,n−2 = x −x = 0 hi n o n n−2 dn = hn−1/hn−2 ∆n−1  ∆n−1 , otherwise The rational cubic function (1) has the following properties, ∆n,n−2 (11) S(xi) = fi,S(xi+1) = fi+1 S 0(x ) = d ,S 0(x ) = d (4) i i i+1 i+1 C. Monotonicity Preserving Interpolation 0 Where S (x) denotes the derivative with respect to ‘x’ and The rational cubic function in section (I-A) does not di denotes the value of the derivative at the knots xi. It is provide a guarantee to preserves monotonicity curve of the very easy to prove the existence and uniqueness of the in- monotone data (see Fig.1, Fig.4 & Fig.7). It appears that cu- terpolation for given data (xi, fi) with parameters ui, vi, wi. bic Hermite spline scheme does not provide the desired shape It is interesting that when ui = 1, vi = 1 and wi = 3 in features thus some further treatment is required to attain a each interval Ii, the piecewise rational cubic functions (1) pleasant and interactive shape from the given monotone data. reduce to the standard cubic Hermite interpolation shown in To proceed with this approach, some mathematical treat- (5). ments are required which will be shown in the following 2 2 Si(x) = (1 − θ) (1 + 2θ)fi + θ (3 − 2θ)fi+1 steps. 2 2 (5) + θ(1 − θ) hi di − θ (1 − θ)hi di+1 Let (xi, fi), i = 1, 2, 3, ..., n be a given monotone data set, where x1 < x2 < x3 < ... < xn . Thus for monotone summarized as: increasing(use same approach for monotone decreasing data) Theorem 1.1: The piecewise C1 rational cubic inter- f ≤ f , i = 1, 2, 3, ..., n (12) i i+1 polant S(x) , defined over the interval [a,b] in (1), is preserve Suppose hi = xi+1 − xi, ∆i = (fi+1 − fi)/hi and di, i = the monotonicity if in each subinterval Ii = [xi, xi+1] , the 1, 2, 3, ..., n be the derivative values at xi, i = 1, 2, 3, ..., n . following sufficientn conditions are satisfied: o uidi vidi+1 uidi+vidi+1 Moreover, for the monotonic interpolation Si(x) , it is then wi > max 0, , , ∆i ∆i ∆i necessary that the derivative should be as given below The above resultn can be rearranged as: o For ∆i = 0, uidi vidi+1 uidi+vidi+1 wi = li + max 0, , , , li > 0 ∆i ∆i ∆i di = di+1 = 0 (13)

And for ∆i 6= 0 , D. Numerical Examples sgn(di) = sgn(di+1) = sgn(∆i) (14) 1) : In this example, the monotone data is taken from [1] The main focus to preserve the monotonicity of rational as shown in Table I. Fig.1 is the curve generated by using function (1) is to assign suitable values to shape parameters cubic Hermite spline scheme with this monotone data, but ui, vi & wi. does not preserve the monotonicity. To remove this obscurity, We are discussing two cases for monotonicity preserving we show the visualization of the same monotone data in Fig.2 interpolation. with ui = vi = 0.1 & Fig.3 with ui = vi = 3.0 using 1) Case.1: When we have ∆i = 0 , then di = 0 .In this developed rational cubic interpolation scheme in section case S(x) reduces to (I-C) to preserve the shape of monotone data. Fig.3 is the improvement of Fig.2 which is visually more pleasant curve. Si(x) = fi ∀x ∈ [xi, xi+1] (15) So is a monotone. TABLE I 2) Case.2: When we have ∆i 6= 0 , and then Si(x) is (1) MONOTONE DATA monotonically increasing if and only if Si (x) ≥ 0 ∀x ∈ (1) i 1 2 3 4 5 [xi, xi+1] .So we calculate Si (x) which after simplification is given as xi 0 6 10 29.5 30 fi 0 15 15 25 30 P6 6−k k (1) k=1(1 − θ) θ Ak,i Si (x) = 2 (16) {qi(θ)}

Where 30 2 A1,i = vi di+1 25 A2,i = A1,i + 2vi(wi∆i − diui) 20

A3,i = A2,i − A1,i + 3uivi∆i + wi(wi∆i − uidi − vidi+1) 15 A4,i = A5,i − A6,i + 3uivi∆i + wi(wi∆i − uidi − vidi+1) 10 A5,i = A6,i + 2ui(wi∆i − di+1vi) y−axis 2 5 A6,i = ui di 0 1 So Si (x) ≥ 0 ∀x ∈ [xi, xi+1], if −5

−10 Ak,i ≥ 0 , k = 1, 2, 3, ...., 6 0 5 10 15 20 25 30 x−axis Where the necessary conditions Fig. 1. Cubic Hermite Spline di ≥ 0 , di+1 ≥ 0, ui ≥ 0 & vi ≥ 0 (17) must be hold.

It is obvious that both A1,i & A6,i are positive from 30 (17).However,A2,i ≥ 0 if 25 uidi wi > (18) ∆i 20

Similarly, A5,i ≥ 0, if 15 y−axis

vidi+1 10 wi > (19) ∆i 5 Finally, both A3,i & A4,i are positive if 0 0 5 10 15 20 25 30 uidi + vidi+1 x−axis wi > (20) ∆i Fig. 2. Developed piecewise rational cubic function with ui = vi = 0.1 So constraints on wi are efficient & reasonably acceptable choice to use the condition given above in (18- 20) can be 30 90

80 25

70

20 60

15 50 y−axis y−axis

40 10

30

5 20

0 10 0 5 10 15 20 25 30 5 10 15 x−axis x−axis

Fig. 3. Developed piecewise rational cubic function with ui = vi = 3 Fig. 6. Developed piecewise rational cubic function with ui = vi = 7

2) : The monotone data is taken from [1] as shown in 3) : In this example, the monotone data is taken from [14] Table II. Fig.4 is generated by cubic Hermite spline which as shown in Table III. Fig.7 is generated by cubic Hermite loses the monotonicity. To remove this flaw, we show the spline scheme which does not preserve monotonicity. Fig.8 visualization of the same monotone data in Fig.5 with ui = with ui = vi = 0.1 & Fig.9 with ui = vi = 3.0 are generated vi = 0.1 & Fig.6 with ui = vi = 7.0 using developed by developed rational cubic interpolation given in section rational cubic interpolation which nicely preserve the shape (I-C) that preserve the shape of monotone data. However, of monotone data. Fig.6 is the improvement of Fig.5 which Fig.9 which is the improvement of Fig.8 is visually more is also visually more pleasant curve. pleasant curve.

TABLE II TABLE III MONOTONE DATA MONOTONE DATA

i 1 2 3 4 5 i 1 2 3

xi 5 6 11 12 15 xi 1760 2650 2760 fi 10 11 15 50 85 fi 500 1360 2940

90 3000

80 2500 70 2000 60

50 1500

40 1000 y−axis y−axis 30 500 20 0 10

0 −500

−10 −1000 5 10 15 1600 1800 2000 2200 2400 2600 2800 x−axis x−axis

Fig. 4. Cubic Hermite Spline Fig. 7. Cubic Hermite Spline

90 3000

80

2500 70

60 2000

50 y−axis y−axis

40 1500

30 1000 20

10 500 5 10 15 1600 1800 2000 2200 2400 2600 2800 x−axis x−axis

Fig. 5. Developed piecewise rational cubic function with ui = vi = 0.1 Fig. 8. Developed piecewise rational cubic function with ui = vi = 0.1 3000 [10] M.Sarfraz,”A rational spline for the visualization of monotone data”,Comput.Graph.24(2000),pp.509-516 [11] M.Sarfraz, ”A rational spline for the visualization of monotone data: 2500 alternative approach”, Comput.Graph, 27(2003), pp.107-121. [12] M.Z.Hussain and M.Hussain, ”Visualization of data preserving mono- 2000 tonicity”, Appl.Math.Comput.190 (2007), pp. 1353-1364. [13] M.Sarfraz and M.Z.Hussain, ”Data visualization using rational spline y−axis interpolation”, J.Comput.Appl.Math.189 (2006), pp.513-525. 1500 [14] M.Z.Hussain,M.Sarfraz and M.Hussain, ”Scientific data visualiza- tion with shape preserving C1 rational cubic interpolation”,3(2) 1000 (2010),pp.194-212. [15] M.Sarfraz, ”A C2 rational cubic spline alternative to the NURBS”,

500 Comput.Graph.24 (2000), pp. 509-516. 1600 1800 2000 2200 2400 2600 2800 x−axis [16] G.Beliakov, ”Monotonicity preserving approximation of multivariate scattered data”, BIT, 45(4), (2005), 653-677. [17] M.Sarfraz,S.Butt and M.Z.Hussain, ”Visualization of shaped data by a Fig. 9. Developed piecewise rational cubic function with ui = vi = 3 rational cubic ”,Comput.Graph.25(5)(2001),pp.833- 845. [18] S.Butt,”shape preserving curves and surfaces for computer graph- ics”, Ph.D. Thesis, School of computer studies ,University of ONCLUSION UGGESTIONS II.C &S Leeds,Leeds,England,1991. In this work the problem of shape preserving of mono- [19] M.Abbas,J.M.Ali and A.A.majid, ”A rational spline for preserving the shape of positive data”,Proc.IEEE,2010 International Conference tonicity curves which is nicely controlled by piecewise ration on Intelligence and Information Technology,Oct 28-30,(2010),Lahore cubic spline is proposed. Simple data dependent constraints Pakistan VI.pp 253-257. are developed in the description of rational cubic function with three shape parameters with two are free shape param- eters provided to the user to refine the shape as desired and other one is the automated shape parameter. The advanta- geous features on the existing schemes are: no extra knots are inserted to preserve the monotonicity of monotone data. The schemes [10], [11], [12], [13] and [17] are developed by using rational cubic function with two shape parameters that generates a nice monotonicity preserving curves but they have no degree of freedom. The method [14] is developed by using rational cubic function with single shape parameter to preserve the monotonicity but also has limited flexibility of the curves. Further, unlike [10], no derivative constraints are imposed. So, the our method applies on equally to data or data with given derivatives. The method developed in this paper is not only local and computationally economical but visually pleasant and interactive as well. Thus the method in section (I-C) is more flexible and may be more suitable for interactive CAD. Extension to monotone surfaces is under process.

ACKNOWLEDGMENT The authors are grateful to the anonymous referees for their helpful, valuable comments and suggestions in the improvement of this manuscript.

REFERENCES [1] M.Z.Hussain and M.Srafraz,”Monotone piecewise rational cubic interpolation”,International.J.Comput.Math.86(2009),pp.423-430 [2] F.N.Fritch and R.E.Carlson, ”Monotone piecewise cubic interpola- tion”,SIAM J.Numer.Anal.17(2) (1980),pp.238-246 [3] F.N.Fritch and J.Butland, ”A method for constructing local monotone piecewise cubic interpolation”,SIAM J.Sci.Stat.Comput.5(1984),pp.300-304 [4] D.J.Higham, ”Monotone picewise cubic interpolation with applications to ODE plotting”,J.Comput.Appl.Math.39(1992),pp.287-294 [5] L.L.Schumaker, ”On shape preserving quadratic spline interpola- tion”,SIAM J.Num.Anal.20(1983),pp.854-864 [6] J.A.Gregory and R.Delbourgo, ”Piecewise rational quadratic interpola- tion to monotone data”,SIAM J.Numer.Anal.3(1983),pp.141-152 [7] R.D.Fahr and M.Kallay, ”Monotone linear rational spline interpola- tion”,Comput.Aided Geomet.Design 9(1992), pp.313-319 [8] R.Delbourgo and J.A.Gregory, ”Shape preserving piecewise rational interpolation”, SIAM J.Stat.Comput.6(1985),pp. 967-976 [9] J.A.Gregory and M.Sarfraz , ”A rational spline with tension”, Com- put.Aided Geomet.Design 7(1990),pp.1-13