From dba855e1a5dc601972d4d42ac870b04e4ba68340 Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Mon, 11 Feb 2013 14:52:09 -0500 Subject: Added energy vs stability summary --- energy_vs_stability.m | 26 ++++++++++++++++++++++++++ fitter_check.m | 6 +++--- stability_visualization.m | 3 ++- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 energy_vs_stability.m diff --git a/energy_vs_stability.m b/energy_vs_stability.m new file mode 100644 index 0000000..88223c1 --- /dev/null +++ b/energy_vs_stability.m @@ -0,0 +1,26 @@ +function [energy, stability] = energy_vs_stability( possible_energy, stability, index ) +%ENERGY_VS_STABILITY Summary of this function goes here +% Detailed explanation goes here + + n = size(stability,2); + c = 1:n; + + for i=1:n + fixed_stability(i,1) = stability(i); + end + + for i = 1:n + energy(i,1) = possible_energy(index(i)); + end + + figure(n+1) + textCell = arrayfun(@(x,y) sprintf('(%3.2f, %3.2f)',x,y),energy,fixed_stability,'un',0); + scatter(energy,fixed_stability,25,c,'filled') + xlabel('Energy') + ylabel('Stability') + +% for i = 1:n +% text(energy(i), fixed_stability(i), textCell{i}, 'FontSize',8) +% end + +end diff --git a/fitter_check.m b/fitter_check.m index 5ae2ac4..1796cce 100644 --- a/fitter_check.m +++ b/fitter_check.m @@ -23,11 +23,11 @@ qf=wr2q(wf,rf,lambda); n_truncate = 3; %number of digits in truncated solution [ possible_lens_placement_uniq, possible_lens_placement, possible_sample_energy, possible_lens_set, index ] = remove_similar_soln( possible_sample_energy, possible_lens_placement, possible_lens_set, n_truncate ); -n_visualizations = 5; %number of best solutions to visualize +n_visualizations = 20; %number of best solutions to visualize n_hist = 10000; pick_visualization( possible_sample_energy, possible_lens_placement_uniq, possible_lens_placement, possible_lens_set, index, n_visualizations, q0, qf, Ltot, lambda ); -stability_visualization( possible_lens_placement_uniq, q0, qf, xf, possible_lens_placement, possible_lens_set, lambda, n_visualizations, n_hist, index ) - +[stability]= stability_visualization( possible_lens_placement_uniq, q0, qf, xf, possible_lens_placement, possible_lens_set, lambda, n_visualizations, n_hist, index ) +energy_vs_stability( possible_sample_energy, stability, index) % %Visualize fitness function for fixed f2 and f3 % lens_set = [.075, .075, .203]; diff --git a/stability_visualization.m b/stability_visualization.m index 86d3836..1bd3ba3 100644 --- a/stability_visualization.m +++ b/stability_visualization.m @@ -1,4 +1,4 @@ -function [hist_h, hist_x] = stability_visualization( possible_lens_placement_uniq, q0, qf, xf, optics_position, optics_set, lambda, n, n_hist, index ) +function [stability] = stability_visualization( possible_lens_placement_uniq, q0, qf, xf, optics_position, optics_set, lambda, n, n_hist, index ) %STABILITY_VISUALIZATION Summary of this function goes here % Detailed explanation goes here @@ -12,6 +12,7 @@ for i=1:n str_n = ['# of test points = ', num2str(n_hist)]; str_a = ['Area under curve = ', num2str(area)]; title({'Solution Stability'; str_n; str_a}); + stability(i) = area; end end -- cgit v1.2.3