%solution for problem 4 in assignment 1: 

n=1.15;
lambda=0.66*0.75; %wavelength in micron
D=[10^-3:10^-3:100]; %particle size in micron
ro=2*pi*D*(n-1)/lambda;


Qc=2-4*sin(ro)./ro +4*[1-cos(ro)]./ro.^2;
C_ext=Qc*pi.*D.^2/4;
alpha_v=C_ext./(pi.*D.^3/6);

subplot(3,1,1)
semilogx(ro,C_ext,'k-')
ylabel('C_{ext}')
subplot(3,1,2)
semilogx(ro,Qc,'k-')
ylabel('Q_c')
subplot(3,1,3)
semilogx(ro,alpha_v,'k-')
ylabel('\alpha_v')
xlabel('\rho')
