40 out=zeros(2,1);
41 out(1,1) = -x1+D*(1-x1)*exp(x2);
42 out(2,1) = -x2+B*D*(1-x1)*exp(x2)-beta*(x2-0);
43 end
The output file is:
0.86 0.88 0.9 0.92 0.94 0.96 0.98 1
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
(c) The Matlab script for this part is:
1function solution figure3
2x=0.95;
3y=2.5;
14 [xout1,yout1] = ivp RK4(0,z,1e5,1e-3,1e2);
15 plot(yout1(:,1),yout1(:,2))
16 saveas(h,‘cpc1c solution figure’,‘psc2’)
17 end
18