Changeset 581 for trunk/src/tps_coeff.m


Ignore:
Timestamp:
Mar 12, 2013, 12:52:13 PM (11 years ago)
Author:
sommeria
Message:

clean the transform field functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tps_coeff.m

    r434 r581  
    88% The spatial derivatives are obtained as EMDX*U_tps and EMDY*U_tps, where
    99% EMDX and EMDY are obtained from the function tps_eval_dxy.
     10% for big data sets, a splitting in subdomains is needed, see functions
     11% set_subdomains and tps_coeff_field.
     12%
    1013%------------------------------------------------------------------------
    1114% [U_smooth,U_tps]=tps_coeff(ctrs,U,Smoothing)
     
    1316% OUPUT:
    1417% U_smooth: values of the quantity U at the N centres after smoothing
    15 % U_tps: tps weights of the centres
     18% U_tps: tps weights of the centres and columns of the linear
    1619
    1720%INPUT:
    18 % ctrs: Nxs matrix  representing the postions of the N centers, sources of the tps (s=space dimension)
     21% ctrs: NxNbDim matrix  representing the positions of the N centers, sources of the tps (NbDim=space dimension)
    1922% U: Nx1 column vector representing the values of the considered scalar measured at the centres ctrs
    2023% Smoothing: smoothing parameter: the result is smoother for larger Smoothing.
    21 
     24%
     25%related functions:
     26% tps_eval, tps_eval_dxy
     27% tps_coeff_field, set_subdomains, filter_tps, calc_field
    2228
    2329function [U_smooth,U_tps]=tps_coeff(ctrs,U,Smoothing)
    2430%------------------------------------------------------------------------
    25 %Smoothing smoothing parameter
    26 % X=reshape(X,[],1);
    27 % Y=reshape(Y,[],1);
    28 N=size(ctrs,1);
    29 % rhs = reshape(U,[],1);
    30 U = [U; zeros(3,1)];
    31 % ctrs = [X Y];% coordinates of measurement sites, radial base functions are located at the measurement sites
     31
     32N=size(ctrs,1);% nbre of source centres
     33NbDim=size(ctrs,2);% space dimension (2 or 3)
     34U = [U; zeros(NbDim+1,1)];
    3235EM = tps_eval(ctrs,ctrs);
    3336SmoothingMat=Smoothing*eye(N,N);%  Smoothing=1/(2*omega) , omega given by fasshauer;
    34 SmoothingMat=[SmoothingMat zeros(N,3)];
     37SmoothingMat=[SmoothingMat zeros(N,NbDim+1)];
    3538PM=[ones(N,1) ctrs];
    36 IM=[EM+SmoothingMat; [PM' zeros(3,3)]];
     39IM=[EM+SmoothingMat; [PM' zeros(NbDim+1,NbDim+1)]];
    3740U_tps=(IM\U);
    3841U_smooth=EM *U_tps;
Note: See TracChangeset for help on using the changeset viewer.