diff options
Diffstat (limited to 'waste2waste.max')
-rw-r--r-- | waste2waste.max | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/waste2waste.max b/waste2waste.max index ab980aa..d71c635 100644 --- a/waste2waste.max +++ b/waste2waste.max @@ -1,14 +1,14 @@ writefile("session.out")$ -dist(z):=(MATRIX([1,z],[0,1]))$ -lens(f):=(MATRIX([1,0],[-1/f,1]))$ +dist(z):=(matrix([1,z],[0,1]))$ +lens(f):=(matrix([1,0],[-1/f,1]))$ -abcd(optics_system):=block([tmp:MATRIX([1,0],[0,1])], (for i:1 thru length(optics_system) do tmp:optics_system[i].tmp ), return(tmp))$ +abcd(optics_system):=block([tmp:matrix([1,0],[0,1])], (for i:1 thru length(optics_system) do tmp:optics_system[i].tmp ), return(tmp))$ prop(q0,abcd):=(abcd[1][1]*q0+abcd[1][2])/(abcd[2][1]*q0+abcd[2][2])$ -wr2q(w,r):=1/(1/r-%I*lamb/%PI/(w^2))$ -q2w(q):=sqrt(-lamb/%PI/imagpart(1/q))$ +wr2q(w,r):=1/(1/r-%i*lamb/%pi/(w^2))$ +q2w(q):=sqrt(-lamb/%pi/imagpart(1/q))$ q2r(q):=block([rp:(realpart(1/q))], (if (rp = 0) then @@ -23,15 +23,15 @@ q2r(q):=block([rp:(realpart(1/q))], /* find q0 for such q */ q2w0(q):=block([w,r,w0], w:q2w(q),r:q2r(q), - w0:(w/sqrt(1+(%Pi*w^2/lamb/r)^2)), + w0:(w/sqrt(1+(%pi*w^2/lamb/r)^2)), return (w0) )$ q2z0(q):=block([w,r], - w:q2w(q),r:q2r(q), return(r/(1+(lamb*r/%Pi/w^2)^2)) + w:q2w(q),r:q2r(q), return(r/(1+(lamb*r/%pi/w^2)^2)) )$ -q2q0(q):=%I*%Pi*q2w0(q)^2/lamb$ +q2q0(q):=%i*%pi*q2w0(q)^2/lamb$ -q0f2z_for_colim_lens(q0,f):=f+%Pi*q2w(q0)^2/lamb$ +q0f2z_for_colim_lens(q0,f):=f+%pi*q2w(q0)^2/lamb$ qf2colim_lens_posit(qstart,f):= block([q0,z0,zd], q0:q2q0(qstart), @@ -93,7 +93,7 @@ qffql2z1z2z3(q0,f1,f2,qf,ltotal):=block( qfr:float(realpart(qf)), qfi:float(imagpart(qf)), - eq1:ev(eqt, q0=q0r+q0i*%I, qf=qfr+qfi*%I), + eq1:ev(eqt, q0=q0r+q0i*%i, qf=qfr+qfi*%i), solut:solve([eq1], [z3]), @@ -130,12 +130,12 @@ qffql2z1z2z3(q0,f1,f2,qf,ltotal):=block( we are lookking for z1,l */ q0fq02z1(q0,f,qf):=block([f0,z1,w0tmp:q2w(q0),wftmp:q2w(qf)], - f0:%Pi*w0tmp*wftmp/lamb, + f0:%pi*w0tmp*wftmp/lamb, z1:f+w0tmp/wftmp*sqrt(f^2-f0^2), return(z1) )$ q0fq02z2(q0,f,qf):=block([f0,z2,w0tmp:q2w(q0),wftmp:q2w(qf)], - f0:%Pi*w0tmp*wftmp/lamb, + f0:%pi*w0tmp*wftmp/lamb, z2:f+wftmp/w0tmp*sqrt(f^2-f0^2), return(z2) )$ @@ -173,19 +173,19 @@ q2bq(q):=wr2q(q2w(q),-q2r(q)); Everything calculated in meters. */ /*======== Initial condition ==============================*/ -ltotal:4.85$ +ltotal:.85$ lamb:1.064e-6$ /* starting waste */ -w0:0.30e-3$ +w0:0.675e-3$ r0:1e100$ /* final waste */ -wend:37.09e-6$ +wend:0.023e-3$ rend:1e100$ /* lenses focal length */ f1:.025$ -f2:.075$ -f_col:0.7118$ +f2:.055$ +f_col:0.07118$ /* collimated region size */ dist_betw_f2_f_col:.30$ @@ -212,11 +212,11 @@ qf:prop(qf,abcd([dist(z_col),lens(f_col)]))$ - qf:prop(qf,abcd([dist(dist_betw_f2_f_col),lens(f2)]) )$ /* below something wrong */ dist2waste:ev(-q2z0(qf),numer)$ +print( "===============");dist2waste; rad_now:ev(q2r(qf),numer)$ qf:ev(q2q0(qf),numer)$ /*===========================================*/ |