Home > 16-Surfacereconstruction > eq_15_120_theoretical_accuracy.m

eq_15_120_theoretical_accuracy

PURPOSE ^

% eq_15_120_theoretical accuracy

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% eq_15_120_theoretical accuracy

 determines precision as a function of grid spacing
 plots grid and precision (10 levels)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% eq_15_120_theoretical accuracy
0002 %
0003 % determines precision as a function of grid spacing
0004 % plots grid and precision (10 levels)
0005 
0006 clear all
0007 close all
0008 % type_data: type of generated data
0009 % 15     4x4 Grid
0010 %
0011 % wf 7/2014
0012 
0013 addpath('Functions')
0014 addpath('Data')
0015 
0016 display('--- analyse theoretical precision ---')
0017 
0018 init_rand = 6;
0019 type_data = 6;
0020 type_robust = 1
0021 %             0 not robust
0022 %             1 only dem
0023 %             2 only points
0024 %             3 both
0025 
0026 out_C = 1;
0027 out_print = 0;
0028 Tol =0.15;
0029 
0030 print_type = 0;
0031 plot_type  = 0;
0032 
0033 if init_rand==0
0034     init_rand=round(rand( sum(100*clock)))
0035     r=rand(3,1);
0036 end;
0037 rand('state',init_rand);
0038 randn('state',init_rand);
0039 
0040 
0041 %% generate dem point cloud
0042 sigma_z=zeros(10,1);
0043 n=4
0044 d_max=10;
0045 for d=1:d_max
0046     [points,BB,delta_x,sigma_k,sigma_s,out_in,dem]=simulate_points_dem_15_flat(d,n);
0047     out_in=zeros(size(points,1),1);
0048 
0049     Np = size(points,1);
0050 
0051 
0052     % smooth non-robust
0053 
0054     type_robust=0;
0055 
0056     starttime = cputime
0057     [ds,S,Sigma,Np,Nr,Mc,ver,A,w,w_f,W] =...
0058         smooth_dem_robust_bilinear...
0059         (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,out_in,...
0060         print_type,plot_type);
0061     complete_time_for_solution=cputime-starttime
0062 
0063     figure
0064     hold on
0065     mesh(S);
0066     title(strcat('Height = \sigma_z, d=',num2str(2*d)))
0067     view([-33,63])
0068     sigma_centre=sqrt(S(2+(n-1)*d,2+(n-1)*d));
0069     sigma_z(d)=sigma_centre;
0070 end
0071 
0072 std_z=sigma_z'
0073 
0074 figure
0075 hold on
0076 d_range=1:d_max;
0077 plot(2*(1:d_max),sigma_z(1:d_max),'ob','MarkerSize',12)
0078 B=regress(sigma_z(d_range).^2,[ones(length(d_range),1),(2*d_range)'.^2])
0079 plot(2*(1:d_max),sqrt(B(1)+B(2)*(2*(1:d_max))'.^2),'-r','LineWidth',2)
0080 title(strcat('\sigma_z =',num2str(B(1)),' + ',num2str(B(2)),'d, (d > 1)'))

Generated on Sat 01-Oct-2016 21:05:04 by m2html © 2005