an algorithm for high order polynomial extrapolation

2
1428 SHORT COMMUNICATIONS AN ALGORITHM FOR HIGH ORDER POLYNOMIAL EXTRAPOLATION R. PARKER Department of Mechanical Engineering, University College of Swansea, U.K. In some finite difference computations, values at the computational boundaries may be most conveniently found by extrapolation from the internal nodes and a high order polynomial relationship is necessary if complicated variations of the dependent variables are likely to arise. For such computations, a set of coefficients must be generated for the various internal points and these are, for low order polynomials, generally written into the expressions in the computer program used. For high order polynomials a loop is usually more efficient and the coefficients may then be stored in an appropriate array. There are a number of ways of generating the coefficients but, when requiring to do this, the author found that the literature did not appear to contain a convenient algorithm; while the processes used for finding coefficients for low order extrapolations are not normally satisfactory for high order extrapolations. This is particularly true where the user may wish to program a calculation so that the number of internal points used for extrapolation can be varied. An algorithm for equally spaced points is developed below which proved to be remarkably simple and which allows any order of polynomial to be used. Using unit spacing between nodes we wish to find y(0) from known values of y(l), ~(21,. . . ,y(n), assuming ~ (x)=c~+c~x+c~x~, . . . , +cn-lxfl-l. The known values of y are therefore related to the coefficients by where and 1 1 1 : 1 2 4 : 1 3 9 : [A]= : : : : . . . . 1 : 1 n n 2 : 0029-5981/79/0914-1428 $01.00 @ 1979 by John Wiley & Sons, Ltd. . . . . . . 1 . . . . . . . . . . . . . . . . Received 8 February 1979

Upload: r-parker

Post on 15-Jun-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An algorithm for high order polynomial extrapolation

1428 SHORT COMMUNICATIONS

AN ALGORITHM FOR HIGH ORDER POLYNOMIAL EXTRAPOLATION

R. PARKER

Department of Mechanical Engineering, University College of Swansea, U.K.

In some finite difference computations, values at the computational boundaries may be most conveniently found by extrapolation from the internal nodes and a high order polynomial relationship is necessary if complicated variations of the dependent variables are likely to arise. For such computations, a set of coefficients must be generated for the various internal points and these are, for low order polynomials, generally written into the expressions in the computer program used. For high order polynomials a loop is usually more efficient and the coefficients may then be stored in an appropriate array.

There are a number of ways of generating the coefficients but, when requiring to do this, the author found that the literature did not appear to contain a convenient algorithm; while the processes used for finding coefficients for low order extrapolations are not normally satisfactory for high order extrapolations. This is particularly true where the user may wish to program a calculation so that the number of internal points used for extrapolation can be varied.

An algorithm for equally spaced points is developed below which proved to be remarkably simple and which allows any order of polynomial to be used.

Using unit spacing between nodes we wish to find y(0) from known values of y( l ) , ~ ( 2 1 , . . . ,y (n) , assuming ~ ( x ) = c ~ + c ~ x + c ~ x ~ , . . . , +cn-lxf l - l .

The known values of y are therefore related to the coefficients by

where

and

1 1 1 : 1 2 4 : 1 3 9 :

[ A ] = : : : : . . . . 1 : 1 n n 2 :

0029-5981/79/0914-1428 $01.00 @ 1979 by John Wiley & Sons, Ltd.

. . . . . . 1 . .

. . . . . . . . . . . . . .

Received 8 February 1979

Page 2: An algorithm for high order polynomial extrapolation

SHORT COMMUNICATIONS 1429

Thus the coefficients of the series may be found by inverting the matrix A and multiplying by the vector Y, i.e.

Finding the inverse matrix presents no difficulty for small n, but for larger n the wide range of

Furthermore, the time required for complete inversion is not justified as we only require to

It can be shown that the first line is given by the sequence

the terms results in serious errors and standard inversion programs cannot be used.

find y ( 0 ) which is equal to Co for which only the first line of the inverse matrix is needed.

n(n - 1) 2 !

n ( n - l> (n - 2 ) 3!

, . . . , ( - 1 y +n, -- ,+

If the terms of this sequence are indicated by K 1 to Kn the algorithm for generating them is

K J = - K ~ - l - ; J = 2 , n (" +; - "> and the extrapolation is achieved by summing the series

n

v ( O ) = c Krny(m) m = l