aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Argao <mcargao@email.wm.edu>2012-11-08 17:15:02 -0500
committerMatt Argao <mcargao@email.wm.edu>2012-11-08 17:15:02 -0500
commit7890155ab9f1808cbbd0295057274c003e8cefdd (patch)
tree601d642d0ef4d4bbe190d4e154bc804a6cb91900
parentf794847d6069037e66e4e80359c531548d3bbd27 (diff)
parentb046d548e73259fcfd74e6b01b0440441e4c8b07 (diff)
downloadmode_match-7890155ab9f1808cbbd0295057274c003e8cefdd.tar.gz
mode_match-7890155ab9f1808cbbd0295057274c003e8cefdd.zip
Merge branch 'exper'
Conflicts: fitness.m mode_match.m
-rw-r--r--fitness.m6
-rw-r--r--fitter_check.m7
-rw-r--r--mode_match.m8
3 files changed, 14 insertions, 7 deletions
diff --git a/fitness.m b/fitness.m
index 00cbada..752e748 100644
--- a/fitness.m
+++ b/fitness.m
@@ -8,13 +8,11 @@ function [Energy, Waist, Penalty] = fitness( q_0, q_final, x_final, optics_posit
[Waist_trial_forward, Radius_trial_forward] = q2wr(q_f_trial_forward, lambda);
q_f_trial_backward = gbeam_propagation(x,q_final,x_final,optics_placer(optics_positions, optics_focal_length));
[Waist_trial_backward, Radius_trial_backward] = q2wr(q_f_trial_backward, lambda);
-
+
Energy = 0;
Penalty_waist_mismatch = sum(abs((Waist_trial_forward-Waist_trial_backward)./min(Waist_trial_forward, Waist_trial_backward)))/Np;
- Penalty_waist_mismatch = 0*Penalty_waist_mismatch + 1e9*sum(abs((Waist_trial_forward-Waist_trial_backward)))/Np;
- Penalty_radius_mismatch = sum(abs((Radius_trial_forward-Radius_trial_backward)./max(Radius_trial_forward, Radius_trial_backward)))/Np;
- Energy = 0*Penalty_radius_mismatch + Penalty_waist_mismatch;
+ Energy = 1e-2*Penalty_waist_mismatch;
% penalty calculation
% do not put lenses too close to each other and end positions
diff --git a/fitter_check.m b/fitter_check.m
index 20a7e9d..51e1480 100644
--- a/fitter_check.m
+++ b/fitter_check.m
@@ -30,7 +30,12 @@ xf=Ltot;
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);
- title('Other Solutions');
+
+ 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
possible_lens_placement(index(1:n_graph),:)
diff --git a/mode_match.m b/mode_match.m
index 596cff1..27affcb 100644
--- a/mode_match.m
+++ b/mode_match.m
@@ -1,9 +1,9 @@
-function [ possible_lens_placement, possible_lens_set, possible_sample_energy, n_possible_lens_placement, index ] = mode_match( q0, qf, Ltot, lambda, lens_permutations )
+function [ possible_lens_placement, possible_lens_set, possible_sample_energy, pick_of_n_best_lens_placements, index ] = mode_match( q0, qf, Ltot, lambda, lens_permutations )
%MODE_MATCH Summary of this function goes here
% Detailed explanation goes here
n_perms = size(lens_permutations,1);
-n_shuffles=1; %number of random placements of lenses
+n_shuffles=20; %number of random placements of lenses
%Initialize sample arrays
N = n_perms * n_shuffles;
@@ -45,6 +45,10 @@ n=4;
possible_lens_placement_trunc = round(possible_lens_placement*10^n)./10^n;
[possible_lens_placement_uniq, index] = unique(possible_lens_placement_trunc,'rows','stable'); %Unique solutions only
+<<<<<<< HEAD
n_possible_lens_placement = min(5,size(possible_lens_placement_uniq,1));
+=======
+pick_of_n_best_lens_placements = min(5,size(possible_lens_placement_uniq,1));
+>>>>>>> exper
end