Answer the question
In order to leave comments, you need to log in
Is it possible to vary constants in integration?
I have a small program that integrates an equation:
Is it possible to set a condition so that when a certain value is exceeded, the constants in the equation change?
from scipy.integrate import odeint
from numpy import linspace
from matplotlib import pyplot
def epid(y, t):
k = 0.00003
if y >= 100:
L = 5
L = 250000
return k*y*(L-y)
t = linspace(0, 12, 61)
y = odeint(epid, 250, t)
pyplot.plot(t, y)
pyplot.show()
Answer the question
In order to leave comments, you need to log in
Is it possible to set such a condition that when a certain value is exceeded, the constants in the equation change
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question