1 function norm =
eop_fd_norm(fd_function1, fd_function2, grid, ~)
2 %norm =
eop_fd_norm(fd_function1, fd_function2, grid, ~)
4 %
function that computes the discrete L2-norm of the error ||fd_function1 -
5 % fd_function2|| in every timestep, i.e. a sequence. Choose one of the
6 % functions to be zero in order to recieve the norm of a single
function.
8 % fd_function1 and fd_function2 have to have the same size and they are
9 % assumed to be in matrix-form, i.e. one column represents the
function in
12 % grid is
for example model_data.grid
14 % Dominik Garmatter 10.04 2012
16 A = speye(grid.nvertices)*1/grid.nvertices; % mass matrix of the discrete L2-SP
17 C = fd_function1-fd_function2;
18 norm = zeros(1,size(C,2));
21 skalarproduct = C(:,i)'*A*C(:,i);
22 norm(1,i) = sqrt(skalarproduct);
function norm = eop_fd_norm(fd_function1, fd_function2,gridbase grid, unused1)
norm = eop_fd_norm(fd_function1, fd_function2, grid, ~)