INTPOL: linear interpolation, inverse interpolation, cubic Akima interpolation, differentiation, integration (H)

⇒Home ⇒Contents ⇒more on Numerics
(⇒Optional Keywords Syntax)

Bookmarks:
  ⇒cubic akima interpolation   ⇒extrapolation   ⇒first derivative   ⇒interpolated roots   ⇒linear interpolation   ⇒numeric integration   ⇒second derivative   ⇒y interpolated

Optional keywords:
D2ydx DYdx ERror Find Init X2 Xi XVector YVector
keyword type mini sample keyword sequence is insignificant

XVector

vec XV=year (

required

) a vector with N nodes of the independent variable in rising order
  • nodes may be unequally spaced

YVector

arr YV=linear (

required

)
  • linear interpolation (XV and YV have same length):
    • REAL :: x_linear(N), y_linear(N)
  • cubic interpolation (YV has 4 times the elements of XV):
    • REAL x_cubic(N), y_cubic(4,N)
    • For x < node(2) or x > node(N-1): Interpolation is always linear. This means that

      extrapolation

      is also linear.
    • the outermost 2 nodes determine the

      slope at boundaries

      (force boundary slopes by inserting extra nodes close to the first/last node)
    • the Akima polynomial coefficients are in y(N+1, ..., 4*N) after the 1st call with Init

Init

--- Init (

required on 1st call to cubic interpolation

) to initialize the Akima coefficients

Xi

num X=3.1 interpolate at Xi,

default is Xi=0

X2

num x2=3.9 integrate the interpolated data from Xi to X2

Find

num find=y find x closest to Xi with interpolated value equal to y

DYdx

--- dy 1st derivative of interpolated data at Xi
DYdx num dy=yprime find x closest to Xi with 1st derivative equal to yprime

D2ydx

--- d2y 2nd derivative of interpolated data at Xi
D2ydy num d2y=y2prime find x closest to Xi with 2nd derivative equal to y2prime

ERror

LBL ER=99 on error jump to ⇒ label 99

How your donation will be used, and how to get a HicEst key code in return


©2000-2010 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum