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

📄 bilin.m

📁 剑桥大学用于线性和双线性动力学系统辨识的工具箱
💻 M
字号:
function model = bilin(A,B,C,D,N,X0,Ts)%BILIN   Create a discrete-time, bilinear state-space model.%%   M = bilin(A,B,C,D,N) %   M = bilin(A,B,C,D,N,X0) %   M = bilin(A,B,C,D,N,X0,Ts)%  %   The output M is an object describing the discrete-time, bilinear%   state-space model%%      x(t+Ts) = A x(t) + N kron(u(t),x(t)) + B u(t);   x(0) = X0%         y(t) = C x(t) + D u(t),%%   where A is n-by-n, B is n-by-m, C is p-by-n, D is p-by-m and N is%   n-by-(m*n). N := [N1 N2 ... Nm], where each Ni is n-by-n.%%   X0 is the initial state (default is X0 = 0) and Ts is the sample time%   in seconds (default is Ts = 1).%%   See also BILINID, BILIN/SIM, BILIN/COMPARE, BILIN/ISSTABLE, BILIN/SIM,%            BILIN/PE, KRON.%% CUED System Identification Toolbox.% Cambridge University Engineering Department.% Copyright (C) 1998-2002. All Rights Reserved.% Version 1.00, Date: 01/06/2002% Created by H. Chen and E.C. Kerrigan.if nargin == 0  model.A = [];  model.B = [];  model.C = [];  model.D = [];  model.N = [];  model.X0 = [];  model.Ts = 1;  model = class(model,'bilin');elseif nargin == 1  % Should actually go into a converter method  SYS = A;  if isa(SYS,'ss') | isa(SYS,'idss')		[n,m] = size(SYS.B);		model.A = SYS.A;	model.B = SYS.B;	model.C = SYS.C;	model.D = SYS.D;	model.N = zeros(n,n*m);	if isa(SYS,'idss')	  model.X0 = SYS.X0;	else	  model.X0 = zeros(n,1);	end		if SYS.Ts > 0	  model.Ts = SYS.Ts;	else	  error('SYS has to be a discrete-time model.')	end	model = class(model,'bilin');	  elseif isa(SYS,'bilin')	model = SYS;  else	error('SYS has to be an SS, IDSS or BILIN object.')  end  else      if nargin < 5	error('Please specify A,B,C,D and N.')  end    if nargin > 7	error('Too many input arguments.')  end    if isempty(A) | isempty(B) |  isempty(C) |  isempty(D) |  isempty(N)	error('Please specify A,B,C,D and N explicitly.')  end  [rA,cA] = size(A);  [n,m] = size(B);  [l,cC] = size(C);  [rD,cD] = size(D);  [rN,cN] = size(N);    if ~(rA == n & cA == n & cC == n & l == rD & m == cD & rN == n & cN == m*n)	error('The dimensions of A,B,C,D and N are incompatible.')  end    model.A = A;  model.B = B;  model.C = C;  model.D = D;  model.N = N;    if nargin >= 6	if isempty(X0)	  model.X0 = zeros(n,1);	else	  if size(X0,1) == n & size(X0,2) == 1		model.X0 = X0;	  else		error('X0 must be an n-dimensional column vector.')	  end	end  else	model.X0 = zeros(n,1);  end    if nargin >= 7	if isempty(Ts)	  model.Ts = 1;	else	  if Ts > 0		model.Ts = Ts;	  else		error('Sample time Ts has to be greater than 0.')	  end	end  else	model.Ts = 1;  end    model = class(model,'bilin');end% *** last line of bilin.m ***

⌨️ 快捷键说明

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