From chemistry-request@ccl.net Wed Jul  2 12:57:02 2003
Received: from leviathan.ele.uri.edu (leviathan.ele.uri.edu [131.128.51.64])
	by server.ccl.net (8.12.8/8.12.8) with ESMTP id h62Gv1qe005412
	for <chemistry(at)ccl.net>; Wed, 2 Jul 2003 12:57:02 -0400
Received: from ele.uri.edu (ip68-9-19-36.ri.ri.cox.net [68.9.19.36])
	by leviathan.ele.uri.edu (8.12.6/8.12.6) with ESMTP id h62Guv2S020520;
	Wed, 2 Jul 2003 12:56:58 -0400 (EDT)
Message-ID: <3F030E4D.4000908(at)ele.uri.edu>
Date: Wed, 02 Jul 2003 12:54:37 -0400
From: Su Wu <wusu(at)ele.uri.edu>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Pradipta Bandyopadhyay <pradipta(at)cgl.ucsf.edu>,
   chemistry
 <chemistry(at)ccl.net>
Subject: Re: CCL:interpolation code for 3d data !!
References: <Pine.OSF.4.53.0307011638240.926103(at)adenine.cgl.ucsf.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

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)
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> 
> 
> 
> 
> 



