
正文
Matlab illustrate stiffness
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
% matlab script to illustrate stiffness
% using simple flame propagation modelclose all
clear all% define the right-hand side of the ODE
F = inline('y^2 - y^3','t','y');delta = 0.01; % not stiff
tic
ode23(F,[0 2/delta],delta);
toc
disp('Press any key to continue.')
pause% try again, this time with stiffness ...
delta = 0.0001;
tic
ode23(F,[0 2/delta],delta);
toc
disp('Press any key to continue.')
pause% now use a stiff solver to solve the problem
tic
ode23s(F,[0 2/delta],delta);
toc







