# Revision history [back]

There are two problems here: you're trying to use lmd as an initial condition for the system of differential equations but then defining it in terms of the solution, and you don't have enough initial conditions. Assuming the initial conditions should be given in terms of the initial value of lmd, here's an example that works without error messages:

@interact
def interactive_function(nu = slider(0.01, 0.1, 0.005, default=0.03125),
d = slider(0, 1, 0.05, default=1),
B = slider(500, 30000, 250, default=13333),
v = slider(0, 1, 0.05, default=0.2),
c = slider(0, 50, 1, default=4),
p = slider(0, 1, 0.05, default=0.3),
beta = slider(0, 1, 0.002, default=0.014)):

def f_1(t,y,params) :
return [ -params-params*y-y*params*y,
y*params*y-(params+params)*y,
(1-params)*params*y-params*y,
params*params*y-(params+params)*y,
(params*y)/(y+y+y) ]

lmd0 = 1

T = ode_solver()
T.function = f_1
T.algorithm="rk8pd"
T.ode_solve( y_0=[lmd0,0,1-lmd0,0,lmd0] , t_span=[0,150] , params=[nu,d,B,v,c,p,beta] , num_points=1000)

f = T.solution
X = [(x,x) for x in f]
Y = [(x,x) for x in f]
Z = [(x,x) for x in f]
A = [(x,x) for x in f]
lmd = [(x,x) for x in f]

P1 = line(X, rgbcolor='green')
P2 = line(Y, rgbcolor='pink')
P3 = line(Z, rgbcolor='red')
P4 = line(A, rgbcolor='brown')
P5 = line(lmd, rgbcolor='green')
show(P1+P2+P3+P4+P5)


Here's a live example with which you can experiment.