diff options
-rw-r--r-- | abcd.m | 78 | ||||
-rw-r--r-- | propagation.m | 84 |
2 files changed, 84 insertions, 78 deletions
@@ -53,83 +53,5 @@ endfunction -########################################## -lambda= 1.064E-6 ; -Ltot= 1 ; -r0= 1.0E+100 ; -w0= 25.63e-6; -#w0= 3.79E-4 ; -lns1.abcd=abcd_lens( 0.25 ) ; -lns1.x= 0.37680270021479 ; -lns2.abcd=abcd_lens( 0.1 ) ; -lns2.x= 0.90277021575519 ; -rf=1e100; -wf=25.630e-6; -########################################## -source("answ.txt") - - -q0=waste_r2q(w0,r0,lambda); -optics=list(lns1,lns2,lns3); -optics_forward=optics; - -x=0:.01:Ltot; -printf("=================================\n") -q1=prop(x,q0,optics); -printf("=================================\n") -w1=q2waste(q1, lambda); -r1=q2radius(q1,lambda); - -printf("=================================\n") -#q1b=prop(Ltot,q0,optics) -#wb=q2waste(q1b, lambda) -#rb=-q2radius(q1b,lambda) -#because of back propogation -rf=-rf; -q1b=waste_r2q(wf,rf,lambda); - -lns1.x=Ltot-lns1.x; -lns2.x=Ltot-lns2.x; -lns3.x=Ltot-lns3.x; -optics=list(lns3,lns2,lns1); -q2b=prop(x,q1b,optics); -printf("=================================\n") -wb=q2waste(q2b, lambda); -rb=q2radius(q2b,lambda); -xb=Ltot-x; -#plot (x,w1, "1") -plot (x,w1, "1", xb, wb, "2") - -printf("=================================\n") -printf("======= final check =============\n") -printf("======= after propogatin ========\n") -printf("following are theoretical values: \n") -w0 -r0 -wf -rf -q0=waste_r2q(w0,r0,lambda); -optics=list(lns1,lns2,lns3); -qtf=prop(Ltot, q0, optics_forward); -printf("values below should match 'wf' and 'rf': \n") -waste = q2waste(qtf, lambda) -radius = q2radius(qtf,lambda) - -pause(100) -quit() -system("cat answ.txt answ.txt") -answ=menu("Is it reasonable mode matching?","yes","no") -if (answ ==1) - printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxx") - system("cat answ.txt >>good_mode_matching.txt") -else - printf("------------------------------") -endif - -exit -# -#gset term postscript -#gset output "foo.ps" -#plot (x,w1, "1", xb, wb, "2") diff --git a/propagation.m b/propagation.m new file mode 100644 index 0000000..eb45c24 --- /dev/null +++ b/propagation.m @@ -0,0 +1,84 @@ + +source("abcd.m") + + +########################################## +lambda= 1.064E-6 ; +Ltot= 1 ; +r0= 1.0E+100 ; +w0= 25.63e-6; +#w0= 3.79E-4 ; +lns1.abcd=abcd_lens( 0.25 ) ; +lns1.x= 0.37680270021479 ; +lns2.abcd=abcd_lens( 0.1 ) ; +lns2.x= 0.90277021575519 ; +rf=1e100; +wf=25.630e-6; +########################################## +source("answ.txt") + + +q0=waste_r2q(w0,r0,lambda); +optics=list(lns1,lns2,lns3); +optics_forward=optics; + +x=0:.001:Ltot; +printf("=================================\n") +q1=prop(x,q0,optics); +printf("=================================\n") +w1=q2waste(q1, lambda); +r1=q2radius(q1,lambda); + +printf("=================================\n") +#q1b=prop(Ltot,q0,optics) +#wb=q2waste(q1b, lambda) +#rb=-q2radius(q1b,lambda) +#because of back propogation +rf=-rf; +q1b=waste_r2q(wf,rf,lambda); + +lns1.x=Ltot-lns1.x; +lns2.x=Ltot-lns2.x; +lns3.x=Ltot-lns3.x; +optics=list(lns3,lns2,lns1); +q2b=prop(x,q1b,optics); +printf("=================================\n") +wb=q2waste(q2b, lambda); +rb=q2radius(q2b,lambda); +xb=Ltot-x; +#plot (x,w1, "1") +plot (x,w1, "1", xb, wb, "2") + +printf("=================================\n") +printf("======= final check =============\n") +printf("======= after propogatin ========\n") +printf("following are theoretical values: \n") +w0 +r0 +wf +rf +q0=waste_r2q(w0,r0,lambda); +optics=list(lns1,lns2,lns3); +qtf=prop(Ltot, q0, optics_forward); +printf("values below should match 'wf' and 'rf': \n") +waste = q2waste(qtf, lambda) +radius = q2radius(qtf,lambda) + +pause(100) +quit() +system("cat answ.txt answ.txt") +answ=menu("Is it reasonable mode matching?","yes","no") +if (answ ==1) + printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxx") + system("cat answ.txt >>good_mode_matching.txt") +else + printf("------------------------------") +endif + +exit +# +#gset term postscript +#gset output "foo.ps" +#plot (x,w1, "1", xb, wb, "2") + + |