% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % EPage 103 % close all; clc; clear all; addpath('../../BookCode'); K_1 = 2; K_2 = 10; C = 0.001; D = 0.002; S_1 = 1.2; S_2 = S_1; y0 = [ 5000; 100 ]; fprime = @(t,x) ( [ K_1 * x(1) - C * x(1) * x(2) - S_1 * x(1) ; -K_2 * x(2) + D * x(1) * x(2) - S_2 * x(2) ] ); [t,x] = ode23( fprime, [0, 10], y0 ); plot( t, x, '-' ); grid('on'); xlabel('time'); ylabel('preditor/prey population values'); %saveas( gcf, '../../WriteUp/Graphics/Chapter5/c_5_p_7_plot.eps', 'epsc' );