tuttelikz

Raylegh calculator

Sep 1st, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.76 KB | None | 0 0
  1. %
  2. diameter=input('Diameter of sphere (e.g., 20 nm):')*1e-9;
  3. radius=diameter/2;
  4. lambda=input('Wavelength (e.g., 400 nm):')*1e-9;
  5. n_sphere=input('Refractive index of sphere (e.g., 1.57):');
  6. n_background=input('Refractive index of background (e.g., 1.33):');
  7. w_sphere=input('Specific weight of sphere(e.g., 1.05 g/cc):')*1e3;
  8. w_background=input('Specific weight of background(e.g., 1 g/cc):')*1e3;
  9. concentration=input('Concentration by weight (e.g., 1e-5):');
  10. k=2*pi*n_background/lambda
  11. x=k*radius
  12. n_rel=n_sphere/n_background
  13. Qs = 8*x^4/3*abs((n_rel^2 - 1)/(n_rel^2 + 2))^2
  14. sigma_s=Qs*pi*radius^2
  15. vol_sphere = 4*pi/3*radius^3
  16. N_s=concentration*w_background/(vol_sphere*w_sphere)
  17. mu_s=N_s*sigma_s
  18.  
  19. %%
  20. {'wavelength(nm)' ,'Qs (-)','mus (/cm)'; lambda*1e9, Qs, mu_s/1e2}
Advertisement
Add Comment
Please, Sign In to add comment