Saltar al contenido principal
LibreTexts Español

32.2: Dinámica Epidémica - Modelo Continuo

  • Page ID
    115202
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    %matplotlib inline
    import matplotlib.pylab as plt
    import numpy as np
    import sympy as sym
    sym.init_printing()

    En lugar de usar el modelo discreto de Markov, también podemos usar un modelo continuo con ecuaciones diferenciales ordinarias.

    Por ejemplo, tenemos que

    \[\dot{x}_1 = {dx_1(t)\over dt} = -0.05x_1(t)+ 0.04 x_2(t) \nonumber \]

    Significa que los cambios en el grupo susceptible dependen de individuos susceptibles e infectados. Aumenta por las personas recuperadas de las infectadas y disminuye por la infección.

    Del mismo modo, tenemos las ecuaciones para los tres grupos.

    \ [\ punto {x} _2 = {dx_2 (t)\ sobre dt} = 0.05x_1 (t) -0.17 x_2 (t)\
    \ punto {x} _3 = {dx_3 (t)\ sobre dt} = 0.1 x_2 (t)\
    \ punto {x} _4 = {dx_4 (t)\ sobre dt} = 0.03 x_2 (t)\ nonumbum er\]

    Hacer esto

    Podemos escribirlo como sistema de ODEs como\(\dot{x}(t) = Bx(t)\). Anota la matriz\(B\) en numpy.matrix

    # Put your answer to the above question here.
    Hacer esto

    Trazar toda la distribución por 200 días. Después compárela con la versión discreta.

    x0 = np.matrix([[1],[0],[0],[0]])
    n = 200
    x_all = np.matrix(np.zeros((4,n)))
    
    ### Your code starts here ###
    
    ### Your code ends here ###
    for i in range(4):
        plt.plot(x_all[i].T)
    D2, C2 = np.linalg.eig(B)
    np.allclose(C2*np.diag(D2)*C2**(-1), B)
    C = C2

    This page titled 32.2: Dinámica Epidémica - Modelo Continuo is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Dirk Colbry via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.