rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
ModelData.m
2 % Model data implementation for the ARE
3 %
4 % The model data stores all components for the data matrices A,B,C,E,R and
5 % Q. They are generated by the constructor, which simply gets the model
6 % class implementation. It then calls the functions model.A_comp(),
7 % model.B_comp, ... and so on in order to generate the matrices.
8 %
9 % @author Andreas Schmidt, 2016
10  properties
11  A_comp;
12  B_comp;
13  C_comp;
14  E_comp;
15  R_comp;
16  Q_comp;
17  n;
18  p;
19  m;
20  end
21 
22  methods
23  function obj = ModelData(m)
24  % Get the components
25  elements = {'A', 'B', 'C', 'E', 'R', 'Q'};
26  for i = 1:length(elements)
27  thisName = [elements{i}, '_comp'];
28 
29  if isa(m.(thisName), 'cell')
30  obj.(thisName) = m.(thisName);
31  else
32  ptr = m.(thisName);
33  obj.(thisName) = ptr(m);
34  end
35 
36  % If the problem size is not yet set, set it here:
37  if isempty(m.n) && strcmp(elements{i},'A')
38  m.n = size(obj.(thisName){1},1);
39  end
40  end
41 
42  obj.n = m.n;
43  obj.p = m.p;
44  obj.m = m.m;
45  end
46  end
47 end
Abstract OOP model implementation interface.
Model data implementation for the ARE.
Definition: ModelData.m:18
Implementation of the parametric algebraic Riccati equation.
Struct with high dimensional data needed for a high dimensional simulation.
Definition: dummyclasses.c:1