I would like to create a script that integrates an ode model, such that I can change one of the parameters and see the response of the systems to this change. If for, for example, I have a Lotka-Volterra model (as taken from this example):
import numpy as np
from scipy import integrate
a = 1.
b = 0.1
c = 1.5
d = 0.75
def dX_dt(X, t=0):
""" Return the growth rate of fox and rabbit populations. """
return array([ a*X[0] - b*X[0]*X[1] ,
-c*X[1] + d*b*X[0]*X[1] ])
t = np.linspace(0, 15, 1000) # time
X0 = np.array([10, 5]) # initials conditions: 10 rabbits and 5 foxes
X, infodict = integrate.odeint(dX_dt, X0, t, full_output=True)
I would like to create a slider for parameters a and c, as in the slider_demo of matplotlib, or any other tool. The plot should display a certain window of time that always spans [t_current - delta_t ,t_current]. And so I will be able to explore the parameters space continuously by changing the sliders of the parameters.
How to do it?