Changeset 581 for trunk/src/tps_coeff.m
- Timestamp:
- Mar 12, 2013, 12:52:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tps_coeff.m
r434 r581 8 8 % The spatial derivatives are obtained as EMDX*U_tps and EMDY*U_tps, where 9 9 % 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 % 10 13 %------------------------------------------------------------------------ 11 14 % [U_smooth,U_tps]=tps_coeff(ctrs,U,Smoothing) … … 13 16 % OUPUT: 14 17 % 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 16 19 17 20 %INPUT: 18 % ctrs: Nx s 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) 19 22 % U: Nx1 column vector representing the values of the considered scalar measured at the centres ctrs 20 23 % 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 22 28 23 29 function [U_smooth,U_tps]=tps_coeff(ctrs,U,Smoothing) 24 30 %------------------------------------------------------------------------ 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 32 N=size(ctrs,1);% nbre of source centres 33 NbDim=size(ctrs,2);% space dimension (2 or 3) 34 U = [U; zeros(NbDim+1,1)]; 32 35 EM = tps_eval(ctrs,ctrs); 33 36 SmoothingMat=Smoothing*eye(N,N);% Smoothing=1/(2*omega) , omega given by fasshauer; 34 SmoothingMat=[SmoothingMat zeros(N, 3)];37 SmoothingMat=[SmoothingMat zeros(N,NbDim+1)]; 35 38 PM=[ones(N,1) ctrs]; 36 IM=[EM+SmoothingMat; [PM' zeros( 3,3)]];39 IM=[EM+SmoothingMat; [PM' zeros(NbDim+1,NbDim+1)]]; 37 40 U_tps=(IM\U); 38 41 U_smooth=EM *U_tps;
Note: See TracChangeset
for help on using the changeset viewer.