Sharedhomework 1 4.2 #3 .sagewsOpen in CoCalc
Homework
#Andrea Campos Carrillo 
#4.2 #3
#trajectory
var("H,G")
k1=.1
k3=.1
@interact
def verify(n=(0,12)):
    t=srange(0,100,.1)
    sol = desolve_odeint([(1/(1+G^n))-k1*H,H-k3*G], ics=[.4,.4], dvars=[H,G],times=t)
    c=list_plot(zip(sol[:,0],sol[:,1]), plotjoined=True,axes_labels=["H","G"])
    show(c)
#no oscillation no matter what value of n due to the elimination of time delay.(eliminate middle man in this case P)
(H, G)
Interact: please open in CoCalc
#time series 
var("H,G")
k1=.1
k3=.1
@interact
def timeseries(n=(0,12)):
    t=srange(0,100,.1)
    sol= desolve_odeint([(1/(1+G^n))-k1*H,H-k3*G], ics=[.4,.4], dvars=[H,G],times=t)
    d=list_plot(zip(t,sol[:,0]),plotjoined=True,axes_labels=["times","H,G"])+list_plot(zip(t,sol[:,1]))
    show(d)
(H, G)
Interact: please open in CoCalc