summaryrefslogtreecommitdiff
path: root/stability_visualization.m
blob: ba0a8de62bf5626c0c14eb0989bf1ec6f18a4754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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

n_possible_lens_placement = min(n, size(possible_lens_placement_uniq,1));

for i=1:n
    figure(i)
    [hist_h, hist_x] = solution_stability( q0, qf, xf, optics_position(index(i),:), optics_set(index(i),:), lambda, n_hist  );
    subplot(2,1,2); plot(hist_x, hist_h);  
    area = trapz(hist_x, hist_h);
    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