rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
riccati_reduced_cost_functional.m
Go to the documentation of this file.
1 function [Jred, lrQ] = riccati_reduced_cost_functional(model, reduced_data, varargin)
2 %[Jred, lrQ] = riccati_reduced_cost_functional(model, reduced_data,
3 %varargin)
4 %
5 % Calculate the cost functional by solving the corresponding reduced
6 % Lyapunov equation
7 % This function returns
8 % Jred ..................... the value of the reduced cost functional
9 % lrQ ...................... the low rank factor of the solution to the
10 % corresponding Lyapunov equation
11 %
12 % Andreas Schmidt, 2015
13 %
14 if nargin == 2
15  rsim = rb_simulation(model, reduced_data);
16 else
17  rsim = varargin{1};
18 end
19 
20 % Assemble the matrices:
21 [E,A,B,C,x0] = riccati_assemble_system_matrices(model, reduced_data);
22 
23 P = rsim.PN;
24 Y = A - B*B'*P*E;
25 
26 lG = [C; B'*P*E];
27 lQ = lyap_sgn_fac(Y, lG, E);
28 
29 Jred = x0'*(E'*lQ')*lQ*(E*x0);
30 lrQ = lQ;
31 
32 end
function [ Jred , lrQ ] = riccati_reduced_cost_functional(model, reduced_data, varargin)
[Jred, lrQ] = riccati_reduced_cost_functional(model, reduced_data, varargin)
function [ E , A , B , C , x0 ] = riccati_assemble_system_matrices(model, model_data)
model_data)