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

📄 clso.m

📁 一个时滞系统的工具箱
💻 M
字号:
function [T, X]=clso(tfinal,x0,initfun,delay,A0,A1,B,M,N,tol)
%CLSO composes for linear time-invariant system 
%
%     x`(t)=A0*x(t)+A1*x(t-delay)+B*u
%
%     and optimal closed-loop control (see LQDELAY) 
%
%     u=C*x(t)+int(-delay,0,D(s)*x(t+s))ds 
%
%     the corresponding closed-loop system 
%
%     x`(t)=(A0+B*C)*x(t)+A1*x(t-delay)+B*int(-delay,0,D(s)*x(t+s))ds , 
%
%     and simulates the closed-loop system on the interval [0,tfinal]. 
%	INPUT:
%	   tfinal    - Final value of t.
%	   x0        - Initial value column-vector.
%	   delay     - Constant delay. 
%     initfun   - String variable with column-vector of initial function 
%		   			depending on variable s.
%     A0, A1, B - Matrices of constant coefficients.
%     M, N      - Weighting matrices of cost functional.
%	   tol       - The desired accuracy. (Default: tol = 1.e-4).
%
%	OUTPUT:
%	   T         - returned integration time points (column-vector).
%	   X         - returned solution, one solution column-vector per tout-value.
%
%	 Invoked without left-hand arguments CLSO produces the graph.

if nargin < 10, tol = 1.e-4; end
		
row=size(A0,1);
[C,D0,D1,D2]=lqdelay(A0,A1,B,delay,M,N);
A=A0+B*C;
BD0str = mat2str(B*D0);
D1str = mat2str(D1);
D2str = mat2str(D2);
F = [BD0str '*expm(' D1str '*s)*(' D2str ')'];
BS=zeros(row,1);
[tout,xout]=dde45l1(0,tfinal,x0,initfun,delay,A,A1,BS,delay,F,tol);

% Plot Graph
if nargout == 0
   plot(tout,xout);
   return;
end;

T = tout;
X = xout;

⌨️ 快捷键说明

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