LAMPIRAN
Simulasi untuk Skenario I
S1.a. script input data (*INP File) 'ricker2.dat' 1 9 51 5 101 101 1 1 10 10 1 0 0 1 1500 50 1 20 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 1 1 1 1 1 1 0 6 / a b c d e 5 1.033 0 4 1.033 0 3 1.033 0 2 1.033 0 1 1.033 0 0 1.033 0 10 50 8 50 13 50 18 50 23 50 28 50 33 50 38 50 43 50 48 50 53
S1.b script input data (*ENV File)
///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee//////////eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
S1.c. script configurasi data (*CON File) 1 1 1 1 1 1 1 1 'scen-1.env' 'scen-1.inp' 'scen-1.out' 'scen-1.sig' 'scen-1.int' 'scen-1.los' 'scen-1.pma' 'scen-1.par' 'scen-1.pmi'
S1.d. script wav2d (*M File) function wav2d(mcode,mxs,axmin,axmax,mc,mfi,mfo,mfm,ttl)
%wav2d('j','f',-0.5,0.5,jet,'scen-1.out','scen-1','scen-1.mpeg','
2D 2nd order')
% mcode = 'j' ===> making jpeg file
% mcode = 'm' ===> making mpeg file
% mxs = 'r' ===> making relative scale
% mxs = 'f' ===> making fixed scale
% axmin = -0.1 ==> making axis minimum for fixed scale = -0.1
% axmax = 0.1 ==> making axis maximum for fixed scale = 0.1
fnzise = 12
strext = '.jpeg'
fid = fopen(mfi);
NL = fscanf(fid,'%g %g %g %g %g %g %g\n',[7 1]);
M = NL(1,1);
N = NL(2,1);
L = NL(5,1)/NL(6,1);
dt = NL(6,1)*NL(7,1);
dx = NL(3,1);
dz = NL(4,1);
%-------------------------------
for i=1:L
b = fscanf(fid,'%e',[N M]);
C = mfo;
C1='@';
LD=0;
XX=(M-1);
XP=dx*XX/10;
YY=(N-1);
YP=dz*YY/10;
x1=XP*1;x2=XP*2;x3=XP*3;x4=XP*4;x5=XP*5;x6=XP*6;x7=XP*7;x8=XP*8;x9
=XP*9;x10=XP*10;
y1=0;y2=YP*1;y3=YP*2;y4=YP*3;y5=YP*4;y6=YP*5;y7=YP*6;y8=YP*7;y9=YP
*8;y10=YP*9;y11=YP*10;
pcolor(b);
shading interp;
colormap(mc);
%h1=get(gca,'Position');
%grid on
h2=colorbar('vertical');
set(colorbar,'FontSize',fnzise);
axis ij;
set(gca,'XAxisLocation','top','YAxisLocation','left','XDir','norma
l','YDir','reverse',...
'XTickMode','manual','YTickMode','manual','XTick',XX/10:XX/10:XX,'
YTick',0:YY/10:YY,...
'DataAspectRatio',[100 100
100],'XLimMode','manual','YLimMode','manual','XLim',...
[0 XX],'YLim',[0
YY],'XTickLabelMode','manual','YTickLabelMode','manual',...
'XTickLabel',[x1;x2;x3;x4;x5;x6;x7;x8;x9;x10],...
'YTickLabel',[y1;y2;y3;y4;y5;y6;y7;y8;y9;y10;y11],...
'FontSize',fnzise);
if mxs=='f'
caxis([axmin axmax]);
end
str1=num2str(i);
if i < 10000
D=strcat(C,C1,str1,strext);
end
if i < 1000
D=strcat(C,C1,'0',str1,strext);
end
if i < 100
D=strcat(C,C1,'00',str1,strext);
end
if i < 10
D=strcat(C,C1,'000',str1,strext);
end
blnk=' ';
t = i*dt*1000;
ts =strcat('t = ',num2str(t),' msec');
colorbar
xlabel('x(meter)')
ylabel('y(meter)')
grid on
text(N-10,M-
10,ts,'HorizontalAlignment','right','FontSize',fnzise);
text(10,10,ttl,'HorizontalAlignment','left','FontSize',fnzise);
P(i)=getframe;
%------------- jpeg write ---------------------
if mcode=='j'
% saveas(gcf,D,'psc2');
saveas(gcf,D,'jpeg');
end
end
%------------ mpeg write ----------------------
if mcode=='m'
mpgwrite(P,mc,mfm,[1,2,2,1,10,1,1,1]);
end
%----------------------------------------------
fclose(fid)
S1.e. script running with Matlab To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.
» pwd
ans =
C:\MATLABR11\work
» cd
C:\MATLABR11\work
» ls
. ex sigerd1 sigerd2 sigerd4
.. sigerd sigerd13 sigerd3 sigerd9
» ls sigerd1
. fort.6 scen-1.inp scen-1.out scen-1.sig wav2d.m
.. ricker2.dat scen-1.int scen-1.par sigerd.con
Thumbs.db scen-1.env scen-1.los scen-1.pma sigerd.exe
» cd sigerd1
» edit wav2d
» wav2d('j','f',-0.5,0.5,jet,'scen-1.out','scen-1','scen-1.mpeg','
2D 2nd )
fnzise =
12
strext =
.jpeg
ans =
0
»
Simulasi untuk Skenario II
S2.a. script input data (*INP File) 'ricker2.dat' 1 9 51 5 101 101 1 1 10 10 1 0 0 1 1500 50 1 20 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 1 1 1 1 1 1 0 6 / a b c d e 5 1.033 0 4 1.033 0 3 1.033 0 2 1.033 0 1 1.033 0 0 1.033 0 10 50 8 50 13 50 18 50 23 50 28 50 33 50 38 50 43 50 48 50 53
S2.b script input data (*ENV File)
///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa//////////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb//////////bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccc//////////cccccccccccccccccccccccccccccccccccccccccccccccc dddddddddddddddddddddddddddddddddddddddddddd//////////dddddddddddddddddddddddddddddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee//////////eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee dddddddddddddddddddddddddddddddddddddddddddd//////////dddddddddddddddddddddddddddddddddddddddddddddddd cccccccccccccccccccccccccccccccccccccccccccc//////////cccccccccccccccccccccccccccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb//////////bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa//////////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
S2.c. script configurasi data (*CON File) 1 1 1 1 1 1 1 1 'scen-2.env' 'scen-2.inp' 'scen-2.out' 'scen-2.sig' 'scen-2.int' 'scen-2.los' 'scen-2.pma' 'scen-2.par' 'scen-2.pmi'
S2.d. script wav2d (*M File) function wav2d(mcode,mxs,axmin,axmax,mc,mfi,mfo,mfm,ttl)
%wav2d('j','f',-0.5,0.5,jet,'scen-2.out','scen-2','scen-2.mpeg','
2D 2nd order')
% mcode = 'j' ===> making jpeg file
% mcode = 'm' ===> making mpeg file
% mxs = 'r' ===> making relative scale
% mxs = 'f' ===> making fixed scale
% axmin = -0.1 ==> making axis minimum for fixed scale = -0.1
% axmax = 0.1 ==> making axis maximum for fixed scale = 0.1
fnzise = 12
strext = '.jpeg'
fid = fopen(mfi);
NL = fscanf(fid,'%g %g %g %g %g %g %g\n',[7 1]);
M = NL(1,1);
N = NL(2,1);
L = NL(5,1)/NL(6,1);
dt = NL(6,1)*NL(7,1);
dx = NL(3,1);
dz = NL(4,1);
%-------------------------------
for i=1:L
b = fscanf(fid,'%e',[N M]);
C = mfo;
C1='@';
LD=0;
XX=(M-1);
XP=dx*XX/10;
YY=(N-1);
YP=dz*YY/10;
x1=XP*1;x2=XP*2;x3=XP*3;x4=XP*4;x5=XP*5;x6=XP*6;x7=XP*7;x8=XP*8;x9
=XP*9;x10=XP*10;
y1=0;y2=YP*1;y3=YP*2;y4=YP*3;y5=YP*4;y6=YP*5;y7=YP*6;y8=YP*7;y9=YP
*8;y10=YP*9;y11=YP*10;
pcolor(b);
shading interp;
colormap(mc);
%h1=get(gca,'Position');
%grid on
h2=colorbar('vertical');
set(colorbar,'FontSize',fnzise);
axis ij;
set(gca,'XAxisLocation','top','YAxisLocation','left','XDir','norma
l','YDir','reverse',...
'XTickMode','manual','YTickMode','manual','XTick',XX/10:XX/10:XX,'
YTick',0:YY/10:YY,...
'DataAspectRatio',[100 100
100],'XLimMode','manual','YLimMode','manual','XLim',...
[0 XX],'YLim',[0
YY],'XTickLabelMode','manual','YTickLabelMode','manual',...
'XTickLabel',[x1;x2;x3;x4;x5;x6;x7;x8;x9;x10],...
'YTickLabel',[y1;y2;y3;y4;y5;y6;y7;y8;y9;y10;y11],...
'FontSize',fnzise);
if mxs=='f'
caxis([axmin axmax]);
end
str1=num2str(i);
if i < 10000
D=strcat(C,C1,str1,strext);
end
if i < 1000
D=strcat(C,C1,'0',str1,strext);
end
if i < 100
D=strcat(C,C1,'00',str1,strext);
end
if i < 10
D=strcat(C,C1,'000',str1,strext);
end
blnk=' ';
t = i*dt*1000;
ts =strcat('t = ',num2str(t),' msec');
colorbar
xlabel('x(meter)')
ylabel('y(meter)')
grid on
text(N-10,M-
10,ts,'HorizontalAlignment','right','FontSize',fnzise);
text(10,10,ttl,'HorizontalAlignment','left','FontSize',fnzise);
P(i)=getframe;
%------------- jpeg write ---------------------
if mcode=='j'
% saveas(gcf,D,'psc2');
saveas(gcf,D,'jpeg');
end
end
%------------ mpeg write ----------------------
if mcode=='m'
mpgwrite(P,mc,mfm,[1,2,2,1,10,1,1,1]);
end
%----------------------------------------------
fclose(fid)
S2.e. script running with Matlab To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.
» pwd
ans =
C:\MATLABR11\work
» cd
C:\MATLABR11\work
» ls
. ex sigerd1 sigerd2 sigerd4
.. sigerd sigerd13 sigerd3 sigerd9
» ls sigerd2
. fort.6 scen-2.inp scen-2.out scen-2.sig wav2d.m
.. ricker2.dat scen-2.int scen-2.par sigerd.con
Thumbs.db scen-2.env scen-2.los scen-2.pma sigerd.exe
» cd sigerd1
» edit wav2d
» wav2d('j','f',-0.5,0.5,jet,'scen-1.out','scen-2','scen-2.mpeg','
2D 2nd )
fnzise =
12
strext =
.jpeg
ans =
0
»
Simulasi untuk Skenario III
S3.a. script input data (*INP File) 'ricker2.dat' 1 9 51 5 101 101 1 1 10 10 1 0 0 1 1500 50 1 20 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 1 1 1 1 1 1 0 6 / a b c d e 5 1.033 0 4 1.033 0 3 1.033 0 2 1.033 0 1 1.033 0 0 1.033 0 10 50 8 50 13 50 18 50 23 50 28 50 33 50 38 50 43 50 48 50 53
S3.b script input data (*ENV File)
///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
S3.c. script configurasi data (*CON File) 1 1 1 1 1 1 1 1 'scen-3.env' 'scen-3.inp' 'scen-3.out' 'scen-3.sig' 'scen-3.int' 'scen-3.los' 'scen-3.pma' 'scen-3.par' 'scen-3.pmi'
S3.d. script wav2d (*M File) function wav2d(mcode,mxs,axmin,axmax,mc,mfi,mfo,mfm,ttl)
%wav2d('j','f',-0.5,0.5,jet,'scen-3.out','scen-3','scen-3.mpeg','
2D 2nd order')
% mcode = 'j' ===> making jpeg file
% mcode = 'm' ===> making mpeg file
% mxs = 'r' ===> making relative scale
% mxs = 'f' ===> making fixed scale
% axmin = -0.1 ==> making axis minimum for fixed scale = -0.1
% axmax = 0.1 ==> making axis maximum for fixed scale = 0.1
fnzise = 12
strext = '.jpeg'
fid = fopen(mfi);
NL = fscanf(fid,'%g %g %g %g %g %g %g\n',[7 1]);
M = NL(1,1);
N = NL(2,1);
L = NL(5,1)/NL(6,1);
dt = NL(6,1)*NL(7,1);
dx = NL(3,1);
dz = NL(4,1);
%-------------------------------
for i=1:L
b = fscanf(fid,'%e',[N M]);
C = mfo;
C1='@';
LD=0;
XX=(M-1);
XP=dx*XX/10;
YY=(N-1);
YP=dz*YY/10;
x1=XP*1;x2=XP*2;x3=XP*3;x4=XP*4;x5=XP*5;x6=XP*6;x7=XP*7;x8=XP*8;x9
=XP*9;x10=XP*10;
y1=0;y2=YP*1;y3=YP*2;y4=YP*3;y5=YP*4;y6=YP*5;y7=YP*6;y8=YP*7;y9=YP
*8;y10=YP*9;y11=YP*10;
pcolor(b);
shading interp;
colormap(mc);
%h1=get(gca,'Position');
%grid on
h2=colorbar('vertical');
set(colorbar,'FontSize',fnzise);
axis ij;
set(gca,'XAxisLocation','top','YAxisLocation','left','XDir','norma
l','YDir','reverse',...
'XTickMode','manual','YTickMode','manual','XTick',XX/10:XX/10:XX,'
YTick',0:YY/10:YY,...
'DataAspectRatio',[100 100
100],'XLimMode','manual','YLimMode','manual','XLim',...
[0 XX],'YLim',[0
YY],'XTickLabelMode','manual','YTickLabelMode','manual',...
'XTickLabel',[x1;x2;x3;x4;x5;x6;x7;x8;x9;x10],...
'YTickLabel',[y1;y2;y3;y4;y5;y6;y7;y8;y9;y10;y11],...
'FontSize',fnzise);
if mxs=='f'
caxis([axmin axmax]);
end
str1=num2str(i);
if i < 10000
D=strcat(C,C1,str1,strext);
end
if i < 1000
D=strcat(C,C1,'0',str1,strext);
end
if i < 100
D=strcat(C,C1,'00',str1,strext);
end
if i < 10
D=strcat(C,C1,'000',str1,strext);
end
blnk=' ';
t = i*dt*1000;
ts =strcat('t = ',num2str(t),' msec');
colorbar
xlabel('x(meter)')
ylabel('y(meter)')
grid on
text(N-10,M-
10,ts,'HorizontalAlignment','right','FontSize',fnzise);
text(10,10,ttl,'HorizontalAlignment','left','FontSize',fnzise);
P(i)=getframe;
%------------- jpeg write ---------------------
if mcode=='j'
% saveas(gcf,D,'psc2');
saveas(gcf,D,'jpeg');
end
end
%------------ mpeg write ----------------------
if mcode=='m'
mpgwrite(P,mc,mfm,[1,2,2,1,10,1,1,1]);
end
%----------------------------------------------
fclose(fid)
S3.e. script running with Matlab To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.
» pwd
ans =
C:\MATLABR11\work
» cd
C:\MATLABR11\work
» ls
. ex sigerd1 sigerd2 sigerd4
.. sigerd sigerd13 sigerd3 sigerd9
» ls sigerd3
. fort.6 scen-3.inp scen-3.out scen-3.sig wav2d.m
.. ricker2.dat scen-3.int scen-3.par sigerd.con
Thumbs.db scen-3.env scen-3.los scen-3.pma sigerd.exe
» cd sigerd1
» edit wav2d
» wav2d('j','f',-0.5,0.5,jet,'scen-3.out','scen-3','scen-3.mpeg','
2D 2nd )
fnzise =
12
strext =
.jpeg
ans =
0
»
Simulasi untuk Skenario IV
S4.a. script input data (*INP File) 'ricker2.dat' 1 9 51 5 101 101 1 1 10 10 1 0 0 1 1500 50 1 20 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 2 0 0 0 1 1 1 1 1 1 1 0 6 / a b c d e 5 1.033 0 4 1.033 0 3 1.033 0 2 1.033 0 1 1.033 0 0 1.033 0 10 50 8 50 13 50 18 50 23 50 28 50 33 50 38 50 43 50 48 50 53
S4.b script input data (*ENV File)
///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /////////////////////////////////////////////////////bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb /////////////////////////////////////////////////////cccccccccccccccccccccccccccccccccccccccccccccccc /////////////////////////////////////////////////////dddddddddddddddddddddddddddddddddddddddddddddddd /////////////////////////////////////////////////////eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee /////////////////////////////////////////////////////dddddddddddddddddddddddddddddddddddddddddddddddd /////////////////////////////////////////////////////cccccccccccccccccccccccccccccccccccccccccccccccc /////////////////////////////////////////////////////bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb /////////////////////////////////////////////////////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
S4.c. script configurasi data (*CON File) 1 1 1 1 1 1 1 1 'scen-4.env' 'scen-4.inp' 'scen-4.out' 'scen-4.sig' 'scen-4.int' 'scen-4.los' 'scen-4.pma' 'scen-4.par' 'scen-4.pmi'
S4.d. script wav2d (*M File) function wav2d(mcode,mxs,axmin,axmax,mc,mfi,mfo,mfm,ttl)
%wav2d('j','f',-0.5,0.5,jet,'scen-4.out','scen-4','scen-4.mpeg','
2D 2nd order')
% mcode = 'j' ===> making jpeg file
% mcode = 'm' ===> making mpeg file
% mxs = 'r' ===> making relative scale
% mxs = 'f' ===> making fixed scale
% axmin = -0.1 ==> making axis minimum for fixed scale = -0.1
% axmax = 0.1 ==> making axis maximum for fixed scale = 0.1
fnzise = 12
strext = '.jpeg'
fid = fopen(mfi);
NL = fscanf(fid,'%g %g %g %g %g %g %g\n',[7 1]);
M = NL(1,1);
N = NL(2,1);
L = NL(5,1)/NL(6,1);
dt = NL(6,1)*NL(7,1);
dx = NL(3,1);
dz = NL(4,1);
%-------------------------------
for i=1:L
b = fscanf(fid,'%e',[N M]);
C = mfo;
C1='@';
LD=0;
XX=(M-1);
XP=dx*XX/10;
YY=(N-1);
YP=dz*YY/10;
x1=XP*1;x2=XP*2;x3=XP*3;x4=XP*4;x5=XP*5;x6=XP*6;x7=XP*7;x8=XP*8;x9
=XP*9;x10=XP*10;
y1=0;y2=YP*1;y3=YP*2;y4=YP*3;y5=YP*4;y6=YP*5;y7=YP*6;y8=YP*7;y9=YP
*8;y10=YP*9;y11=YP*10;
pcolor(b);
shading interp;
colormap(mc);
%h1=get(gca,'Position');
%grid on
h2=colorbar('vertical');
set(colorbar,'FontSize',fnzise);
axis ij;
set(gca,'XAxisLocation','top','YAxisLocation','left','XDir','norma
l','YDir','reverse',...
'XTickMode','manual','YTickMode','manual','XTick',XX/10:XX/10:XX,'
YTick',0:YY/10:YY,...
'DataAspectRatio',[100 100
100],'XLimMode','manual','YLimMode','manual','XLim',...
[0 XX],'YLim',[0
YY],'XTickLabelMode','manual','YTickLabelMode','manual',...
'XTickLabel',[x1;x2;x3;x4;x5;x6;x7;x8;x9;x10],...
'YTickLabel',[y1;y2;y3;y4;y5;y6;y7;y8;y9;y10;y11],...
'FontSize',fnzise);
if mxs=='f'
caxis([axmin axmax]);
end
str1=num2str(i);
if i < 10000
D=strcat(C,C1,str1,strext);
end
if i < 1000
D=strcat(C,C1,'0',str1,strext);
end
if i < 100
D=strcat(C,C1,'00',str1,strext);
end
if i < 10
D=strcat(C,C1,'000',str1,strext);
end
blnk=' ';
t = i*dt*1000;
ts =strcat('t = ',num2str(t),' msec');
colorbar
xlabel('x(meter)')
ylabel('y(meter)')
grid on
text(N-10,M-
10,ts,'HorizontalAlignment','right','FontSize',fnzise);
text(10,10,ttl,'HorizontalAlignment','left','FontSize',fnzise);
P(i)=getframe;
%------------- jpeg write ---------------------
if mcode=='j'
% saveas(gcf,D,'psc2');
saveas(gcf,D,'jpeg');
end
end
%------------ mpeg write ----------------------
if mcode=='m'
mpgwrite(P,mc,mfm,[1,2,2,1,10,1,1,1]);
end
%----------------------------------------------
fclose(fid)
S4.e. script running with Matlab To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.
» pwd
ans =
C:\MATLABR11\work
» cd
C:\MATLABR11\work
» ls
. ex sigerd1 sigerd2 sigerd4
.. sigerd sigerd13 sigerd3 sigerd9
» ls sigerd4
. fort.6 scen-4.inp scen-4.out scen-4.sig wav2d.m
.. ricker2.dat scen-4.int scen-4.par sigerd.con
Thumbs.db scen-4.env scen-4.los scen-4.pma sigerd.exe
» cd sigerd1
» edit wav2d
» wav2d('j','f',-0.5,0.5,jet,'scen-1.out','scen-4','scen-4.mpeg','
2D 2nd )
fnzise =
12
strext =
.jpeg
ans =
0
»