rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
hp_demo_errordistance.m
Go to the documentation of this file.
1 %demo script for hp-approach routine with error distance function
2 
3 params.coarse_factor =8;
4 model = advection_fv_output_model(params);
5 
6 model.RB_train_rand_seed = 1234;
7 model.RB_error_indicator = 'estimator';
8 model.get_rb_from_detailed_data = @(detailed_data)detailed_data.RB;
9 model.orthonormalize=@model_orthonormalize_qr;
10 %size of the training set:
11 model.RB_train_size = 15;
12 
13 %error distance:
14 hp_params.distance_function = @error_distance;
15 hp_params.error_distance_extionsion = 1;
16 
17 % parameters for hp-approach
18 hp_params.rho = 20;
19 hp_params.rho_POD = 1;
20 hp_params.error_tol1=0.8;
21 hp_params.error_tol2=0.01;
22 %do not use the boundary box method:
23 hp_params.trainingsset_generation_mode = 'mu_ranges';
24 
25 
26 %generate the hp-model and the model_data
27 hp_model=hp_gen_model(model,hp_params);
28 model_data = gen_model_data(hp_model);
29 
30 %set the first anchor
31 hp_model = set_mu(hp_model,[1;1]);
32 
33 %compute a h_refinment and RB generation
34 hp_model = h_refinement(hp_model,model_data);
35 hp_model = hp_rb_generation(hp_model);
36 
37 % %compute a reduced simulation for parameter [0.13;0.13]
38 hp_model = set_mu(hp_model,[0.13;0.13]);
39 sim_data = hp_simulation(hp_model);
40 
41 plot_sim_data(hp_model,model_data,sim_data,[]);
42 
43 
44 
45 
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