<jupyter_start><jupyter_text>SIR ModelThe SIR eqautions are,1. $S' = -\beta SI$2. $I' =  \beta SI - \gamma I$3. $R = 1 - S - I $ where, $S$ is the fraction of susceptible population, $I$ is the fraction of infected population, $R$ is recovered population. Equation 2 can also be written as,4. $I' =  \gamma I(R_0S - 1)$where, $R_0$ is the ''basic reproduction number'' (BRN) defined as,5. $R_0 = \beta D$where $D$ is the expected duration of the infective phase ($D = 1/\gamma$ ).The maximum of the prevalence can be determined by the curve $I(S)$, which is obtained from Eqs. (1)–(4) by taking,6. $dI/dS = 1/(R_0S) - 1$whose solution in $0 < S ≤ S(0)$ (remind that $S(t)$ is decreasing) is,7. $I(S) = I(0) + S(0) - S + log(S/S(0))/R_0$<jupyter_code># defining I(S)
def I_S(s, r0, i0, s0):
    Is = i0 + s0 - s + log(s/s0)/r0
    return Is
x  = np.linspace(0, 1, 1000)
s = x[1:]
v = np.vectorize(I_S) 
a = v(s, 5, 0, 1)
b = v(s, 3, 0, 1)
c = v(s, 2, 0, 1)
plt.ylim([0, 0.5])
plt.plot(s, a, label = '$R_0$ = 5')
plt.plot(s, b, label = '$R_0$ = 3')
plt.plot(s, c, label = '$R_0$ = 2')
plt.xlabel("S(t)")
plt.ylabel("I(t)")
plt.title("dynamics in the S ,I phase plane")
plt.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2001654259718776, 'fraction_numerical': 0.04714640198511166, 'mean_word_length': 3.618320610687023, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '230764', 'license': 'Apache-2.0', 'n_tokens_mistral': 576, 'n_tokens_neox': 529, 'n_words': 174, 'path': '3/Statistical Physics of vaccination .ipynb', 'repo_name': 'Jabi7/Vaccination-Stat-Phys', 'size': '1209'}