📄 chap1_casestudy.m
字号:
% Chapter 1, Case Study
% This script file generates the data for Table 5.2 and plots the graphs in
% Figures 5.1, 5.4 and 5.5
% Script file Chap1_CaseStudy1.m
clear
clc
close all
Pop=[3 3.2276 4.5759 6.9570 8.7618 9.1536 11.2669 14.5153 16.5059 17.9563 19.5078];
Pm=25;
P0=3;
c=0.00125;
dt=1;
P(1)=P0;
x(1)=100;
for n=1:130
P(n+1)=(1+c*dt*(Pm-P(n)))*P(n);
end % n
P(50);P(51);P(52); % PA(49), PA(50), PA(51)
PP=P(1:10:131);
tt=0:10:100;
ttt=0:10:130;
plot(tt,Pop,'.r','MarkerSize',12)
hold on
plot(ttt,PP,'sk','MarkerSize',4,'MarkerFaceColor','k')
t=linspace(0,130,200);
num=Pm*P0;
den=P0+(Pm-P0)*exp(-c*Pm.*t);
P_anal=num./den;
plot(t,P_anal,'k')
xlabel('\itt \rm(Year Number)','FontSize',11)
ylabel('Population (millions)','FontSize',11)
text(80,10,'\itP_{\rmobs}\rm(\itt\rm)','FontSize',11)
plot(75,10,'r.','MarkerSize',12)
text(80,7.5,'\itP_{\rmA}\rm(\itn\rm), \itn \rm= 0,10,20,...130','FontSize',11)
plot(75,7.5,'sk','MarkerFaceColor','k','MarkerSize',4)
text(80,5.3,'\itP\rm(\itt\rm)','FontSize',11)
plot([73 77],[5.3 5.3],'k')
text(80,2,'\Delta\itt \rm= 1 year','FontSize',11)
title('Population vs. Time','FontSize',11)
T=0:10:130;
den=P0+(Pm-P0)*exp(-c*Pm.*T);
PP_anal=num./den;
figure(2)
Pi=linspace(0,50,200);
gPi=c*(Pm-Pi);
plot(Pi,gPi,[0 50],[0 0],'k',[25 25],[-0.04 0],'k:')
xlabel(' P (millions)','FontSize',11)
ylabel ('\itg\rm(\itP\rm) millions of individuals per year per individual','FontSize',11)
title('Population Growth Rate vs Population','FontSize',11)
hold on
Pmin=3;
Pmax=P(131);
gPmin=c*(Pm-Pmin);
gPmax=c*(Pm-Pmax);
plot([Pmin Pmax],[gPmin gPmax],'LineWidth',1.5)
gP0=c*(Pm-P0);
plot(P0,gP0,'.r','MarkerSize',15)
gP130=c*(Pm-P(130));
plot(P(130),gP130,'.r','MarkerSize',15)
text(4,0.03,'\itg\rm[\itP\rm(0)]','FontSize',11)
text(23,0.0055,'\itg\rm[\itP\rm(130)]','FontSize',11)
text(13.5,-0.035,'\itP_m = \rm25 million','FontSize',11)
figure(3)
clear t P_anal
hold on
tf=180;
t=linspace(0,tf,1000);
for i=0:10
P0=5*i;
num=Pm*P0;
den=P0+(Pm-P0)*exp(-c*Pm.*t);
P_anal=num./den;
plot(t,P_anal)
axis([0 tf -1 2*Pm+1])
end
xlabel('\itt \rm(Year Number)','FontSize',11)
ylabel('Population (millions)','FontSize',11)
title('Logistic Growth for Different Initial Populations','FontSize',11)
text(50,37,'Carrying Capacity: \itP_{\rmm} \rm= 25 million','FontSize',11)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -