From 381b3799d1e7b54e60802dfb7cc83834a72d06a2 Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Tue, 23 Oct 2012 17:46:09 -0400 Subject: Assume/force collimated beam at 3rd lens --- fitter_check.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fitter_check.m') diff --git a/fitter_check.m b/fitter_check.m index 706429a..3e0a1df 100644 --- a/fitter_check.m +++ b/fitter_check.m @@ -43,7 +43,7 @@ lens_size = .03; %Lens permutations lens_permutations = perms( [ focal_length1, focal_length2, focal_length3 ]); -n_shuffles=20; +n_shuffles=10; %Check if permutation has duplicates lens_permutations = unique(lens_permutations,'rows'); @@ -55,7 +55,10 @@ for i = 1:n_perms lenses_choice=lens_permutations(i,:) for iteration = 1:n_shuffles - optics_x_rand = sort(lens_size+(xf-2*lens_size)*rand(1,3)); + f3=lenses_choice(3); + x3=xf-f3; % last lense transfer collimated region to focused spot + optics_x_rand = sort(lens_size+(x3-2*lens_size)*rand(1,2)); + optics_x_rand = [optics_x_rand, x3]; fitness_simplified=@(x) fitness(q0, qf, Ltot, x, lenses_choice, lambda ); [x_sol, energy]=fminsearch(fitness_simplified, optics_x_rand, optimset('TolX',1e-8,'TolFun',1e-8,'MaxFunEvals',1e8,'MaxIter',200)); @@ -101,7 +104,7 @@ possible_soln_trunc = round(possible_soln*10^n)./10^n; [possible_soln_uniq, index] = unique(possible_soln_trunc,'rows','stable'); %Unique solutions only %Visualize five best solutions -n_possible_soln = min(5,size(possible_soln,1)); +n_possible_soln = min(5,size(possible_soln_uniq,1)); for n_graph = 1:n_possible_soln figure(n_graph+1) w_final_trial = solution_visualization(q0,x0, qf, xf, optics_placer(possible_soln(index(n_graph),:), possible_lens_pos(index(n_graph),:)), lambda); -- cgit v1.2.3