'''Example of a right-hand side of a system of two differential equations.
The scipy function scipy.integrate.ode requires the function exactly in this
form.
Input:
t... independent variable (has to be carried along also
in autonomous systems as a dummy-variable)
y... vector of independent variables (list or 1D array)
Output:
the vector field f as a function of t and y.
Attention: f has to be a column vector.
Typical call:
import scipy
from scipy.integrate import ode
from python21_1 import f
r = ode(f)
r.set_initial_value([0,1], 0)
r.integrate(r.t + 2*scipy.pi)
'''
def f(t,y):
return [y[1], -y[0]]