You are on page 1of 5

Vol.2, No.

6, 641-645 (2010) Natural Science


http://dx.doi.org/10.4236/ns.2010.26080

A simple 2-D interpolation model for analysis of


nonlinear data
Mehdi Zamani

Department of Civil Engineering, Faculty of Technology and Engineering, Yasouj University, Yasouj, Iran; mahdi@mail.yu.ac.ir

Received 1 March 2010; revised 24 April 2010; accepted 13 May 2010.

ABSTRACT polynomial approximation. This method has the advan-


tage of removing the oscillatory nature of high degree
To determination the volume and weight of non-
polynomials. In this approach there exists the continuity
uniform bodies, such as in ore deposits evalua-
of C2 on the segments boundaries. However; the conti-
tion for mining and rock cutting for construction,
nuity order is optional to users willing. The formulation
the methods of interpolation are usually used.
for creating cubic spline curve results in the solution of a
The classic curves, which are frequently used to
interpolate one-dimensional data are cubic spl- three-diagonal system of equations. Hermit interpolation
ine, Bspline and Bezier curves. These methods are based on two points p1 and p2 and two tangent values
have good efficiency for determination of geom- p1' and p2' at those points. It computes a curve seg-
'
etric characteristics of nonregular masses. They ment that starts at p1, going in direction to p1 and ends
'
have some limitations and problems with two- at p2 moving toward p2 . Hermit interpolation has an
dimensional interpolation analysis such as for- important advantage. The Hermit curve can be modified
ming large linear systems of equations with a by changing the tangent values.
lot of entries and difficulty encounter with their The Bezier curve is a parametric curve p(t) that is a
solutions. In this research the two-dimensional polynomial function of the parameter t. The degree of
splines are used, which have the advantages of the polynomial depends on the number of points used to
simplicity and less computational operations ef- define the curve. The method applies control points and
fort. The spline functions that are applied have presents an approximating curve. The Bezier curve does
1
the continuity of C at elements boundaries. The not pass through internal points but the first and last
presented model has suitable efficiency for vo- points. Internal points influence the direction and posi-
lumes of large extents governing to lots of data. tion of the curve by pulling it toward themselves [1-3].
B-spline methods were first proposed in the 1940 for
Keywords: Simulation; Approximation; Least curves and surfaces. The B-spline curves can be ap-
square; Cubic Spline; Optimization; Curve Fitting; proximating or interpolating curves. The advantage of
Prediction
B-spline curves to Bezier curve is the obtaining the
higher continuity for the individual spline segments
1. INTRODUCTION [2-5]. If there are a set of triple data c  {( xi , yi , yi' ),
i  0,1, 2, , n } The cubic spline functions Si(x) can be
The most popular methods for interpolation of data are obtained on each interval [xi, xi+1]. With this model the
Lagrange method, Neville iteration approach, Newton continuity of C1 exists on the boundary of each segment.
divided difference methods, Cubic spline, Hermit spline, The spline function of degree 3 for each interval is:
Bspline and Bezier methods. For the Neville and New-
ton divided difference method, the higher degree of pol-  ai 
b 
ynomial generation is straightforward. In conic spline
approach each curve consists of a number of about n

g i ( x )  ai  bi x  ci x 2  d i x 3  1 x x2 x 
3  i
 ci 
(1)
segment curves. The general way is to divide the interval  
d i 
to collect subintervals or segments and construct differ-
ent approximating polynomial on each interval. Appr- If the Eq.1 is written based on the first point of each
oximation by functions of this type is called piecewise segment (xi , xi+1) then,

Copyright © 2010 SciRes. OPEN ACCESS


642 M. Zamani / Natural Science 2 (2010) 641-645

si ( x )  ai  bi ( x  xi )  ci ( x  xi ) 2  d i ( x  xi ) 3  charge source in the form of vertical leakage, there can


be no stabilization of water levels and the head (h) in the
1  xi xi2 xi3   ai 
   aquifer will continue to decline supposing the aquifer is
1 x x2 
x3 
0
0 1
0
 2 xi
1
3 xi2   bi 
 3 xi2   ci 
(2) infinite in areal extent. However, the rate of decline of
head (h) continuously decreases as the cone of depres-
  
 0 0 0 1   d i  sion spreads. The partial differential equation governing
the unsteady-state radial flow in the nonleaky confined
The first derivatives of the spline function (2) is as aquifer in polar coordinate system is,
follows,
 2h 1  h S  h
si' ( x )  bi  2ci ( x  xi )  3d i ( x  xi ) 2    . (6)
 r2 r  r T t
1  2 xi 3 xi2   bi 
1    (3) The Theis solution for the above partial differential
x x 2
0 2  6 xi   ci  equation is,
0 0 3   d i 
 Q  eu
4T u u
s  h0  h  du . (7)
The coefficients ai , bi , ci and d i for each interval
can be obtained explicitly from the Eq.5. Theis approximated the above equation by the fol-
 a i  s ( xi )  f i lowing series,
 b i  s ' ( xi )  f i '
 Q  u2 u3 
 c  3 ( f  f )  1 ( f '  2 f ') , h0  h    0 . 5772  log u  u    
4T 2  2 ! 3  3!
e
 i h 2 i 1 i i 1 i (4)  
hi
 i
(8)
 d i   2 ( f i 1  f i )  1 ( f i ' 1  f i ' )
 hi3 hi2 where,

where hi is the element size or the element interval (hi = 1.87r 2 S


u
xi+1 – xi). The problem with this approach is that we Tt
generally don’t have the tangent values at n + 1 point. s = drawdown, in feet,
This can be provided by applying the following ap- Q = discharge, in gpm,
proximation equations (forward difference, central dif- t = time after pumping started, in days,
ference and backward difference approximation, respec- T = coefficient of transmisivity, in gallons per day per
tively) for the first derivatives at the points and for uni- foot (gpd/ft) and
form intervals hi. S = coefficient of storage, dimensionless.
 ' 1 The value of brackets equals W(u). The data for in-
 fi  [ 3, 4,1] terpolation have logarithm values of W(u) respect to u
 2hi 
 ' 1 [6]. For the interpolation of data about ten points are
 f i  2h [1, 0 , 1 ] , (5) considered. Figure 1 shows the comparison between the
 i

 f '  1 [1,  4, 3 ]
 i 2hi 
W(u) vs u
The following two examples show the interpolation of
two sets of data by the above approach.

2. EXAMPLES
W(u)
2.1. Example 1 model
W(u)
This example is in the field of groundwater engineering.
When a production well in unconfined aquifer is pumped,
water is continuously withdrawn from storage within the u
aquifer as the cone of depression progresses radially
outward from the well. Because of the absence of a re- Figure 1. The comparison between the data and the model.

Copyright © 2010 SciRes. OPEN ACCESS


M. Zamani / Natural Science 2 (2010) 641-645 643

data and the model for the nine spline curves. Based on obtains. Then, the formulation for determination of the
the figure there is a suitable and good relationship be- coefficient will be simpler.
tween those.
sij ( x , y )  a 0  a1 ( x  xi )  a2 ( y  y j )  a3 ( x  xi ) 2
2.2. Example 2
 a4 ( x  xi )( y  y j )  a5 ( y  y j ) 2
In this problem about five pairs of data are obtained (12)
 a6 ( x  xi ) 3  a7 ( x  xi ) 2 ( y  y j )
from the parametric Eq.9 with non-uniform segments.
 a8 ( x  x j )( y  y j ) 2  a9 ( y  y j ) 3
  
 x  t cos 12  2 sin 2t sin 12 or in matrix notation it is,
 , t  [0, 24] . (9)
 
 y  t sin  2 sin 2t cos  1  xi
 12 12 xi2  xi3 
 
About four cubic spline curves are generated accord- sij ( x, y )  1 x x2 
x3 
0 1
0 0
 2 xi
1
3 xi2 
 3 xi 
ing to the formulations of Eqs.3, 4 and 5. Figure 2  
shows the relationship between the real values and in- 0 0 0 1 
terpolated ones. As it can be seen, there is a relative ex-  1 0 0 0  1  .
pectable fitness between them.  y 1 0 0  y 
A  2 i
3. FORMULATION FOR 2-D yi  2 yi 1 0  y 2 
 3  
INTERPOLATION   yi 3 yi2  3 yi 1  y 3 

(13)
The bicubic spline formation that applies hear for two
dimensional interpolation and four nodes patch is, The above bispline function has ten parameters (un-
knowns) for each segment or patch. Therefore; ten equa-
g ij ( x , y )  a 0  a1 x  a2 y  a3 x 2  a4 xy  a5 y 2  a6 x 3 
tions are required for defining them. Four equations sat-
a7 x 2 y  a8 xy 2  a9 y 3 isfy the function values at each corner and six equations
(10) satisfying partial derivative in x and y directions for
or in matrix notation, three nodes. Thus there exists the continuity of C1 on


g ij ( x, y )  x A y  1 x x2 x3  each of four sides or boundaries of every element. The
first derivatives in x and y direction for the Eq.12 are:
a0 a2 a5 a9   1 
1  2 xi 3 xi2 
a 0   y  sij ( x, y )
 
a4 a8
 1 . (11) 2  
 a3  1 2 x 3 x 0 1  3 xi 
a7 0 0  y2  x
   0 0 1 
a6 0 0 0   y3  

If the above equation is written based on ( xi , yi ) or the  a1 a4 a8   1 0 0  1  .


a  
coordinates of the lower left point on each segment, Eq.12  3 a7 0    y j 1 0   y 
 a 6 0 0   y 2j  2y j 1   y 2 
(14)
1  xi xi2 
s ij ( x , y )
y

1 x 2
x 0  1

 2 xi 
y 0 0 1 

.
a2 a5 a9   1 0 0  1 
a  
 4 a8 0    2 y j 1 0   2 y 
 a 7 0 0   3 y 2j  3y j 1  3 y 2 

x (15)
The coefficients a0 , a1 , , a9 can be derived explicitly
Figure 2. The comparison between the data and the model. from satisfying the following conditions,

Copyright © 2010 SciRes. OPEN ACCESS


644 M. Zamani / Natural Science 2 (2010) 641-645

 sij (i, j ) 2 1 2 1
sij (i, j )  a0  f ij ,  a1  f x',ij , a9  a 0  2 a 2  3 f i , j 1  2 f y' ,ij 1  (30)
x k 3j kj kj kj
 sij (i, j ) (16)
 a2  f y' , ij where hi  xi 1  xi , k j  y j 1  y j ,
y
f f
 sij f x',ij 1  (i, j  1) , f y' ,i1 j  (i  1, j ) . (31)
(i  1, j )  a1  2hi a3  3h a 6  f 2 '
x , i 1, j x y
x , (17)
i

 sij 4. PROBLEM 3
(i, j  1)  a2  2k j a5  3k 2j a9  f y' , i , j 1 ,
y (18)

 sij For testing the above formulation several problems were


(i  1, j )  a 2  hi a 4  hi2 a7  f y' ,i 1, j , considered. Here only one of them is presented. The data
y (19)
for this problem are obtained from the Eq.32.
 sij
(i, j  1)  a1  k j a 4  k 2j a8  f x',i , j 1 , z ( x, y )  4 e  ( 0.0867 x
2
 0 .5 y 2 )
, x, y  [0,6]  [0,3] (32)
x (20)
s ij (i  1, j )  s i 1, j (i  1, j )  The domain of problem consists of 9 elements and 16
nodes. The elements are uniform where hi  2 and
a 0  hi a1  h a 3  h a 6   f i 1, j ,
2 3 (21)
i i
ki  1 . The above formulations were applied to to the
s ij (i , j  1)  s i , j 1 (i , j  1)  governing data. Figure 3 shows the interpolation curves
along x = 0, x = 2, y = 0 and y = 2. As it can be seen the
a 0  k j a 2  k 2j a 5  k 3j a 9   f i , j 1 , (22)
2-D model presents a close relationship to the relating
s ij (i  1, j  1)  s i 1, j 1 (i  1, j  1)  a 0  hi a1 set of data.
 k j a 2  hi3 a 3  h i k j a 4  k 2j a 5  hi3 a 6  hi2 k j a 7 (23)
5. THE RESULTS AND CONCLUSIONS
 hi k 2j a 8  k 3j a 9  f i 1, j 1
In this research two models for 1-D and 2-D interpola-
The above ten equations give a linear system of equa-
tions were presented. The models are easy and straight-
tions. If it is solved analytically the governing parame-
ters are obtained as follows, forward to handle. Therefore; it can be applied for prob-
lems having huge data. It has the advantage of less
3 2 3 1 '
a3   2
a0  a 1  2 f i 1, j  f x , i 1 j , (24) computational efforts respect to the cubic spline, Bezier
hi hi hi hi and B-spline methods especially for 2-D problems. The
1 1 1 continuity for each segment is C1 therefore; this is suffi-
a4   a0  a1  a 2  cient for many problems such as calculation of surfaces
hi k j kj hi
and volumes of nonuniform bodies. It is recommended
1 1 ' , (25)
( f i 1, j  f i , j 1  f i 1, j 1 )  f x ,i j 1 to compare the 2-D model with Bezier and B-spine
hi k j kj methods respect to the fitness and accuracy.
3 2 3 1 '
a5   a0  a2  2 f i , j 1  f y ,ij 1 , (26)
k 2j kj kj kj comparison
4.5
2 1 2 1
a6  a 0  2 a1  3 f i 1, j  2 f x' ,i 1 j , (27)
4
hi3
hi hi hi f(x, y)
3.5
model
1 1 1 f(x, y) 3
a7   2
a0  a1  2 2.5
h kj
i hi k j hi k j f(x, 0)
2 f(x, 2)
1 , (28) 1.5
( f i 1, j  f i , j 1  f i 1, j 1 )  f x',ij 1
hi k j 1 f(2, y)
f(02, y)
0.5
1 1 1
a8  a 
2 0
a2  ( f i 1, j  0
hi k j hi k j hi k 2j 0 1 2 3 4 5 6
, (29) x, y
1
f i , j 1  f i 1, j 1 )  f y' ,i 1 j
hi k j Figure 3. The comparison between the data and 2-D model.

Copyright © 2010 SciRes. OPEN ACCESS


M. Zamani / Natural Science 2 (2010) 641-645 645

cal analysis, an algorithm approach. Kin Keong Printing


Co. Pte. Ltd., Singapore.
REFERENCES [4] Burden, R. and Fairs, D. (1989) Numerical analysis.
PWS-Kent Publishing Company, Boston.
[1] Salmon, D. (2006) Curves and surfaces for computer
[5] March, D. (2005) Applied geometry for compute graph-
graphics. Springer, New York.
ics and CAD. 2nd Edition, Springer-Verlag, New York.
[2] Saxena, A. and Sahay, B. (2005) Computer aided engi-
[6] Todd, D.K. (1959) Groundwater hydrology. John Wily &
neering design. Springer, Anamaya Publisher, New Delhi.
Sons, Inc., New York.
[3] Conte, S.D. and de Boor, C. (1981) Elementary numeri-

Copyright © 2010 SciRes. OPEN ACCESS

You might also like