rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
test_compare_old_new_detailed_sim.m
Go to the documentation of this file.
1 %script compares old and new detailed simulations
2 
3 params = [];
4 params.coarse_factor = 16;
5 model = advection_fv_output_opt_model(params);
6 
7 model_old = advection_fv_output_opt_model_old(params);
8 
9 model_data = gen_model_data(model);
10 
11 
12 M=[0,0,0;0,0,1;0,1,0;1,0,0;0,1,1;1,0,1;1,1,1;1,1,0];
13 
14 
15 for i=1:size(M,1)
16 
17 model = set_mu(model,M(i,:));
18 model_old = set_mu(model_old,M(i,:));
19 
20 sim_data_new = detailed_simulation(model, model_data);
21 
22 sim_data_old = detailed_simulation(model_old, model_data);
23 
24 
25 
26 difference = sim_data_new.U - sim_data_old.U;
27 
28 
29 nt = size(sim_data_new.U,2);
30 real_error = zeros(1,nt);
31 for n=1:nt
32  real_error(n) = sqrt(difference(:,n)'*A*difference(:,n));
33 end
34 max(real_error)
35 end