📄 gear.m
字号:
%GEAR Integrate a system of ODEs using the Gear method.
%
% GEAR('SYSTEM',TF) integrates the system of ODEs described in
% the SIMULINK system (or other S-function) SYSTEM from 0 to TF
% 'time' units (typically but not necessarily seconds).
% Without left hand arguments results are displayed in graphical form.
% If SYSTEM has output ports, then GEAR plots the output
% trajectories versus time (otherwise state trajectories are plotted).
%
% When used with left hand arguments, [T,X,Y]=GEAR('SYSTEM',TF), GEAR
% returns, without plotting, the integration time points, T, the output
% trajectories, Y, and the state trajectories, X.
%
% [T,X,Y]=GEAR('SYSTEM',TF,XI) allows initial conditions (other that
% those defined in SYSTEM), XI on the states to be defined.
%
% GEAR('SYSTEM',TF,XI,OPTIONS) allows a vector of optional parameters,
% OPTIONS, defined below:
%
% OPTIONS(1) relative error used in GEAR (default 1e-3).
% OPTIONS(2) minimum step size used (default TF/2000).
% OPTIONS(3) maximum step size used (default TF/50).
% OPTIONS(4) not used in GEAR (default 0).
% OPTIONS(5) display warnings parameter (when min step size is reached)
% (0 is no warnings, 3 is all) (default 0).
% OPTIONS(6) plot parameter (1 is plot-on, 2 plot-off) (default 0).
% the default is to set plot-on when no left arguments are supplied,
% otherwise set plot-off.
%
% For more information enter TYPE GEAR.M.
%
% See also RK23, RK45, ADAMS, EULER, LINSIM, SFUNC, DSFUNC, TRIM, LINMOD
% GEAR('SYSTEM',10) integrates SYSTEM over the time interval
% from 0 to 10 seconds. [T,X,Y]=GEAR('SYSTEM',[3 10]) integrates
% SYSTEM over the time interval from 3 to 10 seconds.
%
% [T,X,Y]=GEAR('SYSTEM',TF,XI,OPTIONS,UT) allows inputs, u(t), to be defined.
% If UT is a string then at each iteration the function u=UT(t) is evaluated.
% UT may also be in tabular form in which case the first m column define
% the inputs given by the vector of times, T, which should be provided
% in the last column of UT. Values of time not specified in UT are
% interpolated or extrapolated by GEAR.
%
% Any or all of XI, OPTIONS, or UT may be empty matrices in which case
% these parameters will be assumed to be undefined and the default option
% will be used.
% For example, GEAR('SYSTEM',10,[],[],'sin') integrates SYSTEM over the time
% interval from 0 seconds to 10 seconds with default error settings and a sine
% wave input.
%
% [T,X,Y]=GEAR('SYSTEM',T,XI,OPTIONS,UT,P1,P2,...) allows parameters,
% P1,P2,..., to be passed directly to SYSTEM at each call from GEAR, as in
% SYS=SYSTEM(T,X,U,FLAG,P1,P2,...).
%
% The function 'SYSTEM' should return state derivatives and an optional
% set of outputs given input and state information: SYS=SYSTEM(T,X,U,FLAG).
% Calling SYSTEM without arguments should return the vector SIZES
% containing the number of inputs, outputs and states. See the example SFUNC.
% Copyright (c) 1990-94 by The MathWorks, Inc.
% Built-in function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -