matlab - 在MATLAB中求解矩阵Riccati方程?
问题描述
我正在解决这个矩阵Riccati
差异方程Matlab
:
我对此有一些疑问
我在 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 为$T2/10^5$
解决方案
推荐阅读
- windows - 光标不在窗口上时VS Code GUI失真
- git - 如何撤消对特定文件的已提交更改而不进行变基?
- java - 如何使用电报机器人发送本地文件?
- reactjs - InvalidSignatureException 如果来自反应的请求
- python - 乘法(例如 tf.math.multiply())和乘法层(例如 tf.keras.layers.multiply())有什么区别?
- google-apps-script - 应用脚本转储可变行数
- javascript - 元素在它应该消失之前消失
- html - HTML 下拉菜单 - 默认值
- javascript - 如何将 JSON 数据提取到谷歌表格中
- linkerd - 具有未知响应的链接器响应类