I tried to solve a differential equation using lib odient
in python, and this is what I wrote in gedit
editor:
# -*- coding: utf-8 -*-
from __future__ import division
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import numpy as np
def phi(y,t):
return 1.5*y*(1-y/6)
y0 = 1.0
t =np.linspace(0,5,201)
sol = odeint(phi,y0,t)
plt.plot(t,sol)
plt.show()
and everytime I try to execute it in terminal, here's what I get: ImportError: No module named integrate
but when I try execute it using Ipython everything goes normal, here's a screenshot: pic2
can you please help me? thanks.