% Scripts for Population Bomb % Lecture 2 - Anthony J. Richardson % Example 1: Discrete Time Geometric Growth Equation % Try playing with different values of R % M2.1 n0=1;% n0=1 R=2; % R=1 t=0:1:10 nt=R.^t*n0 figure(1) hold on plot(t,nt) title('Geometric Population Growth') xlabel('Time in Dicrete Steps') ylabel('Population Size') %M2.2 % log plot more useful figure(2) semilogy(t,nt) % Example 2: Continuous Time % M2.3 n0=1 r=log(2); t=0:0.1:10 nt=n0*exp(r*t) figure(1) plot(t,nt,'r') legend('Discrete','Continuous') % M2.4 % log plot more useful figure(3) semilogy(t,nt)