-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconveyorradialforce.pro
93 lines (77 loc) · 2.04 KB
/
conveyorradialforce.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
;+
;NAME:
; conveyorradialforce.pro
;
; PURPOSE:
; Calculate the radial force at the axial fixed pt
;
;CATEGORY:
; Mathematics
;
;CALLING SEQUENCE:
; force = conveyorradialforce(z_fixed,ap,np,nm,eta1,eta2,intensity,npts)
;
;INPUTS:
; z_fixed:the axial stable fixed point in um
;
; ap: radius of particle in um
;
; np: index of refraction of partice
;
; nm: index of refraction of medium
;
; lambda: vacuum wavelength of trapping light in um
;
; eta1: norm axial wavevector of first bessel beam component
;
; eta2: norm axial wavevector of second bessel beam component
;
; int: in mW/um^2
;
; npts: number of points to calculate force along
;
;OUTPUTS:
; force: [3,npts] force vector at each point along period of conveyor
;
;DEPENDENCY:
;
;MODIFICATION HISTORY:
; 2014/04/14 Written by David B. Ruffner, New York University
; 2014/06/02 DBR:Fixed bug with f0, updated documentation
function conveyorradialforce, z_fixed,ap,np,nm,lambda,eta1,eta2,$
int=int,npts=npts
if n_elements(npts) eq 0 then npts = 100
if n_elements(int) eq 0 then int = 1.
;speed of light
c = 299792458.d; m/s
theta1 = acos(eta1)
theta2 = acos(eta2)
k = 2*!pi*nm/lambda
;Calculate the force constant
f0mN = !pi*(ap^2)*int/c & $;mN
f0 = f0mN*10.^9. & $;pN
;Calculate the sphere coefficients
ab = sphere_coefficients(ap,np,nm,lambda)
an = ab[0,*]
bn = ab[1,*]
nc = n_elements(an)-1
;; ;xvalues to calculate force over
;; xmax = 2*ap
;; xmin = -2*ap
;; xs = (xmax-xmin)*findgen(npts)/(npts-1)+xmin
;yvalues to calculate force over
ymax = 2*ap
ymin = -2*ap
ys = (ymax-ymin)*findgen(npts)/(npts-1)+ymin
forces = fltarr(3,npts)
for i=0,npts-1 do begin $
print,string(13b),"getting beam coefficients",i,format='(A,A,I,$)' & $
pos=[0,ys[i],z_fixed] & $
bscs1 = besselcoefficients(pos,theta1,nc,k) & $
bscs2 = besselcoefficients(pos,theta2,nc,k) & $
bscs = (bscs1+bscs2)/2. & $
;Calculate the force
forces[*,i] = f0*normbartonforce(bscs,ap,np,nm,lambda) & $
endfor
return,[transpose(ys),forces]
end