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












1














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










share|cite|improve this question





























    1














    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










    share|cite|improve this question



























      1












      1








      1


      1





      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










      share|cite|improve this question















      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







      differential-equations partial-derivative python programming






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 30 at 20:57

























      asked Nov 28 at 20:46









      Nickel

      62




      62



























          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3017689%2fepidemic-spacial-diffusion-problem-how-to-draw-a-graph-of-differential-system%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3017689%2fepidemic-spacial-diffusion-problem-how-to-draw-a-graph-of-differential-system%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          To store a contact into the json file from server.js file using a class in NodeJS

          Marschland