rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
cmp_rb_detailed_simulation.m
Go to the documentation of this file.
1 % small script performing a reduced basis simulation and a detailed
2 % simulation for specified parameters. Hereby, visual difference
3 % can checked.
4 
5 % Bernard Haasdonk 16.9.2007
6 
7 clear all;
8 echo on;
9 %load demo_nonlin_evol_detailed_data_8_trajectories;
10 %load(fullfile(rbmatlabresult,'chemnitz_detailed_data'));
11 load(fullfile(rbmatlabresult,'burgers_fv_detailed_interpol'));
12 echo off;
13 
14 offline_data = rb_offline_prep(detailed_data,params);
15 
16 params.M = 60;
17 params.N = 40;
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);
21 
22  % M usually less than N !!
23 
24  reduced_data = rb_online_prep(offline_data,params);
25  %params.c_init = 1;
26  %params.k = 5e-8;
27  %params.c_init = 0.4;
28  %params.beta = 0.4;
29  params.c_init_lo = 0.1;
30  params.vrot_angle = -pi/5;
31 
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);
39 
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);
46 
47  % plot difference
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);
51 
52  l2_errors = fv_l2_error(Urb,Udetailed,detailed_data.W);
53 
54  figure,plot(l2_errors);
55 
56  title('l2-difference');
57 % TO BE ADJUSTED TO NEW SYNTAX
58 %| \docupdate