python - ocw.nagoya-u.jp · python python matplotlib epd free matplotlib matplotlib matplotlib...
TRANSCRIPT
python
python
1 python
” 12 1212 276 ”
t N_t N_t+1
N_t+1=N_t+r*N_t*(1-N_t/K)
r
python
python
t Nt 1.0r 1.5K 100
T 30Nt
TNt Nt+r*Nt*(1.0-Nt/K)
Nt
python
IDLE
IDLE File New WindowRun
Run module
12345678
Nt=1.0r=1.5K=100T=30print("0"+"\t"+str(Nt))for i in range(T): Nt= Nt+r*Nt*(1.0-‐Nt/K) print(str(i+1)+"\t"+str(Nt))
?
python
python matplotlibEPD Free matplotlib
matplotlib
matplotlib
matplotlib pyplot plt.
1 import matplotlib.pyplot as plt<br> ?
x, ypython x
y dataX, dataYpython
2 printx 0 y Nt
0 Nt=1.0
for i 0 T-1
for
plt.plot dataX x dataY y
12
dataX=[]dataY=[]
12
dataX.append(0)dataY.append(Nt)
12
dataX.append(i+1)dataY.append(Nt)
1234
plt.plot(dataX, dataY)plt.xlabel("time")plt.ylabel("population size")plt.show()
?
?
?
?
r
(a) (b)(c)
r
python def python python C
return( )x y
python
K, r, T N_t N_0 x ydo_logistic_growth
return return(fdataX, fdataY) dataX,dataY= return
dataX datax dataY datay dataX, dataY plot
python
123456789
101112131415161718192021222324
import matplotlib.pyplot as plt def do_logistic_growth(k, r, n0, t): nt= n0 datax=[] datay=[] datax.append(0) datay.append(nt) for i in range(t): nt= nt+r*nt*(1.0-‐nt/k) datax.append(i+1) datay.append(nt) return(datax, datay) dataX, dataY= do_logistic_growth(100.0, 1.5, 1.0, 20)plt.plot(dataX, dataY) plt.xlabel("time")plt.ylabel("population size")plt.show()
?
(a) (b) (c) a: -> b: -> c: r 0<=r<=3 20
K=100, N_0 Nt =1.0r
show plot
1234567
dataX, dataY= do_logistic_growth(パラメータ設定1)plt.plot(dataX, dataY) dataX, dataY= do_logistic_growth(パラメータ設定2)plt.plot(dataX, dataY) ...
?
r r251 300 50 N_t
K=100, r 1.0 3.0 0.01
plt.plot "."
plt.plot(dataX, dataY, '.')
bifX bifYbifX: [1.0, 1.0, 1.0, ..., 1.0 (50 ), 1.01, 1.01, ..., 1.01 (50 ), ..., 3.0, ..., 3.0 (50 )]bifY: ["r=1.0 251 Nt", "r=1.0 252 Nt", ..., "r=1.0 300 Nt", "r=1.01 251 Nt", "r=1.01 252 Nt", ..., "r=1.01 300 Nt", ..., "r=3.0 251 Nt", "r=3.0 252 Nt", ..., "r=3.0 300 Nt"]
bifX bifY, rdataX[251:301] dataY[251:301] bifX, bifY
x a b x[a:b+1]x y x+y x=[x1, x2] y=[y1, y2] x+y [x1, x2, y1, y2]
a b x x= [b] * a x [b, b, ..., b] ba
21 t N1t 2
N2t 1 2 r K
1 2
12 d(0<=d<=1)
d
K=100 1
2 NA_t NB_t
r_A r_B A B d_A d_B A B X Q
X d
Q
”Yoshida T, Ellner SP, Jones LE, Bohannan BJM, Lenski RE, et al. (2007)Cryptic population dynamics: Rapid evolution masks trophic interactions. PLoS Biol 5(9): e235.”
B Ad_B<d_A r_B<r_A
P PNA NB NA+NB
” ”