3 % plot the reduced basis, the colateral reduced basis, the interpolation
4 % points and the maximum error decrease during CRB generation.
7 % h : figure handle of plot
9 % Bernard Haasdonk 23.5.2007
11 %plot_RB_sequence(detailed_data,model);
15 if ~isfield(plot_params,
'plot')
16 plot_params.plot = model.plot;
19 if isfield(detailed_data,'RB') && ~isempty(detailed_data.RB)
22 tpp.title = 'Orthonormal reduced basis';
23 tpp = rmfield(tpp, 'clim');
27 disp('warning: no RB in detailed data!! not suitable for simulation yet!');
30 if isfield(detailed_data, 'QM')
32 num_interpolations = min(3,length(detailed_data.QM));
34 for i = 1:num_interpolations
36 tpp.title = ['Interpolation basis functions q_m for operator no. ', ...
39 tpp = rmfield(tpp, 'clim');
45 disp([
'Interpolation matrices B should have lower-triangular structure,' ...
47 for i = 1:num_interpolations
48 BM_n = length(detailed_data.BM{i});
49 mask_upper_triangular_block = repmat(1:BM_n,BM_n,1)>repmat((1:BM_n)
',1,BM_n);
50 if(all(abs(detailed_data.BM{i}(mask_upper_triangular_block)) < 10000*eps))
51 disp([num2str(i), 'th matrix B fulfills the condition
']);
54 disp('The following matrix is not of lower-triangular form
');
56 disp(detailed_data.BM{i});
61 for i = 1:num_interpolations
62 u = zeros(detailed_data.grid.nelements,1);
63 u(detailed_data.TM{i}) = 1;
64 plot_params.plot(detailed_data.grid, u, plot_params);
65 title(['Interpolation points/DOFS
for operator no.
', num2str(i)]);
70 % plot selected snaphots (mu_1, mu_2, t^k) in a 3d plot in case of 2d parameter
72 if length(model.mu_names)==2
73 for i = 1:num_interpolations
74 Msize = size(detailed_data.QM{i},2);
75 colorm = colormap(hot(Msize));
76 colorm = colorm(Msize:-1:1,:);
77 coord = [detailed_data.ei_info{i}.extension_mus(:,1:Msize); ...
78 detailed_data.ei_info{i}.extension_filepos(1:Msize)'];
79 scatter3(coord(1,:),coord(2,:),coord(3,:),20,colorm,
'filled');
80 xlabel([
'\mu_1 = ',model.mu_names{1}]);
81 ylabel([
'\mu_2 = ',model.mu_names{2}]);
82 %ylabel([
'\mu_2 = c_{init}']);%,model.mu_names{2}]);
83 zlabel(
'time index k');
84 title([
'snapshots selected for collateral basis for operator no.', num2str(i)])
89 disp('skipped plot of ei-snapshot-distribution, dimension of mu not 2');
93 for i = 1:num_interpolations
94 h=plot(detailed_data.ei_info{i}.max_err_sequence);
95 set(gca,
'Yscale',
'log');
96 title([
'EI-interpol error decrease for operator no.', num2str(i)]);
97 if i < num_interpolations
function h = nonlin_evol_plot_detailed_data(model, detailed_data, plot_params)
plot the reduced basis, the colateral reduced basis, the interpolation points and the maximum error d...
function p = plot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...