File:Suomen kevaan 2020 korona-aallon sir malli 1.svg
Original file (SVG file, nominally 752 × 350 pixels, file size: 37 KB)
Captions
Summary
[edit]DescriptionSuomen kevaan 2020 korona-aallon sir malli 1.svg |
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/
- sir model covid epidemy
- attmpt to model first vawe with
- SIR model
- first vawe in finland
- NORE not fully accurate
- educational purposes only
- 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:
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.
https://creativecommons.org/licenses/by-sa/4.0CC BY-SA 4.0 Creative Commons Attribution-Share Alike 4.0 truetrue
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 13:45, 21 August 2020 | 752 × 350 (37 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 601.92pt |
---|---|
Height | 280.08pt |