3 % plots an output structure generated by stochastic_error_estimation()
6 % output: output structure generated by stochastic_error_estimation()
8 % Required fields of output:
10 % inds: time index of maximum error values in trajectory
11 % run_name: unique name of error estimation run used
for plot titles.
12 % bound: maxmimum error values to be plotted. Above
this values error
14 % stab_limit: error values below
this value are shaded in a different color in
16 % pf_descr: plot field description
for axis labeling.
17 % tsamples: plot field ranges
18 % samples: combined plot field ranges
20 % Optional fields of output:
21 % error_label: label
for the y respectively z axis where the error or error
22 % estimator is plotted. (
default=
'error')
24 i = logical(output.errs>output.bound);
25 output.errs(i) = output.bound;
26 i = logical(isnan(output.errs));
27 output.errs(i) = output.bound;
28 C = ones(size(output.errs));
29 i = logical(output.errs<output.stab_limit);
32 if ~isfield(output,
'error_label')
33 output.error_label = 'error';
37 if length(output.tsamples) == 2
38 if isempty(find(C==1,1)); % i.e. all stable
39 surf(output.tsamples{1},output.tsamples{2},output.errs
');
40 else % some not stable
41 surf(output.tsamples{1},output.tsamples{2},output.errs',C
');
44 % figure, pcolor(Ms, Ns,C);
45 set(gca,'Zscale
','log
');
46 xlabel(output.pf_descr{1});
47 ylabel(output.pf_descr{2});
48 zlabel(output.error_label);
50 plot(output.samples, output.errs');
51 xlabel(output.pf_descr{1});
52 ylabel(output.error_label);
53 set(gca,
'Yscale',
'log');
55 run_name = strrep(output.run_name,
'_',
' ');
56 title([run_name,
' L-infty([0,T],L2) error']);
59 if length(output.tsamples) == 2
60 surf(output.tsamples{1}, output.tsamples{2}, real(output.inds
'));
61 xlabel(output.pf_descr{1});
62 ylabel(output.pf_descr{2});
65 plot(output.samples, output.inds');
66 xlabel(output.pf_descr{1});
70 title(
'time index of maximum l2-error');
71 %set(gca,
'Zscale',
'log');
function plot_error_landscape(output)
plots an output structure generated by stochastic_error_estimation()