From 8c4278397279db6644624f79179c05bc300a78da Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Mon, 4 Feb 2013 16:01:09 -0500 Subject: Added ability to visulize stability of lens solutions. --- fitter_check.m | 2 +- solution_stability.m | 15 +++++++++++++++ stability_visualizer.m | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 solution_stability.m create mode 100644 stability_visualizer.m diff --git a/fitter_check.m b/fitter_check.m index 9acf990..dd87775 100644 --- a/fitter_check.m +++ b/fitter_check.m @@ -17,7 +17,7 @@ qf=wr2q(wf,rf,lambda); %End list %Mode match -[ possible_lens_placement, initial_possible_lens_set, 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 ); %Remove similar solutions n_truncate = 3; %number of digits in truncated solution diff --git a/solution_stability.m b/solution_stability.m new file mode 100644 index 0000000..f3363b1 --- /dev/null +++ b/solution_stability.m @@ -0,0 +1,15 @@ +function [ hist_h, hist_x ] = solution_stability( q_0, q_final, x_final, optics_positions, optics_focal_length, lambda ) +%SOLUTION_STABILITY Summary of this function goes here +% Detailed explanation goes here +n = 10000; +lens_displacement = 10^-3; +x = lens_displacement*randn(n,3); + +for i=1:n + xd= x(i,:); + fitness_array(i) = fitness( q_0, q_final, x_final, optics_positions + xd, optics_focal_length, lambda ); +end + +[hist_h, hist_x] = hist(fitness_array,100); +end + diff --git a/stability_visualizer.m b/stability_visualizer.m new file mode 100644 index 0000000..44242f0 --- /dev/null +++ b/stability_visualizer.m @@ -0,0 +1,8 @@ +for i=1:5 + optics_position = possible_lens_placement(i,:); + optics_set = possible_lens_set(i,:); + + [hist_h, hist_x] = solution_stability( q0, qf, xf, optics_position, optics_set, lambda ); + plot(hist_x, hist_h); +end + \ No newline at end of file -- cgit v1.2.3