?? statesim.m
字號:
function [wdot] = statesim(t,w)
% Hadi Saadat, 1998
% Given the solution of the time-varying matrix Riccati equation found
% by the function riccasim, this function solves the state equation in
% conjunction with the optimal control equation.
global A B Q R t0 tf x0
[A,B,Q,R,t0,tf,x0]=system(A,B,Q,R,t0,tf,x0);
n=length(A); nsq=n*n;
s=reshape(w(1:n*n),n,n)';
r=inv(R);
sdot=[s*A+A'*s+Q-s*B*r*B'*s];
wdot=reshape(sdot',1,nsq);
x(1:n)=w(nsq+1:nsq+n);
u=-r*B'*s*x';
xdot=[A*x'+B*u];
wdot(nsq+1:nsq+n)=xdot(1:n);
wdot=wdot';
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -