代写接单-MATH 248 HW #2 HW2 September 29, 2022

MATH 248 HW #2 HW2 September 29, 2022

Due Monday Oct 3 at midnight on BrightSpace. Please submit a Jupyter notebook or a Python script. Susceptible-Infectious-Susceptible epidemic mode: consider a disease spread in a population of in- dividuals, without births, deaths, and migrations. Let and be the number of susceptible and infectious individuals on day . The total population = + remains constant. A susceptible individual has a probability 1 / to be infected and become infectious on day , where is the transmission rate. An infectious individual recovers with a probability on each day, and becomes susceptible upon recovery without gaining immunity. Thus, the change in can be modeled as +1 = (1/) = ( )(1/) 1. (10 points) Write a function SIS to compute the solution of the above model with an initial condition 0, the parameters values , and , for a period of time . Arguments: T: the last time point I0: the initial number of infectious individuals beta: the transmission rate gamma: the recovery rate N: the total population Return value: an array of length + 1, holding 0, 1, ..., . 2. (10 points) This model has a unique nonnegative attactor, which is a fixed point. This fixed point changes as the transmission rate changes. Make a point showing how the fixed point changes with beta, for = 2000, = 0.25, and values of 0.20, 0.21, 0.22, ..., 1. 3. (10 points) Given an initial condition 0 = 1, and parameter values = 0.25, = 2000, find the value that maximizes the rate of change of 10/. Hint: This is where 210/2 = 0. You may use numerical differentiation to approximate the second derivative. The answer lies between 1 and 4. ##Questoin1 from numpy import zeros import math [9]: 1 def SIS(T, I0, beta, gamma, N): V = zeros((len(T)+1, 1)) S = N-I0 I = I0 R=0 V[0] = [I] for t in range(1,len(T)+1): infections = 1 - math.exp(-beta I / N) susceptible = gamma I I=I + S infections - susceptible V[t] = [I] return V ##Question2 t=range(0,80) V = SIS(t, 10, 0.20, 0.25, 2000) print(V) [[10. ] [ 9.48900533] [ 9.00417043] [ 8.54415129] [ 8.1076734 ] [ 7.69352818] [ 7.30056945] [ 6.92771022] [ 6.57391957] [ 6.23821977] [ 5.91968343] [ 5.61743097] [ 5.33062807] [ 5.05848336] [ 4.80024614] [ 4.55520436] [ 4.3226825 ] [ 4.1020398 ] [ 3.89266837] [ 3.69399153] [ 3.50546221] [ 3.32656138] [ 3.15679665] [ 2.99570088] [ 2.84283085] [ 2.69776607] [ 2.56010759] [ 2.4294769 ] [ 2.30551485] 2 [ 2.18788071] [ 2.07625117] [ 1.97031947] [ 1.86979455] [ 1.77440025] [ 1.68387451] [ 1.5979687 ] [ 1.51644689] [ 1.43908522] [ 1.36567126] [ 1.29600347] [ 1.22989058] [ 1.16715111] [ 1.10761285] [ 1.05111239] [ 0.99749467] [ 0.94661254] [ 0.89832638] [ 0.85250371] [ 0.80901879] [ 0.76775232] [ 0.72859109] [ 0.69142766] [ 0.65616009] [ 0.62269164] [ 0.59093051] [ 0.56078958] [ 0.53218618] [ 0.50504187] [ 0.4792822 ] [ 0.45483652] [ 0.4316378 ] [ 0.40962242] [ 0.38873 ] [ 0.36890327] [ 0.35008785] [ 0.33223215] [ 0.31528721] [ 0.29920657] [ 0.28394615] [ 0.26946409] [ 0.2557207 ] [ 0.2426783 ] [ 0.23030112] [ 0.21855523] [ 0.20740844] [ 0.19683018] [ 0.18679146] 3 [ 0.17726474] [ 0.16822393] [ 0.15964423] [ 0.15150212]] [ ]: 4

Email:51zuoyejun

@gmail.com