clear
clc
format long
l1=2400 ;l2=2000;l3= 2000; D=2; Vsaw=3488; w=(Vsaw/(4*D))*pi*2;frq=433;ww=(433)*pi*2;
a=2; N=5; ws=10610; B=zeros(5,ws); C=zeros(1,ws); ref=0.0344;
absorb=0.9929; M=1;
t=(2*l1+4*D*(1-1)+4*a*(1-1))/Vsaw-0.05:0.00024: (2*l1+4*D*(18-1)*3+4*a*(5-1)+4+2*l2*2)/Vsaw+0.1579;
ref=0.0344;
for n=1:5
for r=1:18
D1=(2*l1+4*D*(r-1)+ 4*a*(n-1))/(3488/frq);
DD=(D1-fix(D1))*2*pi;
xxx=r;
xr=0;
for i=1:ws
if mod(i,2500)==0
xr=xr+1
if ((r<=6)&(t(i)>(2*l1+4*D*(r-1)+4*a*(n-1))/Vsaw)&(t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
elseif ((r>6)&(r<=12) & (t(i)>(2*l1+4*D*(r-1)+4*a*(n-1)+2*l2)/Vsaw) & (t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-l2*2*ww/Vsaw-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
elseif ((r>12)&(r<=18)&(t(i)>(2*l1+4*D*(r-1)+4*a*(n-1)+4+2*l2*2)/Vsaw) & (t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-4/Vsaw-l2*2*ww/Vsaw*2-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
else
s(r,i,n)=0;
end
else
if ((r<=6)&(t(i)>(2*l1+4*D*(r-1)+4*a*(n-1))/Vsaw)&(t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
elseif ((r>6)&(r<=12) & (t(i)>(2*l1+4*D*(r-1)+4*a*(n-1)+2*l2)/Vsaw) & (t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-l2*2*ww/Vsaw-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
elseif ((r>12)&(r<=18)&(t(i)>(2*l1+4*D*(r-1)+4*a*(n-1)+4+2*l2*2)/Vsaw) & (t(i)
s(r,i,n)=absorb^xr*M*1/N*ref*(1-ref)^(r-1)*(sin(ww*t(i)-2*l1*ww/Vsaw-4/Vsaw-l2*2*ww/Vsaw*2-4*D*(r-1)*ww/Vsaw-4*a*(n-1)*ww/Vsaw+DD*ww));
else
s(r,i,n)=0;
end
end
end
end
end
for n=1:5
for r=1:18
for i=1:ws
A(r,i,n) = real(s(r,i,n));
end
end
end
for n=1:5
for r=1:18
B(n,: )=B(n,: )+A(r,:,n) ;
end
end
for n=2:5
B(1,: )=B(1,: )+B(n,: );
end
C=B(1,: );
[Last edited by AlvinLiu1989 on 2012-5-2 at 16:53]