2 %
this is a script showing the
ei_detailed construction
for a
function which
3 % empirically interpolated turns out to have the worst possible Lebesgue
4 % constant `\Lambda = \max_{x} \sum_{m=1}^M |\xi_m(x)| = 2^M - 1`
9 model.gridtype =
'rectgrid';
10 model.xrange = [ 0, 1];
11 model.yrange = [ 0, 1];
12 model.xnumintervals = 100;
13 model.ynumintervals = 1;
16 model_data.grid = construct_grid(model);
17 model_data.W = fv_inner_product_matrix(model, model_data);
21 U = zeros(model_data.grid.nelements, maxfuncs);
23 U(1,:) = 1-100000*eps;
27 U(3+2*i:2:100,i) = -1;
31 params.ei_stop_on_Mmax = 3;
32 params.ei_target_error =
'linfty-interpol';
33 params.compute_lebesgue =
true;
36 save(fullfile(rbmatlabtemp,
'LUtmp'),
'LU');
38 LU_fnames = {
'LUtmp'};
40 model.get_inner_product_matrix = @(model_data) model_data.W;
41 model.nt = maxfuncs-1;
43 detailed_data =
ei_detailed(model, model_data, LU_fnames, params);
45 OK = (detailed_data.ei_info{1}.lebesgue == detailed_data.ei_info{1}.max_lebesgue);