1 % small script performing a reduced basis simulation and a detailed
2 % simulation
for specified parameters. Hereby, visual difference
5 % Bernard Haasdonk 16.9.2007
9 %load demo_nonlin_evol_detailed_data_8_trajectories;
10 %load(fullfile(rbmatlabresult,
'chemnitz_detailed_data'));
11 load(fullfile(rbmatlabresult,
'burgers_fv_detailed_interpol'));
14 offline_data = rb_offline_prep(detailed_data,params);
18 %params.N = 25; params.M = length(detailed_data.TM);
19 %params.N = 123; params.M = length(detailed_data.TM);
20 %params.N = size(detailed_data.RB,2); params.M = length(detailed_data.TM);
22 % M usually less than N !!
24 reduced_data = rb_online_prep(offline_data,params);
29 params.c_init_lo = 0.1;
30 params.vrot_angle = -pi/5;
32 disp(
'performing reduced simulation:');
33 simulation_data = rb_simulation(reduced_data,params);
34 Urb = rb_reconstruction(detailed_data,simulation_data);
35 params.title =
'Solution from RB-simulation';
36 plot_element_data_sequence([],Urb,params);
37 % plot_element_data_sequence([],Unonlin(:,1:100),params);
38 %plot_rb_reconstruction(detailed_data,simulation_data,params);
40 disp(
'performing detailed simulation:');
41 % run linear simulation
42 Udetailed = detailed_simulation(detailed_data.grid,params);
43 params.title =
'Solution from detailed simulation';
44 % plot_element_data_sequence([],Ulin(:,1:100),lparams);
45 plot_element_data_sequence([],Udetailed,params);
48 params.title =
'Difference of detailed and reduced';
49 % plot_element_data_sequence([],Ulin(:,1:100)-Unonlin(:,1:100),params);
50 plot_element_data_sequence([],Urb-Udetailed,params);
52 l2_errors =
fv_l2_error(Urb,Udetailed,detailed_data.W);
54 figure,plot(l2_errors);
56 title(
'l2-difference');
57 % TO BE ADJUSTED TO NEW SYNTAX