3 % Main
class for the
DARE model
6 RB_closed_loop_norm =
'fro';
7 RB_closed_loop_stable =
false;
12 function pt = problem_type(
this)
16 function g = gamma(this, model_data, dsim)
17 calculator = DARE.GammaCalculation.Lyapunov();
18 g = calculator.calculate(this, model_data, dsim);
21 function [n] = closed_loop_norm(this, model_data, dsim)
22 % CLOSED_LOOP_NORM Implementation of an efficient algorithm for
23 % the approximation of the 2-norm of the closed-loop matrix.
24 [E,A,B,~,~,R] = this.assemble(model_data);
27 Rxinv = inv(R + (B'*dsim.Z)*(dsim.Z'*B));
28 M2 = Rxinv*(B'*dsim.Z)*(dsim.Z'*A);
29 M3 = (A'*dsim.Z)*(dsim.Z'*B)*Rxinv;
31 n = sqrt(eigs( @(x) A'*(A*x) - M1*(M2*x) - M2'*(M1'*x) + ...
32 M3*(BtB*(M3'*x)), this.n, 1));
35 function [stable,cleig] = closed_loop_stable(this,model_data,dsim)
36 % CLOSED_LOOP_STABLE Implementation of an efficient algorithm
37 % for checking whether the closed loop matrix gives a stable
38 % system. This is done by calculting the maximum eigenvalue of
39 % the closed loop system.
40 [E,A,B,~,~,R] = this.assemble(model_data);
41 Rxinv = inv(R + (B'*dsim.Z)*(dsim.Z'*B));
42 K = Rxinv*(B'*dsim.Z)*(dsim.Z'*A);
44 cleig = eigs( @(x) EU\(EL\(A*x - B*(K*x))), this.n, 1 );
45 stable = abs(cleig) < 1;
MODEL Class that defines the assemble method which is used by both, the DetailedModel and the Reduced...
Implementation of the parametric algebraic Riccati equation.
Implementation of the parametric discrete-time algebraic Riccati equation.