8.2 Programs
143
a1 = abs(randn(1));
b1 = abs(randn(1));
a2 = abs(randn(1));
b2 = abs(randn(1));
a3 = abs(randn(1));
b3 = abs(randn(1));
h1(i,j) = sqrt((-2.*(DDeff(i,j)*D1)/(t1*tR))*(1-E1 2 )*log(a1))*cos(2*pi*b1);
h2(i,j) = sqrt((-2.*(DDeff(i,j)*D2)/(t2*tR))*(1-E2 2 )*log(a2))*cos(2*pi*b2);
h3(i,j) = sqrt((-2.*(DDeff(i,j)*D3)/(t3*tR))*(1-E3 2 )*log(a3))*cos(2*pi*b3);
eps1(i+1,j)=eps1(i,j)*E1 + h1(i,j);
eps2(i+1,j)=eps2(i,j)*E2 + h2(i,j);
eps3(i+1,j)=eps3(i,j)*E3 + h3(i,j);
eps(i+1,j)=(eps1(i+1,j)+eps2(i+1,j)+eps3(i+1,j));
%========================================================
end
end
MEANXR=(sum(x,2))/NR;
MEANVR=(sum(v,2))/NR;
%MEANEPS=(sum(eps,2))/NR;
%MEANDeff=(sum(DDeff,2))/NR;
t=(1:N)*dt;
t=t’;
save t.dat t -ascii;
figure(1); plot(t,MEANXR); grid;
figure(2); plot(t,MEANVR); grid;
figure(3); plot(MEANXR,MEANVR); grid;
%disp(MEANVR)
%t=(1:N-1)*dt;
%t=t’;
save MEANXR.DAT MEANXR -ascii;
save MEANVR.DAT MEANVR -ascii;
143
a1 = abs(randn(1));
b1 = abs(randn(1));
a2 = abs(randn(1));
b2 = abs(randn(1));
a3 = abs(randn(1));
b3 = abs(randn(1));
h1(i,j) = sqrt((-2.*(DDeff(i,j)*D1)/(t1*tR))*(1-E1 2 )*log(a1))*cos(2*pi*b1);
h2(i,j) = sqrt((-2.*(DDeff(i,j)*D2)/(t2*tR))*(1-E2 2 )*log(a2))*cos(2*pi*b2);
h3(i,j) = sqrt((-2.*(DDeff(i,j)*D3)/(t3*tR))*(1-E3 2 )*log(a3))*cos(2*pi*b3);
eps1(i+1,j)=eps1(i,j)*E1 + h1(i,j);
eps2(i+1,j)=eps2(i,j)*E2 + h2(i,j);
eps3(i+1,j)=eps3(i,j)*E3 + h3(i,j);
eps(i+1,j)=(eps1(i+1,j)+eps2(i+1,j)+eps3(i+1,j));
%========================================================
end
end
MEANXR=(sum(x,2))/NR;
MEANVR=(sum(v,2))/NR;
%MEANEPS=(sum(eps,2))/NR;
%MEANDeff=(sum(DDeff,2))/NR;
t=(1:N)*dt;
t=t’;
save t.dat t -ascii;
figure(1); plot(t,MEANXR); grid;
figure(2); plot(t,MEANVR); grid;
figure(3); plot(MEANXR,MEANVR); grid;
%disp(MEANVR)
%t=(1:N-1)*dt;
%t=t’;
save MEANXR.DAT MEANXR -ascii;
save MEANVR.DAT MEANVR -ascii;
