📄 e891.m
字号:
%-----------------------------------------------------------------------
% Example 8.9.1: Chemical Reactor
%-----------------------------------------------------------------------
% Initialize
clc % clear screen
clear % clear variables
n = 3; % dimension of system
m = 100; % number of solution points
q = 5000; % maximum function evaluations
alpha = 0; % initial time
beta = 1.2; % final time
tol = 1.e-6; % error bound
x0 = [5 3 0]'; % initial state
% Solve equations
fprintf ('Example 8.9.1: Chemical Reactor\n');
[t,X,e,k] = rkf (x0,alpha,beta,m,tol,q,'funf891');
% Display results
show ('Number of scalar function evaluations',k);
show ('Maximum truncation error',e);
show ('Final product concentration (moles/m^3)',X(m,n));
graphxy (t,X,'Concentrations','t (min)','x(t) (moles/m^3)')
%-----------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -