e592.m
来自「matlab算法集 matlab算法集」· M 代码 · 共 27 行
M
27 行
%------------------------------------------------------------------------
% Example 5.9.2: Bacterial Chemostat
%------------------------------------------------------------------------
% Initialize
clc % clear screen
clear % clear variables
m = 50; % maximum iterations
tol = 1.e-6; % error tolerance
x0 = [1 0.1]'; % initial guess
g = inline ('norm(funf592([a;b]),2)^2','a','b'); % error surface
% Compute and display steady-state solution
fprintf ('Example 5.9.2: Bacterial Chemostat\n');
[x,i] = newton (x0,tol,m,'funf592');
show ('Number of iterations',i)
show ('Steady-state solution',x)
% Plot error surface e(x) = ||f(x)|| */
plotfun (0,3,-1,1.5,'Error Surface','x_1','x_2','g(x)',g)
%------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?