1 function model_data = lin_ds_from_lin_evol_gen_model_data(model)
2 %
function model_data = lin_ds_from_lin_evol_gen_model_data(model)
4 %
function computing components of matrices and inner product matrix
5 % of a lin_ds model from a given lin_evol model
7 % Bernard Haasdonk 7.9.2009
9 if model.affinely_decomposed
10 base_model = model.base_model;
11 model_data.base_model_data = gen_model_data(model.base_model);
12 base_model.decomp_mode = 1;
13 % x0 components are u0 components
14 model_data.x0_components = ...
15 base_model.init_values_algorithm(base_model, ...
16 model_data.base_model_data);
18 base_model.dt = base_model.T/base_model.nt;
19 [L_I_comp, L_E_comp, b_comp] = ...
20 base_model.operators_ptr(base_model, model_data.base_model_data);
21 % disp(
'inspect operators for component extraction!');
24 if (length(L_I_comp)~=1) || ~isequal(L_I_comp{1},speye(size(L_I_comp{1})))
25 error(
'Conversion only reasonable for L_I == Identity!');
28 % L_E = Delta t * A + Id
29 if ~isequal(L_E_comp{1},speye(size(L_E_comp{1})))
30 error(
'expected identity as first component of L_E')
32 model_data.A_components = L_E_comp(2:end);
34 model_data.B_components = b_comp;
36 if ~isfield(base_model,'compute_output_functional')
37 error('outputfunctional required in lin_evol!');
39 model_data.C_components = ...
40 base_model.operators_output(base_model,model_data.base_model_data);
41 for q=1:length(model_data.C_components)
42 model_data.C_components{q} = model_data.C_components{q}
';
47 % model_data.D_components = model.D_function_ptr(model);
50 model_data.G = base_model.mass_matrix([],model_data.base_model_data.grid,[]);