rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
step3_detailed_ei_simulation.m
Go to the documentation of this file.
1 % script performing a detailed simulation with empirical interpolated
2 % operators comparing the result with a regular detailed simulation.
3 %
4 % required variables that need to be set:
5 % - 'plot_params'
6 % - 'CRBfname'
7 % - 'mu_default'
8 %
9 % generated variables:
10 % - 'sim_data': output of regular detailed simulation
11 % - 'ei_sim_data': output of detailed simulation with empirical
12 % interpolated operators.
13 
14 disp(['comparison between detailed simulation with and without', ...
15  ' interpolation']);
16 tmp = load(fullfile(rbmatlabresult,CRBfname));
17 detailed_data = tmp.detailed_data;
18 
19 %model = model.set_mu(model, mu_default);
20 %sim_data = detailed_simulation(model, detailed_data);
21 plot_params.title = 'detailed simulation without interpolation';
22 plot_sim_data(model, detailed_data, sim_data, plot_params);
23 model.M = cellfun(@(x)(size(x,2) - model.Mstrich), detailed_data.BM, 'UniformOutput', true);
24 
25 %model = model.set_mu(model, mu_default);
26 ei_sim_data = detailed_ei_simulation(model, detailed_data);
27 plot_params.title = 'detailed simulation with empirical interpolation';
28 plot_sim_data(model, detailed_data, ei_sim_data, plot_params);
29 plot_params.title = 'error';
30 diff_data = sim_data;
31 diff_data.U = abs(diff_data.U - ei_sim_data.U);
32 diff_plot_params = plot_params;
33 diff_plot_params.clim = [0-eps, max(max(diff_data.U))];
34 plot_sim_data(model, detailed_data, diff_data, diff_plot_params);
35 disp(['maximum l-infty error:',num2str(max(max(diff_data.U)))]);
36 
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Definition: plot_sim_data.m:17