diff options
-rw-r--r-- | solution_visualization.m | 15 | ||||
-rw-r--r-- | trial_solution.m | 25 |
2 files changed, 30 insertions, 10 deletions
diff --git a/solution_visualization.m b/solution_visualization.m index 4662378..b886722 100644 --- a/solution_visualization.m +++ b/solution_visualization.m @@ -1,15 +1,15 @@ -trial_solution; +function solution_visualization(q0,x0, qf, xf, optics, lambda) + + -q0=wr2q(w0,r0,lambda); x=linspace(x0,xf,1000); % we will calculate beam profile between x0 and xf fprintf('======== Forward propagation ======\n') q_forward=gbeam_propagation(x,q0,x0,optics); [w_forward,r_forward]=q2wr(q_forward, lambda); fprintf('======== Backward propagation =====\n') -q_backward0=wr2q(wf,rf,lambda); -q_backward=gbeam_propagation(x,q_backward0,xf,optics); +q_backward=gbeam_propagation(x,qf,xf,optics); [w_backward,r_backward]=q2wr(q_backward, lambda); fprintf('========= Plotting ================\n') @@ -22,12 +22,7 @@ legend({'forward propagation', '', 'backward propagation', ''}) fprintf('======= final check =============\n') fprintf('following are desired values: \n') -w0 -r0 -x0 -wf -rf -xf + fprintf('======= after propagation ========\n') fprintf('values below should match wf and rf: \n') [waste_at_the_end,radius_at_the_end] = q2wr(q_forward(end), lambda); diff --git a/trial_solution.m b/trial_solution.m new file mode 100644 index 0000000..21e6b00 --- /dev/null +++ b/trial_solution.m @@ -0,0 +1,25 @@ +% ########################################## +lambda= 1.064E-6 ; +Ltot= 1.010675025828971 ; +r0= 1.0E+100 ; +w0= 2.563E-5 ; +x0= 0 ; +lns1.abcd=abcd_lens( 0.075 ) ; +lns1.x= 0.21358727296049 ; +lns2.abcd=abcd_lens( 0.075 ) ; +lns2.x= 0.40361319425309 ; +lns3.abcd=abcd_lens( 0.203 ) ; +lns3.x= 0.80361319425309 ; +wf= 3.709E-5 ; +rf= 1.0E+100 ; +xf= Ltot; + +optics={lns1,lns2,lns3}; +% ########################################## + +q0=wr2q(w0,r0,lambda); +x0=0; +qf=wr2q(wf,rf,lambda); +xf=Ltot; + +solution_visualization(q0,x0, qf, xf, optics, lambda) |