rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
hp_demo.m
Go to the documentation of this file.
1 %demo script for hp-approach routine
2 clear;
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 = 20;
12 
13 
14 
15 % parameters for hp-approach
16 hp_params.rho = 10;
17 hp_params.rho_POD = 1;
18 hp_params.error_tol1=0.8;
19 hp_params.error_tol2=0.01;
20 %generate the hp-model and the model_data
21 hp_model=hp_gen_model(model,hp_params);
22 model_data = gen_model_data(hp_model);
23 
24 %set the first anchor
25 hp_model = set_mu(hp_model,[1;1]);
26 
27 %compute a h_refinment and RB generation
28 hp_model = h_refinement(hp_model,model_data);
29 hp_model = hp_rb_generation(hp_model);
30 
31 %compute a reduced simulation for parameter [0.13;0.13]
32 hp_model = set_mu(hp_model,[0.13;0.13]);
33 sim_data = hp_simulation(hp_model);
34 
35 plot_sim_data(hp_model,model_data,sim_data,[]);
36 
37 
38 
39