psim_ode.m

来自「一个matlab的将军模型」· M 代码 · 共 40 行

M
40
字号
function R = psim_ode(sys_eq,X0,T,N)

% Compute flow pipe approximations for the `nonlinear` dynamics "dx/dt =
% f(x)".
%
% Syntax:
%   "R = psim_ode(sys_eq,X0,T,N)"
%
% Description:
%   The inputs are
%
%   * "sys_eq": string containing file name of the derivative function
%     for the ODE
%
%   * "ode_param": optional parameters for the ODE file
%
%   * "X0": a "linearcon" object representing initial set
%
%   * "T": time step for the flow pipe approximation
%
%   * "N": number of steps (flow pipe segments) to compute
%
%   The output "R" is a cell array of "linearcon" objects, each representing
%   an approximation to a flow pipe segments.
%
% See Also:
%   fs_nonlin_map,seg_approx_ode,stretch_func_ode

R = {};
SP0 = vertices(X0);
t0 = 0;
for k = 1:N
  fprintf(1,'%d/%d\n',k,N)
  [SEG,SPf] = seg_approx_ode(sys_eq,ode_param,X0,SP0,t0,t0+T);
  R{k} = SEG;
  SP0 = SPf;
  t0 = t0 + T;
end
return

⌨️ 快捷键说明

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