From 08021ec0d6a395b3e56e0aca73b35a88b80eb709 Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Tue, 13 Nov 2012 16:52:37 -0500 Subject: Makes use of new functions --- fitter_check.m | 51 +++++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/fitter_check.m b/fitter_check.m index 51e1480..5b0f8e3 100644 --- a/fitter_check.m +++ b/fitter_check.m @@ -1,9 +1,9 @@ +%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'); -% ########################################## -% Sample Solution +%Pre-defined Constants lambda= 1.064E-6 ; Ltot= 1.010675025828971 ; r0= 1.0E+100 ; @@ -12,42 +12,29 @@ x0= 0 ; wf= 3.709E-5 ; rf= 1.0E+100 ; xf= Ltot; - q0=wr2q(w0,r0,lambda); -x0=0; qf=wr2q(wf,rf,lambda); -xf=Ltot; -% -% optics={lns1,lns2,lns3}; -% figure(1) -% w_final_handmade = solution_visualization(q0,x0, qf, xf, optics, lambda); -% title('Hand made'); -% ########################################## +%End list + +%Mode match +[ possible_lens_placement, possible_lens_set, possible_sample_energy] = mode_match( q0, qf, Ltot, lambda, lens_permutations ); -[ possible_lens_placement, possible_lens_set, possible_sample_energy, n_possible_lens_placement, index ] = mode_match( q0, qf, Ltot, lambda, lens_permutations ); +%Remove similar solutions +n_truncate = 4; +[ possible_lens_placement_uniq, possible_lens_placement, possible_lens_set, index ] = remove_similar_soln( possible_sample_energy, possible_lens_placement, possible_lens_set, index, n_truncate ); %Visualize five best solutions -for n_graph = 1:n_possible_lens_placement - figure(n_graph) - w_final_trial = solution_visualization(q0,x0, qf, xf, optics_placer(possible_lens_placement(index(n_graph),:), possible_lens_set(index(n_graph),:)), lambda); - - str1=sprintf('\n f_1 = %0.4f, x_1 = %0.4f\n',possible_lens_set(index(n_graph),1),possible_lens_placement(index(n_graph),1)); - str2=sprintf('f_2 = %0.4f, x_2 = %0.4f\n',possible_lens_set(index(n_graph),2),possible_lens_placement(index(n_graph),2)); - str3=sprintf('f_3 = %0.4f, x_3 = %0.4f\n',possible_lens_set(index(n_graph),3),possible_lens_placement(index(n_graph),3)); - tstr='Other Solutions'; - title([tstr, str1, str2, str3]); -end +n_visualizations = 5; +pick_visualization( possible_lens_placement_uniq, possible_lens_placement, possible_lens_set, index, n_visualizations, q0, qf, Ltot, lambda ); -possible_lens_placement(index(1:n_graph),:) -possible_lens_set(index(1:n_graph),:) possible_sample_energy(index(1:n_graph),:) -%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]) \ No newline at end of file +% %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]) \ No newline at end of file -- cgit v1.2.3