BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model...

20

Transcript of BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model...

Page 1: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 2: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 3: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 4: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 5: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 6: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 7: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 8: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 9: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 10: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom
Page 11: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 4

Sunda Block

Page 12: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom : bujur lintang % ========================================================================================= % ///////////////////////////////////////////////////////////////////////////////////////// % Rotates lat long points by Euler pole (lat,long,angle) % By Lydia DiCaprio 15/09/06 % from p 227 "Plate Tectonics" Cox and Hart (1986) % modified by irwan (2007) % % ========================================================================================= % % Description % This script takes Lat Long pairs and rotates them by an euler pole and angle. % I have adapted this script to be fed into by a python script primarily for use % on gplates output data. For example I output the vectors in gmt format from gplates. % This gives me a mesh of points for which I wish to extract ages from a gmt grid of ages. % I rotated the Lats and Longs of the mesh back towards the pole using this script before using % a grdtrack command to extract the ages. % Why did I do this % Well although plates has a program called rotpts which does the exact same thing as this script, % the plates program falls apart when it comes to rotating thousands of points as I need to do for % my meshes. % I dont know why this is and can't fix it so I wrote my own. % % Tricky issues about this script: % It is really important that when converting from cartesian to spherical I use the matlab % function atan2. % Otherwise the data will plot in the wrong quadrant since atan does not inherantly differentiate % between quadrants. This is one of the nice things about matlab! % % If you can use this have fun. % % ///////////////////////////////////////////////////////////////////////////////////////// % ========================================================================================= % Make the Cross product C which is perpendicular to points (A B) in a plane. % Below is the rotation I used for my gplates work %eulerLat=0; %eulerLong=225; %eulerAngle=-37.5; % ========================================================================================= % For Bug detecting set the following values and compare to book values % ========================================================================================= eulerLat=38.9; eulerLong=-86.9; %eulerLong=-132; eulerAngle=0.393; % Debugging example: %Lat=20 %Long=130 % ========================================================================================= % Convert to radians % ========================================================================================= d2r=pi/180; r2d=180/pi; eulerLat=d2r*eulerLat; eulerLong=d2r*eulerLong; % di non active-keun bel! %eulerAngle=d2r*eulerAngle;

Page 13: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

% ========================================================================================= % Convert spherical coordinates to cartesian coords % ========================================================================================= Cx=cos(eulerLat)*cos(eulerLong); Cy=cos(eulerLat)*sin(eulerLong); Cz=sin(eulerLat); CA=cos(eulerAngle); CB=sin(eulerAngle); % ========================================================================================= % Caculate the R values % ========================================================================================= R11=(Cx*Cx*(1-CA)) + (CA); R12=(Cx*Cy*(1-CA))-(Cz*CB); R13=(Cx*Cz*(1-CA)) + (Cy*CB); R21=(Cy*Cx*(1-CA)) + (Cz*CB); R22=(Cy*Cy*(1-CA)) + CA; R23=(Cy*Cz*(1-CA)) -(Cx*CB); R31=(Cz*Cx*(1-CA))-(Cy*CB); R32=(Cz*Cy*(1-CA))+(Cx*CB); R33=(Cz*Cz*(1-CA))+CA; % ========================================================================================= % load in data to rotate. % ========================================================================================= % x = load('Vectors/Vect0.xy') % This is done with a python script. load crdfwd.dat; x=crdfwd; Lat = x(:,2); Long = x(:,1); % ========================================================================================= % Find the rotated values for lat and long points from input columns % ========================================================================================= number=length(Lat); FillVector = zeros(number,2); h=0; for h=1:number, % ========================================================================================= % Convert to Radians and spherical coords to cartesian coords % ========================================================================================= Latn=d2r*Lat(h); Longn=d2r*Long(h); Ax=cos(Latn)*cos(Longn); Ay=cos(Latn)*sin(Longn); Az=sin(Latn); % ========================================================================================= % Set up matrices % ========================================================================================= R = [R11, R12, R13; R21, R22, R23; R31, R32, R33]; A = [Ax; Ay; Az]; % ========================================================================================= % Solution % ========================================================================================= B = R*A; Bx=B(1); By=B(2); Bz=B(3); % =========================================================================================

Page 14: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

% Convert back to spherical from cartesian % ========================================================================================= BLat=asin(Bz); BLong=atan2(By,Bx); % ========================================================================================= % Convert back to degrees from radians % ========================================================================================= BLatD=r2d*BLat; BLongD=r2d*BLong; %if BLong < 0, % BLongD=r2d*(BLong+pi); % BLongD; %end %if (r2d*BLong)-180 < 0, % BLongD=180+(r2d*(BLong)); % BLongD; %end %if (r2d*BLong) -180 > 0, % BLongD=r2d*(BLong); %end % FillVector(h,:) = [BLongD BLatD]; FillVector(h,:) = [BLong BLat]; end %disp(FillVector); dlmwrite('NewCoords.xy',[FillVector],'\t');

Page 15: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 5

Elastic Half Space

Page 16: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 5 Script Matlab Elastic Half Space Model dari Savage (1983) %%This function is the solution of displacements for a dip-slip fault with function [u, v, w] =EdgeHalfSpace(D,W,U1,theta,X2,X3) %an infinite length and a finite width for a half space. %February 10, 2000, P. Cervelli %Revised April 17, P. Segall %Date: Feb 13, 2006 %modified by irwan at seis.nagoya-u.ac.jp %%input parameter: %D: depth of the updip end %W: width of the fault %U1: assigned slip on the fault %theta: inclination angle of the fault in degress %x1,x2,x3: coordinates of the calculated point. x1: the direction parellel with the %strike of the fault(X1). x2: the one normal to the strike(X2). x3: the vertical direction(X3); downwards is postive. %%output: %u,v,w: displacements in X1,X2,and X3, respectively %%%The original code was provided by Dr. Kaj Johnson in Feb, 2006. The code %was for a semi-infinite fault %EDGEDISP [u1, u2] =EdgeDisp(m,x1,x2,nu); %Computes displacements at 'x' caused by the edge dislocation %specified in 'm': % m(1) = Horizontal position of updip end % m(2) = Depth of updip end (MUST be negative) % m(3) = Dip (degrees) measured positve down from x1 axis; % m(4) = Slip % % Observation coordinates, 'x1', and 'x2' can be a matrix; % 'nu' is Poisson's ratio, which if omitted defaults to 0.25. % Output is two matricies 'u1' and 'u2' same size as x1 and x2 % in same Units as the dislocation % % %February 10, 2000, P. Cervelli %Revised April 17, P. Segall %transform to the coordinate system of the original code x1 = X2; x2 = -X3; m(2) = -D; m(3) = theta; m(1) = D/tan(theta/180*pi); m(4) = -U1; nu = 0.25; %Check for omitted Poisson's ratio %if nargin < 3 nu=0.25; end %part I % components of slip vector b1=m(4)*cos(m(3)*pi/180); b2=m(4)*sin(m(3)*pi/180); % Some parameters used in calcaulating displacements C=1/(pi*(1-nu)); r1=sqrt((x2-m(2)).^2+(x1-m(1)).^2); r2=sqrt((x2+m(2)).^2+(x1-m(1)).^2); dx1=x1-m(1); dx2=x2-m(2); dx2a=x2+m(2); % define branch cuts % rotated coordinates at source x1p = cos(m(3)*pi/180)*dx1 - sin(m(3)*pi/180)*dx2; x2p = cos(m(3)*pi/180)*dx2 + sin(m(3)*pi/180)*dx1; % rotated coordinates at image x1pi = cos(m(3)*pi/180)*dx1 - sin(m(3)*pi/180)*dx2a; x2pi = cos(m(3)*pi/180)*dx2a + sin(m(3)*pi/180)*dx1; theta1=atan2(x2p,-x1p);

Page 17: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

theta2=-atan2(x2pi,x1pi); u1_PartI = b1*C*( (1-nu)/2*(theta2-theta1) + dx1.*dx2./(4*r1.^2) - ... dx1.*( x2+(3-4*nu)*m(2) )./(4*r2.^2) + ... (x2.*m(2).*dx1.*dx2a)./r2.^4 ) + ... b2*C*( (1-2*nu)/4*(log(r2) - log(r1)) - dx2.^2./(4*r1.^2) + ... (x2.^2 + 4*(nu-1)*x2*m(2) + (4*nu-3)*m(2)^2 )./(4*r2.^2) + ... (x2*m(2).*dx2a.^2)./r2.^4 ); u2_PartI = b2*C*( (1-nu)/2*(theta1-theta2) + dx1.*dx2./(4*r1.^2) - ... dx1.*( x2+(3-4*nu)*m(2))./(4*r2.^2) -... dx1.*x2*m(2).*dx2a./r2.^4 ) + ... b1*C*( (1-2*nu)/4*(log(r2) - log(r1)) + dx2.^2./(4*r1.^2) - ... (dx2a.^2 - 2*m(2)^2 - 2*(1-2*nu)*m(2)*dx2a)./(4*r2.^2) + ... (x2*m(2).*dx2a.^2)./r2.^4 ); %part II m(2) = -(W + D/sin(theta/180*pi))*sin(theta/180*pi); m(1) = -m(2)/tan(theta/180*pi); m(4) = U1; % components of slip vector b1=m(4)*cos(m(3)*pi/180); b2=m(4)*sin(m(3)*pi/180); % Some parameters used in calcaulating displacements C=1/(pi*(1-nu)); r1=sqrt((x2-m(2)).^2+(x1-m(1)).^2); r2=sqrt((x2+m(2)).^2+(x1-m(1)).^2); dx1=x1-m(1); dx2=x2-m(2); dx2a=x2+m(2); % define branch cuts % rotated coordinates at source x1p = cos(m(3)*pi/180)*dx1 - sin(m(3)*pi/180)*dx2; x2p = cos(m(3)*pi/180)*dx2 + sin(m(3)*pi/180)*dx1; % rotated coordinates at image x1pi = cos(m(3)*pi/180)*dx1 - sin(m(3)*pi/180)*dx2a; x2pi = cos(m(3)*pi/180)*dx2a + sin(m(3)*pi/180)*dx1; theta1=atan2(x2p,-x1p); theta2=-atan2(x2pi,x1pi); u1_PartII = b1*C*( (1-nu)/2*(theta2-theta1) + dx1.*dx2./(4*r1.^2) - ... dx1.*( x2+(3-4*nu)*m(2) )./(4*r2.^2) + ... (x2.*m(2).*dx1.*dx2a)./r2.^4 ) + ... b2*C*( (1-2*nu)/4*(log(r2) - log(r1)) - dx2.^2./(4*r1.^2) + ... (x2.^2 + 4*(nu-1)*x2*m(2) + (4*nu-3)*m(2)^2 )./(4*r2.^2) + ... (x2*m(2).*dx2a.^2)./r2.^4 ); u2_PartII = b2*C*( (1-nu)/2*(theta1-theta2) + dx1.*dx2./(4*r1.^2) - ... dx1.*( x2+(3-4*nu)*m(2))./(4*r2.^2) -... dx1.*x2*m(2).*dx2a./r2.^4 ) + ... b1*C*( (1-2*nu)/4*(log(r2) - log(r1)) + dx2.^2./(4*r1.^2) - ... (dx2a.^2 - 2*m(2)^2 - 2*(1-2*nu)*m(2)*dx2a)./(4*r2.^2) + ... (x2*m(2).*dx2a.^2)./r2.^4 ); % Result of displacement for a finite width v = u1_PartI +u1_PartII ; w =-( u2_PartI +u2_PartII) ; u = 0; %%This function is the solution of displacements for a dip-slip fault with %an infinite length and a finite width for a half space. %Auther: Wen-Jeng Huang %Date: Feb 13, 2006 %modified by irwan at seis.nagoya-u.ac.jp %%input parameter: %D: depth of the updip end %W: width of the fault %U1: assigned slip on the fault %theta: inclination angle of the fault in degress %x1,x2,x3: coordinates of the calculated point. x1: the direction parellel with the %strike of the fault(X1). x2: the one normal to the strike(X2). x3: the vertical direction(X3); downwards is postive.

Page 18: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

%%output: %u,v,w: displacements in X1,X2,and X3, respectively %Slip-Horizontal figure D=5000; W=70000; U1=0.05; theta=12; X3=400; for dist=20000:2000:200000 [u, v, w] =EdgeHalfSpace(D,W,U1,theta,dist,X3); plot(dist,v,'ro'); hold on end

Page 19: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 6

Command Line GMT

Page 20: BERKAS TAMBAHAN Fery Mubyarto 15101021 · Lampiran 4 Script Matlab Euler pole Sunda Block Model dari Bock (2000) %%program ini memanggil otomatis file crdfwd.dat dengan format kolom

Lampiran 6 Command Line Post Script untuk Plotting Vektor Pergeseran di GMT Plotting vektor pergeseran grdsample etopo2.grd -I2m -Gsumat.grd -R94/108/-8/7 -fg grdgradient sumat.grd -Gsumati.grd -M -Ne0.03 -A0/270 -V makecpt -Chaxby -T-10000/10000/500 -Z > sugar1.cpt grdimage sumat.grd -Isumati.grd -JM5 -R94/108/-8/7 -C sugar 1.cpt -K -Y2 -X4> sugar 1.ps pscoast -R94/108/-8/7 -B2WSne -Lfx1/0.01m/0/400 -JM5 -O -W2 -K -V -Di>> sugar 1.ps psxy sugar1.txt -R -JM -O -H0 -St0.125 -Ggreen -W1 -K>> sugar 1.ps psvelo sugar1.txt -R -JM -O -H0 -Se10/0.95/7 -L -W2,red -K >> sugar 1.ps Plotting Sunda block grdsample etopo2.grd -I2m -Gsumat.grd -R94/108/-8/7 -fg grdgradient sumat.grd -Gsumati.grd -M -Ne0.03 -A0/270 -V makecpt -Chaxby -T-10000/10000/500 -Z > sunda.cpt grdimage sumat.grd -Isumati.grd -JM5 -R94/108/-8/7 -C sunda.cpt -K -Y2 -X4> sunda.ps pscoast -R94/108/-8/7 -B2WSne -Lfx1/0.01m/0/400 -JM5 -O -W2 -K -V -Di>> sunda.ps psxy sunda.txt -R -JM -O -H0 -St0.125 -Ggreen -W1 -K>> sunda.ps psvelo sunda.txt -R -JM -O -H0 -Se10/0.95/7 -L -W2,red -K >> sunda.ps Plotting perbandingan data GPS dan model grdsample etopo2.grd -I2m -Gsumat.grd -R96/105/-6/1 -fg grdgradient sumat.grd -Gsumati.grd -M -Ne0.03 -A0/270 -V makecpt -Chaxby -T-10000/10000/500 -Z > model.cpt grdimage sumat.grd -Isumati.grd -JM5 -R96/105/-6/1 -Cmodel.cpt -K -Y2 -X4> model.ps pscoast -R96/105/-6/1 -B2WSne -Lfx0.8/0.01m/0/200 -JM5 -O -W2 -K -V -Di>> model.ps psxy model.txt -R -JM -O -H0 -St0.125 -Ggreen -W1 -K>> model.ps psvelo gpsdata.txt -R -JM -O -H0 -Se10/0.95/7 -L -W2,red -K >> model.ps psvelo model.txt -R -JM -O -H0 -Se10/0.95 -L -W2,blue -K >> model.ps Format load *.txt Column : 1 = Longitude 2 = Latitude 3 = Eastward velocity 4 = Northward velocity 5 = Uncertainty of eastward velocity 6 = Uncertainty of northward velocity 7 = Correlation between eastward and northward components 8 = Station name