My math question is here - https://math.stackexchange.com/questions/2063507/solving-this-integral-involving-ei-function
This relates Population dynamics with t = time, N_t = population at time t, r = rate of growth and K = cqrrying capacity.
My code is attached below.
Python is unable to calculate the value of N_next
because it's inside the exponential integral function scipy.special.expi()
. How can I circumvent this?
It's now saying "Scipy has no attribute special" but according to this - https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.special.expi.html - It should be.
import math
import scipy
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
t_f =100
N_0 = 10
t = []
N_t = [N_0,]
r = 2.5
K = 1000
for i in range(0,100):
scipy.special.expi(r*N_next/K) = i*math.exp(r) + scipy.special.expi(r/K * N_t[i])
N_t.append(N_next)
t.append(i)
plt.plot(t,N_t)
plt.show