1 function test_err = rb_test_projection_error(model,detailed_data,reduced_data,M_test,...
3 %
function test_err = rb_test_projection_error(model,detailed_data,reduced_data,M_test,...
6 %
function determining the test-projection-errors, i.e. L2([0,T],X)
7 % error
for the given set of vectors `\mu`
8 % (columns in
'M_test') of the full simulation projected on the
12 % M_test: matrix with column vectors of parameter tuples `\mu`
for which the
13 % error between reduced and detailed simulation shall be computed.
14 % savepath: directory path where the detailed simulations shall be saved to
17 % optional fields of model:
20 % test_err: vector of errors
22 % Bernard Haasdonk 7.9.2011
24 %
import model specific methods
26 nmus = size(M_test,2);
27 test_err = zeros(nmus,1);
30 error('savepath must be provided in case of error as target value!');
33 W = model.get_inner_product_matrix(detailed_data);
34 RB = model.get_rb_from_detailed_data(detailed_data);
40 tmodel = tmodel.set_mu(tmodel, M_test(:,i));
41 % rb_sim_data = rb_simulation(tmodel,reduced_data);
45 X = tmodel.get_dofs_from_sim_data(sim_data);
46 Xproj_err = X- RB * ((RB' * W) * X);
47 err = sum(sum((W * Xproj_err).*Xproj_err));
50 % disp('warning, check monotonicity in errs!!!');
52 % if (i==2) & (mod(size(detailed_data.RB,2),30) == 0)
53 % save(['errs',num2str(size(detailed_data.RB,2))],'errs');
function [ sim_data , tictoc ] = load_detailed_simulation(m, savepath, params)
load single trajectory of previously saved results.
function save_detailed_simulations(model, model_data, M, savepath)
perform loop over detailed simulations and save results or check consistency with existing saved resu...