File:Suomen kevaan 2020 korona-aallon sir malli 1.svg

Original file(SVG file, nominally 752 × 350 pixels, file size: 37 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

edit
Description
Suomi: Suomen kevaan 2020 korona-aallon SIR-malli.
Date
Source Own work
Author Merikanto

This code is based SIR code from https://scipython.com/book/chapter-8-scipy/additional-examples/the-sir-epidemic-model/

    1. sir model covid epidemy
    2. attmpt to model first vawe with
    3. SIR model
    4. first vawe in finland
    5. NORE not fully accurate
    6. educational purposes only
    7. code is based from https://scipython.com/book/chapter-8-scipy/additional-examples/the-sir-epidemic-model/

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

N = 6000 I0= 1 R0 = 0 S0 = N - I0 - R0 beta =1/4 ## infection rate gamma = 1.0/30 ## recovery rate delta=0.045 ##death

t = np.linspace(0, 160, 160)

def deriv(y, t, N, beta, gamma):

   S, I, R = y
   dSdt = -beta * S * I / N
   dIdt = beta * S * I / N - gamma * I
   dRdt = gamma * I
   return dSdt, dIdt, dRdt

y0 = S0, I0, R0

ret = odeint(deriv, y0, t, args=(N, beta, gamma)) S, I, R = ret.T

D=R*delta R2=R*(1.0-delta)

fig = plt.figure(facecolor='w') ax = fig.add_subplot(111, axisbelow=True)

ax.plot(t, S, 'b', alpha=0.5, lw=2, label='Ei ollut tautia') ax.plot(t, I, 'r', alpha=0.5, lw=2, label='Sairaat') ax.plot(t, R2, 'g', alpha=0.5, lw=2, label='Parantuneet') ax.plot(t, D, '#000000', alpha=0.5, lw=2, label='Kuolleet')

plt.title("Suomen kevään 2020 korona-aallon SIR-malli") ax.set_xlabel('Päivä') ax.set_ylabel('Luku')

ax.yaxis.set_tick_params(length=0) ax.xaxis.set_tick_params(length=0)

legend = ax.legend() legend.get_frame().set_alpha(0.5) for spine in ('top', 'right', 'bottom', 'left'):

   ax.spines[spine].set_visible(False)

plt.show()

Licensing

edit
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:45, 21 August 2020Thumbnail for version as of 13:45, 21 August 2020752 × 350 (37 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata