rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
riccati_model_default.m
Go to the documentation of this file.
1 function model = riccati_model_default()
2 %function model = riccati_model_default
3 % This model is the general model for the riccati type
4 % models for the linear dynamic system:
5 %
6 % E(mu) d/dt x = A(mu)x + B(mu)u
7 % y = C(mu)x
8 %
9 % The corresponding ARE then reads as follows:
10 % A'PE + E'PA - E'PBB'PE + C'C = 0
11 %
12 % This function sets the following fields in the model
13 % mu_names
14 % mu_ranges
15 % set_mu
16 % get_mu
17 % decomp_mode
18 %
19 % Andreas Schmidt, 2015
20 
21 model = {};
22 
23 % Set the default fields for the model:
24 model.mu_names = {};
25 model.mu_ranges = {};
26 model.set_mu = @set_mu_default;
27 model.get_mu = @get_mu_default;
28 
29 % The decomp_mode flag is used as usual. All data functions should take
30 % care of it.
31 model.decomp_mode = 0;
32 
33 model.gen_model_data = @riccati_gen_model_data;
34 model.detailed_simulation = @riccati_detailed_simulation;
35 
36 model.plot_detailed_data = @riccati_plot_solution;
37 
38 model.gen_detailed_data = @riccati_gen_detailed_data;
39 model.gen_reduced_data = @riccati_gen_reduced_data;
40 model.reduced_data_subset = @riccati_reduced_data_subset;
41 model.rb_simulation = @riccati_rb_simulation;
42 model.rb_reconstruction = @riccati_rb_reconstruction;
43 
44 model.simulate = @riccati_simulate;
45 model.plot_sim_data = @riccati_plot_sim_data;
46 model.plot_handle = @(model,model_data,sim) error('Fill plot_handle with contents');
47 model.plot_controlled = 1;
48 
49 % Define the matrices:
50 model.A = @(model,model_data) error('set the A(model,model_data) function');
51 model.B = @(model,model_data) error('set the B(model,model_data) function');
52 model.C = @(model,model_data) error('set the C(model,model_data) function');
53 model.E = @dummy_E;
54 model.x0 = @dummy_x0;
55 
56 % Default settings for the basis building process:
57 model.RB_enable_estimator = 0;
58 model.RB_generation_mode = 'greedy_uniform_fixed';
59 model.RB_extension_mode = 'addmultiple';
60 model.RB_extension_max_per_step = 40;
61 model.RB_samplepoints = 300;
62 model.RB_gamma_mode = 'interpol';
63 model.RB_numintervals = 10;
64 model.RB_o_tol = 1e-6;
65 model.RB_i_tol = 1e-4;
66 
67 %% Auxilliary functions:
68 % Set dummy values for the E matrix, i.e. it is sparse identity by default
69 function r = dummy_E(model, model_data)
70 E = @(model,model_data){speye(model.n)};
71 r = eval_affine_decomp(E, @(model) 1, model, model_data);
72 
73 % The default x0 is a normalized constant vector
74 function r = dummy_x0(model, model_data)
75 g = [];
76 if model.decomp_mode < 2
77  g = ones(model.n, 1);
78  g = g/norm(g);
79 end
80 r = eval_affine_decomp(@(m,md) {g}, @(model) 1, model, model_data);
function model = riccati_model_default()
This model is the general model for the riccati type models for the linear dynamic system: ...
function sim = riccati_rb_reconstruction(model, detailed_data, rb_sim_data)
Perform a reconstruction of the full dimensional solution.
function reduced_data = riccati_gen_reduced_data(model, detailed_data)
reduced_data = riccati_gen_reduced(model, detailed_data)
function model_data = riccati_gen_model_data(model)
RICCATI_GEN_MODEL_DATA.
function sim_data = riccati_rb_simulation(model, reduced_data)
sim_data = riccati_rb_simulation(model, reduced_data) This function performs a reduced basis simulati...
Implementation of the parametric algebraic Riccati equation.
function sim_data = riccati_detailed_simulation(model, model_data)
sim_data = riccati_detailed_simulation(model, model_data)