Skip to content

Instantly share code, notes, and snippets.

@SheriKabashi
Created December 2, 2023 18:14
Show Gist options
  • Select an option

  • Save SheriKabashi/6ee08616f05e04da422865eed544453c to your computer and use it in GitHub Desktop.

Select an option

Save SheriKabashi/6ee08616f05e04da422865eed544453c to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
##Initial Conditions
t=[0]
T=[4*10**8]
I=[0.0001]
V=[3.5*10**(-1)]
##Parameters
beta=3.4*10**(-4.54)
delta=3.4
p=7.9*10**(-3)
c=3.3
n = 700
deltat = 0.01
for i in range(1,n+1):
ti= t[-1] + deltat
Ti= T[-1] - beta*T[-1]*V[-1]*deltat
Ii= I[-1] + (beta*T[-1]*V[-1]-delta*I[-1])*deltat
Vi= V[-1] + (p*I[-1]-c*V[-1])*deltat
t.append(ti)
T.append(Ti)
I.append(Ii)
V.append(Vi)
plt.plot(t,T, label='T',color='blue')
plt.plot(t,I, label='I',color='g')
plt.plot(t,V, label='V',color='r')
plt.xlabel("t")
plt.ylabel("y")
plt.ylim([10**(-5),10**(9)])
plt.yscale('log')
plt.legend()
plt.grid()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment