📄 lineariz_vztah.m
字号:
function [sys,x0,str,ts] = lineariz_vztah(t,x,u,flag,n,vzorec)
% NelinSys - a program tool for analysis and synthesis of nonlinear control systems
% based on MATLAB/Simulink 5.2
%
% (C) 2002-2005, Martin Ondera (eskimo@pobox.sk) (Martin.Ondera@stuba.sk)
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%
% Please, see the LICENSE.TXT file to read the full license.
switch flag,
% =========================== Inicializacna cast s-funkcie ============================== %
case 0
% Definicia stavov, vstupov a vystupov systemu %
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 1;
sizes.NumInputs = n+1;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
% Inicializacia pociatocnych podmienok %
x0 = [];
% Inicializacia "str" ako prazdna matica %
str = [];
% Sample times in TS %
ts = [0 0];
% ========================== Vypocet podla linearizacnej rovnice ======================== %
case 3
sys = eval(sym(vzorec));
if ~isreal(sys)
error(['At the time instant t = ',num2str(t),'s, the linearizing control law is not defined! Cannot continue the simulation!']);
% sys = 0;
end
% ================================= Nepouzite priznaky ================================== %
case {1, 2, 4, 9}
sys = [];
% ================================= Spracovanie chyby =================================== %
otherwise
error(['Unknown flag = ',num2str(flag)]);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -