summaryrefslogtreecommitdiff
path: root/fitter_check.m
diff options
context:
space:
mode:
Diffstat (limited to 'fitter_check.m')
-rw-r--r--fitter_check.m54
1 files changed, 27 insertions, 27 deletions
diff --git a/fitter_check.m b/fitter_check.m
index 9491295..b7866ae 100644
--- a/fitter_check.m
+++ b/fitter_check.m
@@ -1,39 +1,39 @@
%Permute all possible lens combinations out of set of lenses
-lens_set = [.075, .203, .05, .03];
-lens_set = [.075,.203];
-lens_permutations = pick(lens_set,3,'or');
+lens_set = [.075, .203]; %Given lenses of unique focal lengths
+lens_permutations = pick(lens_set,3,'or'); %3 lens solutions
%Pre-defined Constants
-lambda= 1.064E-6 ;
-Ltot= 1.010675025828971 ;
-r0= 1.0E+100 ;
-w0= 2.563E-5 ;
-x0= 0 ;
-wf= 3.709E-5 ;
-rf= 1.0E+100 ;
-xf= Ltot;
-q0=wr2q(w0,r0,lambda);
-qf=wr2q(wf,rf,lambda);
+lambda= 1.064E-6 ; %Wavelength of beam
+Ltot= 1.010675025828971 ; %Length of optical system
+r0= 1.0E+100 ; %Initial radius of curvature
+w0= 2.563E-5 ; %Initial waist
+x0= 0 ; %Starting position of beam
+wf= 3.709E-5 ; %Desired final waist
+rf= 1.0E+100 ; %Desired final radius
+lens_width = .03; %Lens width
+show_lens_width = 1; %Set to 1 to enable display of lens width on solution propagation plot
+show_lens_position = 1; %Set to 1 to enable display of position of center of lens on solution propagation plot
+display_prop = [show_lens_width, show_lens_position];
+n_truncate = 3; %number of digits in truncated solution
+n_visualizations = 2; %number of best solutions to visualize
+n_hist = 1000; %number of sample points in histogram
+stability_max = 1; %max stability (y-axis) shown on energy vs. stability graph
+self_flag = 0; %Set to 1 to use Self's gaussian beam propagation, otherwise set to 0
%End list
+q0=wr2q(w0,r0,lambda); %Calculate intial q
+qf=wr2q(wf,rf,lambda); %Calculate final q
+
%Mode match
-[ possible_lens_placement, possible_lens_set, possible_sample_energy] = mode_match( q0, qf, Ltot, lambda, lens_permutations );
+[ possible_lens_placement, initial_lens_placement, possible_lens_set, possible_sample_energy] = mode_match( q0, qf, Ltot, lambda, lens_permutations, lens_width, self_flag );
%Remove similar solutions
-n_truncate = 3; %number of digits in truncated solution
[ possible_lens_placement_uniq, possible_lens_placement, possible_sample_energy, possible_lens_set, index ] = remove_similar_soln( possible_sample_energy, possible_lens_placement, possible_lens_set, n_truncate );
-n_visualizations = 5; %number of best solutions to visualize
-pick_visualization( possible_sample_energy, possible_lens_placement_uniq, possible_lens_placement, possible_lens_set, index, n_visualizations, q0, qf, Ltot, lambda );
-
-%Visualize fitness function for fixed f2 and f3
-lens_set = [.075, .075, .203];
-f2= 0.40361319425309 ;
-f3= 0.80361319425309 ;
-%fitness_simplified=@(x) fitness(q0, qf, Ltot, [x, f2, f3], lens_set, lambda );
-%figure(6)
-%ezplot(fitness_simplified, [0,Ltot])
+%Visualize solutions
+pick_visualization( possible_sample_energy, possible_lens_placement_uniq, possible_lens_placement, possible_lens_set, index, n_visualizations, q0, qf, Ltot, lambda, lens_width, display_prop );
-[ w, w_pos ] = self_gbeam_propagation( w0, possible_lens_placement, possible_lens_set, x0, lambda )
-%solution_visualization(q0,x0,qf,xf, optics_placer(possible_lens_placement, possible_lens_set), lambda)
+%Plot energy vs. stability for each solution
+[stability] = stability_visualization( possible_lens_placement_uniq, q0, qf, Ltot, possible_lens_placement, possible_lens_set, lambda, n_visualizations, n_hist, index, self_flag );
+energy_vs_stability( possible_sample_energy, stability, index, stability_max)