PROCEDURE:
clear all;hold off; nx=20;nz=nx;dx=10;dxx=dx;firstsx=0;ds=10;ns=20;firstgx=0;dg=10;ng=20; [SLL,LL]=raypath(nx,nz,dx,firstsx,ds,ns,firstgx,dg,ng);alpha=.01; % % Create a Vertical Layer Slowness Model % slow=ones(nx,nz)/2000; slow(round(nx/2):nx,:)=slow(round(nx/2):nx,:)*.5; nxm=nx-1;slow1(1:nxm,1:nxm)=slow(1:nxm,1:nxm); %slow1=slow1';% Model becomes 2 layer horizontal model %nst=round(nx/2);nen=round(nst*1.3);% Add a slowness anomaly %for i=nst:nen;slow1(i,nst:nen)=1/2000;end% Add a slowness anomaly subplot(211);imagesc([1:nx-1]*dxx,[1:nx-1]*dxx,1./slow1'); colorbar;ylabel('Z (m)');title('Velocity Model'); text(dxx*nx,-1.5*dxx,'Velocity (km/s)')Which index is associated with raypath number and which index is associated with slowness inknown? What is dimension of SLL (Use size(SLL)). Type SLL(3,:) to see the raypath segment lengths of 3rd ray. Is this an overdetermined system of equations? Is the associated normal equation matrix well conditioned? What is the conditon number of the nromal equations?
Solve for least square solution of Ls=t; % TIME=SLL*slow1(:);LTL=SLL'*SLL;LTt=SLL'*TIME; d=diag(LTL);D=diag(1./d,0);ID=eye(length(d))*alpha; % alpha is damping parameter appslow=inv(D*LTL+ID)*D*LTt;The resulting tomogram can be plotted by typing
% % Plot Tomogram % appslow=reshape(appslow,nx-1,nx-1);subplot(212); imagesc([1:nx-1]*dxx,[1:nx-1]*dxx,1./appslow'); colorbar;xlabel('X (m)');ylabel('Z (m)');title('Slowness Tomogram'); text(dxx*nx,-dxx,'Velocity (m/s)')
To understand the importance of damping repeat above except set the damping paramater alpha =0. Explin this new result using the word condition number.
Does the new covariance matrix vlaues predict areas of poor resolution? Make sure that you add a diagnoal matrix with damping parameter of .1 to LTL matrix before you invert. This will lessen singularity of matrix so covariance values are better displayed.
(Extra Credit) Try different damping parameters and constraints to see if the result improves.