-
Notifications
You must be signed in to change notification settings - Fork 4
/
gaussianaxialforce.pro
104 lines (88 loc) · 2.35 KB
/
gaussianaxialforce.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;+
;NAME:
; gaussianaxialforce.pro
;
; PURPOSE:
; Calculate the axial force along a conveyor optical axis
;
;CATEGORY:
; Mathematics
;
;CALLING SEQUENCE:
; force = gaussianaxialforce(ap,np,nm,lambda,gamma,thetaG,$
; int=int,NT=NT,npts=npts)
;
;INPUTS:
; ap: radius of particle
;
; np: index of refraction of partice
;
; nm: index of refraction of medium
;
; lambda: vacuum wavelength of trapping light
;
; gamma : Ratio between focal length of objective and width of
; gaussian beam in the objective aperture.
;
; thetaG : maximum convergence angle of objective
;
;
;KEYWORDS:
;
; int: in mW/um^2
;
; NT : Number of terms to use in integration (100 is in general a
; good number)
;
; npts: number of points to calculate force along
;
; norm: When set the force is normalized
;
;OUTPUTS:
; force: [3,npts] force vector at each point along period of conveyor
;
;DEPENDENCY:
;
;MODIFICATION HISTORY:
; 2014/06/13 Written by David B. Ruffner, New York University
function gaussianaxialforce, ap,np,nm,lambda,gamma,thetaG,$
int=int,NT=NT,npts=npts,norm=norm,zrange=zrange
if n_elements(npts) eq 0 then npts = 100
if n_elements(int) eq 0 then int = 1.
if n_elements(NT) eq 0 then NT = 10.
if n_elements(norm) eq 0 then norm = 0
if n_elements(zrange) eq 0 then begin
w0 = sqrt(8*!pi)*lambda/(2*!pi*sin(thetaG))
zr = !pi*w0^2/lambda
zrange = [-zr,zr]
endif
;speed of light
c = 299792458.d; m/s
k = 2*!pi*nm/lambda
;Calculate the force constant
f0mN = !pi*(ap^2.)*int/c & $;mN
f0 = f0mN*10.^9. & $;pN
;print,f0
;Calculate the sphere coefficients
ab = sphere_coefficients(ap,np,nm,lambda)
an = ab[0,*]
bn = ab[1,*]
nc = n_elements(an)-1
;print,nc
;zvalues to calculate force over
zmax = zrange[1]
zmin = zrange[0]
zs = (zmax-zmin)*findgen(npts)/(npts-1.d)+zmin
forces = fltarr(3,npts)
for i=0,npts-1 do begin $
print,string(13b),"getting beam coefficients",i,format='(A,A,I,$)' & $
pos=[0,0,zs[i]] & $
;print,"gamma ",gamma, " pos ",pos & $
bscs = gaussiantrapcoefficientsint(pos,nc,k,gamma,thetaG,NT) & $
;Calculate the force
if norm eq 1 then begin $
forces[*,i] = normbartonforce(bscs,ap,np,nm,lambda) & $
endif else forces[*,i] = f0*normbartonforce(bscs,ap,np,nm,lambda) & $
endfor
return,[transpose(zs),forces]
end