Error in the function of the Riccati equation

1 view (last 30 days)
Hello person
I am having problems in the function of Riccati equation. In my case, I am performing a system identification process and at some point I have to use Ricatti's function to insert the matbal to continue the process. With this the following equation was adapted to the conditions of my problem.
Thus the previous equation was adapted to the conditions of my problem
Where the second term will have to be zero, in this case I suppose . Another issue to note is that I am calculating my svd from the array and choosing only a significant eigenvalue from my array S, so we only deal with single values rather than arrays in the function
[X,L,G] = dare(A,B,Q,R,S,E)
Here's the code I'm using
clc, close, clear
% Gerando séries
ts1 = timeseries(rand(3,50),'Name','MyTimeSeries');
y = ts1.Data;
[p,q] = size(y);
N = 50; % samples
% Create Hankel array
Yf=hankel(y(1,2:50));
% Create Toeplitz array
Yp=triu(toeplitz(y(1,1:49)));
Eaux = (Yf*Yp')/N; % Covariance matrix
E = Eaux(1:end-1,:);
E_des = Eaux(2:end,:);
[U,S,V] = svd(E);
V_T = V';
n_sing_values= input('Enter the number of unique values for the graph \n');
z = 1:1:n_sing_values;
bar(z,diag(S(1:n_sing_values,1:n_sing_values)))
set(gca,'XTick',1:n_sing_values)
sing_values =diag(S(1:n_sing_values,1:n_sing_values));
ordem = input('Enter the order you chose \n');
S = S(1:ordem,1:ordem);
U = U(:,1:ordem);
V_T = V_T(1:ordem,:);
O_calig = U*sqrtm(S);
C_calig = sqrtm(S)*V_T;
% Calculation of the model matrix
A = pinv(O_calig)*E_des*pinv(C_calig);
C = E(1,:)*pinv(C_calig);
M = pinv(O_calig)*E(:,1);
% delay covariance
Yh=Yf;
Yt = Yp;
Cov = (Yh*Yt')/N; % Covariance matrix
Cov_delay = Cov(1,1);
% Algebraic Equation of Ricatti
[X,L,G,rr] = dare(A',C',0,Cov_delay,-M',0);
% delta = Cov_delay - C*Sigma*C';
% Cov_e = C*P*C' + R_est;
% K = (M - A*Sigma*C')*inv(delta);
I'm getting the following error when plotting for example 10 eigenvalues and select 1 more meaningful.
Error using dare (line 60)
In the "dare(A,B,Q,R,S,E,...)" command, the E matrix must be nonsingular.
Error in teste (line 37)
[X,L,G,rr] = dare(A',C',0,Cov_delay,-M',0);
Thanks for any help, as I've been looking for a solution for days.

Answers (0)

Categories

Find more on Matrix Computations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!