Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Created May 15, 2014 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimitoboku/909e2a82f4b8628ba643 to your computer and use it in GitHub Desktop.
Save kimitoboku/909e2a82f4b8628ba643 to your computer and use it in GitHub Desktop.
ロジスティクスうんたらかんたら
import scipy.integrate
import numpy as np
import matplotlib.pyplot as plt
x01 = [0.2]
x10 = [0.2]
x20 = [0.2]
x25 = [0.2]
x30 = [0.2]
time = []
k = 1.2
r = 1
time = range(30)
for i in range(29):
x01.append(x01[i] + 0.1 * x01[i] * (1 - x01[i] / k))
for i in range(29):
x10.append(x10[i] + 1.0 * x10[i] * (1 - x10[i] / k))
for i in range(29):
x20.append(x20[i] + 2.0 * x20[i] * (1 - x20[i] / k))
for i in range(29):
x25.append(x25[i] + 2.5 * x25[i] * (1 - x25[i] / k))
for i in range(29):
x30.append(x30[i] + 3.0 * x30[i] * (1 - x30[i] / k))
plt.plot(time,x01,"-b")
plt.plot(time,x10,"-y")
plt.plot(time,x20,"-r")
plt.plot(time,x25,"-k")
plt.plot(time,x30,"-g")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment