⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lqdelay.m

📁 一个时滞系统的工具箱
💻 M
字号:
function [C,D0,D1,D2]=lqdelay(A0,A1,B,delay,M,N)
%LQDELAY calculates coefficients of the explicit solution 
%  of the linear quadratic regulator problem for systems with delays. 
%
%  For the system x'= A0*x + A1*y(-delay) + B*u , this function calculates  
%  optimal control gain as follows.
%  
%  u=-inv(N)B'Px+integral(-delay,0,D0*exp(D1)*D2*y(s))ds
%   
%   INPUT : 
%     A0,A1,B - System coefficient
%  	delay   - State delay
%  	M       - Positive nxn matrix (n is the system order)
%  	N       - Input weighting matrix
%
%   OUTPUT : 
%  	C=-inv(N)B'P;
%  	D0=-inv(N)B';
%  	D1=-(P*K-A0');
%  	D2=exp(D1*delay)*P*A1;

misdefinite=isdef(M);
nisdefinite=isdef(N);
if((length(misdefinite)==17)&(length(nisdefinite)==17))
   if((sum(misdefinite=='positive definite')==17)&(sum(nisdefinite=='positive definite')==17))	
      [gain P eigenvalue]=lqr(A0,B,M,N);
      K=B*inv(N)*(B');
      C=-inv(N)*B'*P;
      D0=-inv(N)*B';
      D1=-(P*K-A0');
      D2=expm(D1*delay)*P*A1;
   else
      disp('You must input positive matrix M or N'); 
   end 
else
   disp('You must input positive matrix M or N'); 
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -