Epidemic spacial diffusion problem.. how to draw a graph of differential system of second order with partial derivative

51 Views Asked by At

I'm currently working on how to simulate the diffusion of an epidemic in a population. If we don't consider that the population is moving in space, then the differential system is the following: Differential System SIS without spacial diffusion. You'll find the corresponding program below. If we consider that the population (the infected people to be more specific) have an anarchic mobility, the differential system will contain a second order partial derivative in respect to the spacial variable x (the problem is considered in one spacial dimension only) as shows the following picture: Differential System SIS with spacial diffusion included. The problem I have is how to implement that second order partial derivative in the program, and how draw the graphs of such a differential system.. (even though there is a spacial variable, the axes remain the same: Population and Time) If you take off the partial derivative, it becomes a simple differential system and the corresponding program I made is the following:

from scipy import arange
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import numpy as np

N0 = 1000000        #Initial population number
I0 = 100            #Initial infected number
PopuIni = [N0,I0]


b=1/3000000 #infection rate β
g=1/20      #cure rate of Infected people ɣ
d=5/1000    #death rate, not related to the epidemic (common between infected and susceptible)
n=4/1000    #birth rate (vertical infection from parents to progeny is not 
considered here)

def EpidEvol(N,t):
   S,I=N
   derS = n*(S+I) + g*I - d*S - b*S*I
   derI = b*S*I - d*I - g*I
   return [derS,derI]


tmax=157
t=arange(0,tmax,0.1)
N=odeint(EpidEvol,PopuIni,t)

Thank you for your attention.. I sincerely hope to receive help from you

UPDATE 1: I found this website which provides a method of solving partial differential equations, but I genuinely don't know how to implement this in my program.. http://hplgit.github.io/prog4comp/doc/pub/p4c-sphinx-Python/._pylight006.html