% This is the main function to solve % the LotkaVolterra model in p.224, Mathematical Models in Biology % example of figure 6.8(a) in p.228 global a b c d a = 1; b = 0.5; c = 0.75; d = 0.25; options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4]); t0 = 0; tfinal = 10; N1_ini = [1 2 3 4 5 6]; N2_ini = [2 2 2 2 2 2]; for ind = 1:6 y_ini = [N1_ini(ind) N2_ini(ind)]; [T,y] = ode45(@test1_eqn,[t0 tfinal],y_ini,options); % plot N2 versus N1 figure(1);hold on; plot(y(:,1),y(:,2)); xlabel('x_1') ylabel('x_2') axis equal; box on end