v=1520;
n=1;
f=30;
H=100;
cb=1800;
cw=1500;
m=2.2;
v1=1560;v2=1570;
integrand=@(v) (dept_fun(v,n,f,2.2,1800,1500).*grsp_fun(v,n,dept_fun(v,n,f,2.2,1800,1500),2.2,1800,1500))./( v-grsp_fun(v,n,dept_fun(v,n,f,2.2,1800,1500),2.2,1800,1500).*sqrt(v2.^2-v.^2));
ycs1=2*cot(0.05)*integral(@(v)integrand(v),v1,v2)
function dept=dept_fun(v,n,f,m,cb,cw)
dum1=sqrt(cw.^(-2)-v.^(-2));
dum2=sqrt((cw.^(-2)-v.^(-2))/(v.^(-2)-cb.^(-2)));
dept=1./(2*pi*f*dum1)*(pi*n-atan(m*dum2));
end
function grsp=grsp_fun(v,n,H,m,cb,cw)
dum2_1=sqrt((cw.^(-2)-v.^(-2))/(v.^(-2)-cb.^(-2)));
dum1=1./(v.^(2)*cw.^(-2)-1);
dum_2_up=m.*(cw.^(-2)-cb.^(-2)).*(v.^2.*cw.^(-2)-1).^(-.5).*(-(v.^2).*cb.^-2+1).^(-.5);
dum_2_low=(pi*n-atan(m*dum2_1))*(m.^2*cw.^-2-cb.^-2-(m.^2-1)*v.^-2);
dum_all=dum1+dum_2_up./dum_2_low;
grsp=v.*(1+(dum_all).^-1).^-1;
end
Best Answer