chemreac.m

来自「ode routines in matlab」· M 代码 · 共 31 行

M
31
字号
function [out] = ChemReac(x, y, flag)%%  Evaluate the right hand side function for the%  chemical reaction system%%    y_1'(x) = -k1*y_1(x) %    y_2'(x) =  k1*y_1(x) - k2*y_2(x)%    y_3'(x) =              k2*y_2(x)%%%global k1 k2switch( flag )   case '' % return right hand side      out  = [ -k1   0   0;                k1  -k2  0;                0    k2  0 ]* y;      case 'jacobian' % return Jaacobian of right hand side      out  = [ -k1   0   0;                k1  -k2  0;                0    k2  0 ];      otherwise      error(['Unknown request .'])end

⌨️ 快捷键说明

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