yijunwang0805 / covid-19

COVID-19 infectious forecasting using SEIR model and R0 estimation
65 stars 19 forks source link

Is SEIR a transport equation? #2

Closed randomwangran closed 4 years ago

randomwangran commented 4 years ago

A typical SEIR (susceptible, exposed, infectious, removed) model can be described as a system of differential equations

I am curiosity to know what kind of equation you are trying to study.

Can I rewirte your equation into this equation?

yijunwang0805 commented 4 years ago

Hi randomwangran,

I believe your equation comes from Partial Differential Equations by Evans. I do need the content of the page to see what is going on. A transport equation allows you to model complex behaviors of objects such as waves propagating and strings vibrating. I look online to find information that might be helpful for you

#Transport equation with decay implementation

import numpy as np
from numpy import pi
import matplotlib.pyplot as plt
import matplotlib.animation as animation
%matplotlib notebook # If you are using Jupyter, to have plots show in Jupyter
fig = plt.figure()
fig.set_dpi(100)
ax1 = fig.add_subplot(1,1,1)

#Initial contitions
x0 = np.linspace(-2,15,10000)
t0 = 0

#Increment
dt = 0.01

#Wave speed k > 0
k = 3

#Decay constant b > 0
b = 2

#Scale
scale = 4

#Transport function
def u(x,t):
    return scale*np.exp(-(x-k*t)**2)*np.exp(-b*t)

t = []
g = []

for i in range(500):
    g.append(u(x0,t0))
    t.append(t0)
    t0 = t0 + dt

k = 0
def animate(i):
    global k
    ax1.clear()
    plt.plot(x0,g[k],color='red',label='Time elapsed: '+str(round(t[k],4)))
    plt.grid(True)
    plt.ylim([-1,scale+1])
    plt.xlim([-2,15])
    plt.legend(loc=2)
    plt.title('Transport equation with decay')
    k += 1

anim = animation.FuncAnimation(fig,animate,frames=360,interval=20)
plt.show()

Code from Mic

My model is a compartmental model in epidemiology, used to simplify the mathematical modeling of infectious disease. The population is divided into compartments, with the assumption that every individual in the same compartment has the same characteristics. SEIR is a common model in epidemiology.

Hope this helps.

randomwangran commented 4 years ago

sorry, you are right.

Before I further study your information, just put the page: Page 18 2.1 Transport equation. (2nd edition)

I will let you know my thoughts after reading all your reply.

Thanks for inspiration.

WenjieZ commented 4 years ago

I came from the mentioned issue.

Is this a bot?

randomwangran commented 4 years ago

@WenjieZ

No, it is a human, I guess.

But a human who want to study SEIR.