rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
lin_evol_plot_detailed_data.m
1 function lin_evol_plot_detailed_data(params, detailed_data,plot_params)
2 %function lin_evol_plot_detailed_data(model, detailed_data, plot_params)
3 %
4 % plot the reduced basis and generation information if available
5 %
6 % required fields of detailed_data:
7 % RB : a matrix of RB DOF vectors
8 %
9 % if the field RB_info is given with generation-information, this
10 % is also plotted
11 
12 % Bernard Haasdonk 23.5.2007
13 
14 % plot reduced basis
15 plot_params.title = 'Orthonormal reduced basis';
16 plot_params.axis_equal = 1;
17 plot_params.clim_tight = 1; % color limits for each plot are set tight
18 plot_params.plot_function = @plot_element_data;
19 plot_data_sequence(params, detailed_data.grid,...
20  detailed_data.RB, plot_params);
21 
22 % plot generation information
23 if isfield(detailed_data,'RB_info')
24  disp(detailed_data.RB_info)
25 
26  % mu-frequency
27  if isfield(detailed_data.RB_info,'mu_sequence')
28  plot_mu_frequency(detailed_data.RB_info.mu_sequence,params);
29  end;
30 
31  % training error-indicator
32  if isfield(detailed_data.RB_info,'max_err_sequence')
33  figure,plot(detailed_data.RB_info.max_err_sequence);
34  title('maximum training error indicator')
35  ylabel([params.RB_error_indicator]);
36  xlabel('basis vector number N');
37  set(gca,'Yscale','log');
38  end;
39 
40  % computation time
41  if isfield(detailed_data.RB_info,'toc_value_sequence')
42  figure,plot(detailed_data.RB_info.toc_value_sequence);
43  title('computation time')
44  ylabel('time [s]');
45  xlabel('basis vector number N');
46  end;
47 
48  % test assessment
49  if isfield(detailed_data.RB_info,'max_test_error_sequence') && ...
50  isfield(detailed_data.RB_info,'max_test_estimator_sequence')
51  figure;
52  estimators = detailed_data.RB_info.max_test_estimator_sequence(:);
53  errors = detailed_data.RB_info.max_test_error_sequence(:);
54  if isempty(isnan(estimators)) && ...
55  isempty(isnan(errors))
56  plot([estimators, errors]);
57  else
58  plot([estimators, errors],'x');
59  end;
60  legend({'estimator','true error'});
61  title('maximum test error and indicator');
62  ylabel('error and estimator');
63  xlabel('basis vector number N');
64  set(gca,'Yscale','log');
65 % disp('please correct plotting in rb_lin_evol_plot_detailed_data!');
66 % keyboard;
67  end;
68 
69 end;
70