⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 predprey.m

📁 ode routines in matlab
💻 M
字号:
function [out] = PredPrey(x, y, flag)%%  Evaluate the right hand side function for the%  Predator Prey model%%    y_1'(x) = alpha*y_1(x) - beta*y_1(x)*y_2(x)%    y_2'(x) = gamma*y_2(x)  + delta*y_1(x)*y_2(x)%%%alpha = 0.25;beta  = 0.01;gamma = -1.00;delta = 0.01;switch( flag )   case '' % return right hand side      out  = [ alpha*y(1)-beta*y(1)*y(2);               gamma*y(2)+delta*y(1)*y(2) ];      case 'jacobian' % return Jacobian of right hand side      out  = [ alpha-beta*y(2)    -beta*y(1);               delta*y(2)         gamma+delta*y(1)];      otherwise      error(['Unknown request.'])end

⌨️ 快捷键说明

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