首页 > 解决方案 > 在MATLAB中求解矩阵Riccati方程?

问题描述

我正在解决这个矩阵Riccati差异方程Matlab

diff equat 系统

我对此有一些疑问

在此处输入图像描述

我在 Matlab 中解决这个 ODE 的代码

function pdot = rica( p )
B1=[0.8224 0.2226 0.4397; 0.3604 0.2226 0.4397; 0.3604 0.1 0.5];
A2=[ 0.3604 0.2226 0.4397;0.8224 0.2226 0.4397; 0.3604 0.1 0.5];
R1=0.1*eye(3,3);
R2=0.03*eye(3,3);
IR2=33.3333*eye(3,3);
gamma=150;
Q1=eye(3,3);
Q2=eye(3,3);
B2=102.0408*eye(3,3);%equation(20)
G2=102.0408*eye(3,3);
T2=(1/(2*gamma^2)*G2*(G2')-B2*IR2*B2')/10^5;
%T2=[3.4708 0 0;0 3.4708 0; 0 0 3.4708];
p1=[p(1) p(2) p(3); p(4) p(5) p(6); p(7) p(8) p(9)];
p2=[p(10) p(11) p(12); p(13) p(14) p(15); p(16) p(17) p(18)];
pdot1=p1*B1/R1*B1'*p1-Q1;
pdot1=pdot1(:);
pdot2=-A2.'*p2-p2*A2-p2*T2*p2-Q2;%equation(98)
pdot2=pdot2(:);
pdot=[pdot1;pdot2];
pdot=pdot(:);
end

执行此脚本并绘制结果:

[t,p]=ode45(@(t,p)rica(p),[0 50],[1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1])
%--------------------------------------
tt=0:50/(length(t)-1):50;
figure
subplot(3,3,1)
plot(tt,p(:,1))
subplot(3,3,2)
plot(tt,p(:,2))
subplot(3,3,3)
plot(tt,p(:,3))
subplot(3,3,4)
plot(tt,p(:,4))
subplot(3,3,5)
plot(tt,p(:,5))
subplot(3,3,6)
plot(tt,p(:,6))
subplot(3,3,7)
plot(tt,p(:,7))
subplot(3,3,8)
plot(tt,p(:,8))
subplot(3,3,9)
plot(tt,p(:,9))

figure
subplot(3,3,1)
plot(tt,p(:,10))
subplot(3,3,2)
plot(tt,p(:,11))
subplot(3,3,3)
plot(tt,p(:,12))
subplot(3,3,4)
plot(tt,p(:,13))
subplot(3,3,5)
plot(tt,p(:,14))
subplot(3,3,6)
plot(tt,p(:,15))
subplot(3,3,7)
plot(tt,p(:,16))
subplot(3,3,8)
plot(tt,p(:,17))
subplot(3,3,9)
plot(tt,p(:,18))

我认为可能是因为 ode45 采用相同的 tspan 或相同的选项来求解两个方程,或者非线性 ODE 系统从不包含两个矩阵 Riccati 方程?谁能给我一些解释?

结果为$T2$

p1

p2

现在 p1 和 p2 为$T2/10^5$

p1_1

p2_2

标签: matlabmatrixcontrolsmathematical-optimizationnonlinear-optimization

解决方案


推荐阅读