I
I
Igor2015-11-21 20:46:56
Python
Igor, 2015-11-21 20:46:56

Error in plotting integration results?

Compiled a simple code for integrating the equation:

from scipy.integrate import odeint
from numpy import linspace
from matplotlib import pyplot
def epid(y, t):
    k = 0.00003
    L = 250000
    return k*y*(L-y)
t = linspace(0, 12, 61)
y = odeint(epid, 250, t)
pyplot(t, y)

The trouble is that at startup it says:
TypeError: 'module' object is not callable
What did I do wrong and how can I fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2015-11-21
@ElMigele

not callable - this error occurs when you write parentheses on an object that cannot be called as a function. For example: 5().
Specifically, in this case, you are trying to call some module. I'm not very good at math packages, but one of: odeint, linspace, pyplot is a module, not a function. Probably the last one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question