diff options
author | Matt Argao <mcargao@email.wm.edu> | 2012-10-23 17:46:09 -0400 |
---|---|---|
committer | Matt Argao <mcargao@email.wm.edu> | 2012-10-23 17:46:09 -0400 |
commit | 381b3799d1e7b54e60802dfb7cc83834a72d06a2 (patch) | |
tree | 8aa3ddc94c6526ab0c67dbb95103ec464a74f0fc | |
parent | a9779a948076f7e1edf1ef7c5c0b4abbd9866ad3 (diff) | |
download | mode_match-381b3799d1e7b54e60802dfb7cc83834a72d06a2.tar.gz mode_match-381b3799d1e7b54e60802dfb7cc83834a72d06a2.zip |
Assume/force collimated beam at 3rd lens
-rw-r--r-- | fitter_check.m | 9 |
1 files changed, 6 insertions, 3 deletions
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); |