Subject: Re: CCL:interpolation code for 3d data !!

From: Su Wu <wusu(at)ele.uri.edu>
Date: Wed, 02 Jul 2003 12:54:37 -0400

Hi Pradipta,
I have done spline interpolation on x or y of A = f(x,y) in Matlab.  If 
interested, the following is some help information on spline, or go to
www.mathworks.com and search for 'spline'.
Good luck!
Su Wu

SPLINE Cubic spline data interpolation.
     YY = SPLINE(X,Y,XX) uses cubic spline interpolation to find YY, the 
values
     of the underlying function Y at the points in the vector XX.  The 
vector X
     specifies the points at which the data Y is given.  If Y is a 
matrix, then
     the data is taken to be vector-valued and interpolation is 
performed for
     each column of Y and YY will be length(XX)-by-size(Y,2).

     PP = SPLINE(X,Y) returns the piecewise polynomial form of the cubic 
spline
     interpolant for later use with PPVAL and the spline utility UNMKPP.

     Ordinarily, the not-a-knot end conditions are used. However, if Y 
contains
     two more values than X has entries, then the first and last value 
in Y are
     used as the endslopes for the cubic spline.  Namely:
        f(X) = Y(:,2:end-1),   df(min(X)) = Y(:,1),   df(max(X)) = Y(:,end)

     Example:
     This generates a sine curve, then samples the spline over a finer mesh:
         x = 0:10;  y = sin(x);
         xx = 0:.25:10;
         yy = spline(x,y,xx);
         plot(x,y,'o',xx,yy)

     Example:
     This illustrates the use of clamped or complete spline 
interpolation where
     end slopes are prescribed. Zero slopes at the ends of an 
interpolant to the
     values of a certain distribution are enforced:
        x = -4:4; y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
        cs = spline(x,[0 y 0]);
        xx = linspace(-4,4,101);
        plot(x,y,'o',xx,ppval(cs,xx),'-');

     See also INTERP1, PPVAL, SPLINES (The Spline Toolbox).

Pradipta Bandyopadhyay wrote:
> Hi,
> 
>   I am looking for a code(in fortran) for interpolation of a large set
> of 3 dimensional data (on an eqaully spaced grid). I tried the polynomial
> routine in numerical recipe -but it is very poor for my data. Probably
> spline or hermite polynomial based interpolation scheme would be the best.
> I would appreciate any help.
> 
> thanks.
> 
>          Pradipta
> 
> 
> 
> -= This is automatically added to each message by mailing script =-
> To send e-mail to subscribers of CCL put the string CCL: on your Subject: line
> and send your message to:  CHEMISTRY(at)ccl.net
> 
> Send your subscription/unsubscription requests to: CHEMISTRY-REQUEST(at)ccl.net 
> HOME Page: http://www.ccl.net   | Jobs Page: http://www.ccl.net/jobs 
> 
> If your mail is bouncing from CCL.NET domain send it to the maintainer:
> Jan Labanowski,  jkl(at)ccl.net (read about it on CCL Home Page)
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> 
> 
> 
> 
>