e894.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 30 行

M
30
字号
%-----------------------------------------------------------------------
% Example 8.9.4: Turbulent Flow and Chaos, Example 8.9.4 
%-----------------------------------------------------------------------

% Initialize

   clc
   clear
   n       = 3;             % system dimension 
   m       = 4000;          % solution points
   q       = 80000;         % maximum function evaluations
   t0      = 0;             % initial time 
   t1      = 30;            % final time 
   tol     = 0.5e-4;        % error bound 
   x0      = [1 0 20]';     % initial state 

% Solve system

   fprintf ('Example 8.9.4: Turbulent Flow and Chaos\n');
   [t,X,e,k] = rkf (x0,t0,t1,m,tol,q,'funf894');

% Display results

   show ('Number of scalar function evaluations',k);   
   show ('Maximum truncation error',e);
   graphxy (X(:,1),X(:,3),'Chaotic Motion',...
            'x_1','x_3')
%-----------------------------------------------------------------------

⌨️ 快捷键说明

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