rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
lin_stat_reduced_data_subset.m
Go to the documentation of this file.
1 function reduced_data_subset = lin_stat_reduced_data_subset(model,reduced_data)
2 %function reduced_data_subset = lin_evol_reduced_data_subset(model,reduced_data)
3 % method which modifies reduced_data, which is the data, that will
4 % be passed to the online-simulation algorithm.
5 %
6 % Typically, this routine only does a submatrix extraction of the 'Nmax' sized
7 % offline-objects to produce 'N' sized objects for the real simulation.
8 %
9 % Required fields of model:
10 % N : number of reduced basis vectors to choose
11 %
12 % Required fields of reduced_data:
13 % N : number of reduced basis vectors in the reduced_data,
14 % must be larger than model.N!!
15 
16 % Bernard Haasdonk 27.2.2011
17 
18 reduced_data_subset = reduced_data;
19 
20 if reduced_data.N ~= model.N
21  % extract correct N-sized submatrices and subvectors from reduced_data
22  if model.N > reduced_data.N
23  error('N too large for current size of reduced basis!');
24  end;
25  N = model.N;
26  if isfield(reduced_data, 'AN_comp')
27  dummy = zeros(reduced_data.N);
28  dummy(1:N,1:N)= 1;
29  ind = find(dummy);
30  reduced_data_subset.AN_comp = reduced_data.AN_comp(ind,:);
31  end
32  if isfield(reduced_data, 'fN_comp')
33  reduced_data_subset.fN_comp = reduced_data.fN_comp(1:N,:);
34  end
35  if isfield(reduced_data, 'lN_comp')
36  reduced_data_subset.lN_comp = reduced_data.lN_comp(1:N,:);
37  end
38 
39  Q_f = size(reduced_data_subset.fN_comp,2);
40  Q_a = size(reduced_data_subset.AN_comp,2);
41 
42  ind = reshape(1:reduced_data.N*Q_a,reduced_data.N,Q_a)';
43  ind = ind(:,1:N)';
44  ind = [(1:Q_f)'; ind(:) + Q_f];
45  reduced_data_subset.G = reduced_data.G(ind,ind);
46 
47  reduced_data_subset.N = N;
48 
49 end
50 
function reduced_data_subset = lin_stat_reduced_data_subset(model, reduced_data)
method which modifies reduced_data, which is the data, that will be passed to the online-simulation a...
function reduced_data_subset = lin_evol_reduced_data_subset(model, reduced_data)
method which modifies reduced_data, which is the data, that will be passed to the online-simulation a...