rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
DefaultModel.m
1 classdef DefaultModel < DARE.Model
2 % DEFAULTMODEL
3 %
4 % This class represents a simple model which can be used for prototyping
5 % DARE equations.
6 % You can set up a new model by passing a descr structure, which should
7 % contain information about all the data matrices.
8 %
9 % Andreas Schmidt, 2016
10 
11  properties
12  descr;
13 
14  mu = [];
15  mu_names = {};
16  mu_ranges = {};
17  end
18 
19  methods
20  function this = DefaultModel(descr)
21  this.descr = descr;
22 
23  if ~isfield(descr, 'p'), descr.p = size(descr.C_comp{1},1); end
24  if ~isfield(descr, 'm'), descr.m = size(descr.B_comp{1},2); end
25 
26  this.p = descr.p;
27  this.m = descr.m;
28  this.n = descr.n;
29  this.mu = descr.mu;
30 
31  if ~isfield(descr,'mu_ranges') || ~isfield(descr,'mu_names')
32  error('Please provide valid values for mu_ranges and mu_names');
33  end
34 
35  this.mu_names = descr.mu_names;
36  this.mu_ranges = descr.mu_ranges;
37  end
38 
39  % =================================================================
40  % Data functions
41  function A = A_coeff(this)
42  A = this.descr.A_coeff(this);
43  end
44  function A = A_comp(this, md)
45  A = this.descr.A_comp;
46  end
47  function B = B_coeff(this)
48  B = this.descr.B_coeff(this);
49  end
50  function B = B_comp(this, md)
51  B = this.descr.B_comp;
52  end
53  function C = C_coeff(this)
54  C = this.descr.C_coeff(this);
55  end
56  function C = C_comp(this, md)
57  C = this.descr.C_comp;
58  end
59 
60  function E = E_coeff(this)
61  if isfield(this.descr, 'E_coeff')
62  E = this.descr.E_coeff(this);
63  else
64  E = E_coeff@ARE.Model(this);
65  end
66  end
67  function E = E_comp(this,md)
68  if isfield(this.descr, 'E_comp')
69  E = this.descr.E_comp;
70  else
71  E = E_comp@ARE.Model(this);
72  end
73  end
74 
75  function Q = Q_coeff(this)
76  if isfield(this.descr, 'Q_coeff')
77  Q = this.descr.Q_coeff(this);
78  else
79  Q = Q_coeff@ARE.Model(this);
80  end
81  end
82  function Q = Q_comp(this,md)
83  if isfield(this.descr, 'Q_comp')
84  Q = this.descr.Q_comp;
85  else
86  Q = Q_comp@ARE.Model(this);
87  end
88  end
89 
90  function R = R_coeff(this)
91  if isfield(this.descr, 'R_coeff')
92  R = this.descr.R_coeff(this);
93  else
94  R = R_coeff@ARE.Model(this);
95  end
96  end
97  function R = R_comp(this,md)
98  if isfield(this.descr, 'R_comp')
99  R = this.descr.R_comp;
100  else
101  R = R_comp@ARE.Model(this);
102  end
103  end
104 
105 
106  end
107 end
m
The number of control inputs and measurements.
Definition: Model.m:59
MODEL Main class for the DARE model.
Definition: Model.m:18
DEFAULTMODEL.
Definition: DefaultModel.m:18
Implementation of the parametric algebraic Riccati equation.
Implementation of the parametric discrete-time algebraic Riccati equation.
Definition: Kernel.m:1