#do not post #Nicholas DiMarzio, 11/8/21, Assignment 19 # #Problem 1 SIRSdemo(1000, 200, 3, 1, 0.01, 10); This is a numerical demonstration of the R0 phenomenon in the SIRS model using discretization with mesh size=, 0.01, and letting it run until time t=, 10 with population size, 1000, and fixed parameters nu=, 1, and gamma=, 3 where we change beta from 0.2*nu/N to 4*nu/N Recall that the epidemic will persist if beta exceeds nu/N, 1 that in this case is, ---- 1000 We start with , 200, infected individuals, 0 removed and hence, 800, susceptible We will show what happens once time is close to, 10 1 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [998.9666995, 0.9909989667]], [9.99, [998.9666995, 0.9909989667]], [10.00, [998.9666995, 0.9909989667]], [10.01, [998.9666995, 0.9909989667]]] 3 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [996.7009881, 2.978970309]], [9.99, [996.7009881, 2.978970309]], [10.00, [996.7009881, 2.978970309]], [10.01, [996.7009881, 2.978970309]]] 1 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [994.1715221, 4.974854288]], [9.99, [994.1715221, 4.974854288]], [10.00, [994.1715221, 4.974854288]], [10.01, [994.1715221, 4.974854288]]] 7 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [991.3807432, 6.978577656]], [9.99, [991.3807432, 6.978577656]], [10.00, [991.3807432, 6.978577656]], [10.01, [991.3807432, 6.978577656]]] 9 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [988.3315033, 8.990054852]], [9.99, [988.3315033, 8.990054852]], [10.00, [988.3315033, 8.990054852]], [10.01, [988.3315033, 8.990054852]]] 11 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [985.0270559, 11.00918827]], [9.99, [985.0270559, 11.00918827]], [10.00, [985.0270559, 11.00918827]], [10.01, [985.0270559, 11.00918827]]] 13 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [981.4710448, 13.03586861]], [9.99, [981.4710448, 13.03586861]], [10.00, [981.4710448, 13.03586861]], [10.01, [981.4710448, 13.03586861]]] 3 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [977.6674922, 15.06997519]], [9.99, [977.6674922, 15.06997519]], [10.00, [977.6674922, 15.06997519]], [10.01, [977.6674922, 15.06997519]]] 17 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [973.6207848, 17.11137641]], [9.99, [973.6207848, 17.11137641]], [10.00, [973.6207848, 17.11137641]], [10.01, [973.6207848, 17.11137641]]] 19 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [969.3356593, 19.15993017]], [9.99, [969.3356593, 19.15993017]], [10.00, [969.3356593, 19.15993017]], [10.01, [969.3356593, 19.15993017]]] 21 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [964.8171858, 21.21548438]], [9.99, [964.8171858, 21.21548438]], [10.00, [964.8171858, 21.21548438]], [10.01, [964.8171858, 21.21548438]]] 23 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [960.0707508, 23.27787743]], [9.99, [960.0707508, 23.27787743]], [10.00, [960.0707508, 23.27787743]], [10.01, [960.0707508, 23.27787743]]] 5 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [955.1020392, 25.34693877]], [9.99, [955.1020392, 25.34693877]], [10.00, [955.1020392, 25.34693877]], [10.01, [955.1020392, 25.34693877]]] 27 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [949.9170149, 27.42248950]], [9.99, [949.9170149, 27.42248950]], [10.00, [949.9170149, 27.42248950]], [10.01, [949.9170149, 27.42248950]]] 29 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [944.5219011, 29.50434292]], [9.99, [944.5219011, 29.50434292]], [10.00, [944.5219011, 29.50434292]], [10.01, [944.5219011, 29.50434292]]] 31 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [938.9231598, 31.59230516]], [9.99, [938.9231598, 31.59230516]], [10.00, [938.9231598, 31.59230516]], [10.01, [938.9231598, 31.59230516]]] 33 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [933.1274712, 33.68617582]], [9.99, [933.1274712, 33.68617582]], [10.00, [933.1274712, 33.68617582]], [10.01, [933.1274712, 33.68617582]]] 7 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [927.1417118, 35.78574860]], [9.99, [927.1417118, 35.78574860]], [10.00, [927.1417118, 35.78574860]], [10.01, [927.1417118, 35.78574860]]] 37 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [920.9729335, 37.89081195]], [9.99, [920.9729335, 37.89081195]], [10.00, [920.9729335, 37.89081195]], [10.01, [920.9729335, 37.89081195]]] 39 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [914.6283415, 40.00114971]], [9.99, [914.6283415, 40.00114971]], [10.00, [914.6283415, 40.00114971]], [10.01, [914.6283415, 40.00114971]]] SIRSdemo(1000, 200, 3, 2, 0.01, 10); This is a numerical demonstration of the R0 phenomenon in the SIRS model using discretization with mesh size=, 0.01, and letting it run until time t=, 10 with population size, 1000, and fixed parameters nu=, 2, and gamma=, 3 where we change beta from 0.2*nu/N to 4*nu/N Recall that the epidemic will persist if beta exceeds nu/N, 1 that in this case is, --- 500 We start with , 200, infected individuals, 0 removed and hence, 800, susceptible We will show what happens once time is close to, 10 1 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [998.9334028, 0.9819978668]], [9.99, [998.9334028, 0.9819978668]], [10.00, [998.9334028, 0.9819978668]], [10.01, [998.9334028, 0.9819978668]]] 3 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [996.4021571, 2.957935239]], [9.99, [996.4021571, 2.957935239]], [10.00, [996.4021571, 2.957935239]], [10.01, [996.4021571, 2.957935239]]] 1 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [993.3444243, 4.949667221]], [9.99, [993.3444243, 4.949667221]], [10.00, [993.3444243, 4.949667221]], [10.01, [993.3444243, 4.949667221]]] 7 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [989.7667603, 6.956997143]], [9.99, [989.7667603, 6.956997143]], [10.00, [989.7667603, 6.956997143]], [10.01, [989.7667603, 6.956997143]]] 9 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [985.6773407, 8.979679729]], [9.99, [985.6773407, 8.979679729]], [10.00, [985.6773407, 8.979679729]], [10.01, [985.6773407, 8.979679729]]] 11 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [981.0859054, 11.01742279]], [9.99, [981.0859054, 11.01742279]], [10.00, [981.0859054, 11.01742279]], [10.01, [981.0859054, 11.01742279]]] 13 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [976.0036901, 13.06988925]], [9.99, [976.0036901, 13.06988925]], [10.00, [976.0036901, 13.06988925]], [10.01, [976.0036901, 13.06988925]]] 3 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [970.4433482, 15.13669951]], [9.99, [970.4433482, 15.13669951]], [10.00, [970.4433482, 15.13669951]], [10.01, [970.4433482, 15.13669951]]] 17 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [964.4188616, 17.21743410]], [9.99, [964.4188616, 17.21743410]], [10.00, [964.4188616, 17.21743410]], [10.01, [964.4188616, 17.21743410]]] 19 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [957.9454447, 19.31163661]], [9.99, [957.9454447, 19.31163661]], [10.00, [957.9454447, 19.31163661]], [10.01, [957.9454447, 19.31163661]]] 21 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [951.0394389, 21.41881679]], [9.99, [951.0394389, 21.41881679]], [10.00, [951.0394389, 21.41881679]], [10.01, [951.0394389, 21.41881679]]] 23 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [943.7182031, 23.53845386]], [9.99, [943.7182031, 23.53845386]], [10.00, [943.7182031, 23.53845386]], [10.01, [943.7182031, 23.53845386]]] 5 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [935.9999984, 25.67000000]], [9.99, [935.9999984, 25.67000000]], [10.00, [935.9999984, 25.67000000]], [10.01, [935.9999984, 25.67000000]]] 27 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [927.9038703, 27.81288384]], [9.99, [927.9038703, 27.81288384]], [10.00, [927.9038703, 27.81288384]], [10.01, [927.9038703, 27.81288384]]] 29 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [919.4495282, 29.96651411]], [9.99, [919.4495282, 29.96651411]], [10.00, [919.4495282, 29.96651411]], [10.01, [919.4495282, 29.96651411]]] 31 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [910.6572255, 32.13028319]], [9.99, [910.6572255, 32.13028319]], [10.00, [910.6572255, 32.13028319]], [10.01, [910.6572255, 32.13028319]]] 33 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [901.5476397, 34.30357076]], [9.99, [901.5476397, 34.30357076]], [10.00, [901.5476397, 34.30357076]], [10.01, [901.5476397, 34.30357076]]] 7 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [892.1417551, 36.48574730]], [9.99, [892.1417551, 36.48574730]], [10.00, [892.1417551, 36.48574730]], [10.01, [892.1417551, 36.48574730]]] 37 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [882.4607475, 38.67617753]], [9.99, [882.4607475, 38.67617753]], [10.00, [882.4607475, 38.67617753]], [10.01, [882.4607475, 38.67617753]]] 39 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [872.5258747, 40.87422371]], [9.99, [872.5258747, 40.87422371]], [10.00, [872.5258747, 40.87422371]], [10.01, [872.5258747, 40.87422371]]] SIRSdemo(1000, 200, 7, 3, 0.01, 10); This is a numerical demonstration of the R0 phenomenon in the SIRS model using discretization with mesh size=, 0.01, and letting it run until time t=, 10 with population size, 1000, and fixed parameters nu=, 3, and gamma=, 7 where we change beta from 0.2*nu/N to 4*nu/N Recall that the epidemic will persist if beta exceeds nu/N, 3 that in this case is, ---- 1000 We start with , 200, infected individuals, 0 removed and hence, 800, susceptible We will show what happens once time is close to, 10 1 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [998.9571869, 0.9729968716]], [9.99, [998.9571869, 0.9729968716]], [10.00, [998.9571869, 0.9729968716]], [10.01, [998.9571869, 0.9729968716]]] 3 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [996.6155905, 2.936908621]], [9.99, [996.6155905, 2.936908621]], [10.00, [996.6155905, 2.936908621]], [10.01, [996.6155905, 2.936908621]]] 1 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [993.9350689, 4.924545130]], [9.99, [993.9350689, 4.924545130]], [10.00, [993.9350689, 4.924545130]], [10.01, [993.9350689, 4.924545130]]] 7 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [990.9190693, 6.935665103]], [9.99, [990.9190693, 6.935665103]], [10.00, [990.9190693, 6.935665103]], [10.01, [990.9190693, 6.935665103]]] 9 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [987.5717147, 8.969979927]], [9.99, [987.5717147, 8.969979927]], [10.00, [987.5717147, 8.969979927]], [10.01, [987.5717147, 8.969979927]]] 11 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [983.8977865, 11.02715490]], [9.99, [983.8977865, 11.02715490]], [10.00, [983.8977865, 11.02715490]], [10.01, [983.8977865, 11.02715490]]] 13 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [979.9027040, 13.10681067]], [9.99, [979.9027040, 13.10681067]], [10.00, [979.9027040, 13.10681067]], [10.01, [979.9027040, 13.10681067]]] 3 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [975.5925002, 15.20852494]], [9.99, [975.5925002, 15.20852494]], [10.00, [975.5925002, 15.20852494]], [10.01, [975.5925002, 15.20852494]]] 17 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [970.9737953, 17.33183428]], [9.99, [970.9737953, 17.33183428]], [10.00, [970.9737953, 17.33183428]], [10.01, [970.9737953, 17.33183428]]] 19 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [966.0537675, 19.47623623]], [9.99, [966.0537675, 19.47623623]], [10.00, [966.0537675, 19.47623623]], [10.01, [966.0537675, 19.47623623]]] 21 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [960.8401210, 21.64119148]], [9.99, [960.8401210, 21.64119148]], [10.00, [960.8401210, 21.64119148]], [10.01, [960.8401210, 21.64119148]]] 23 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [955.3410529, 23.82612625]], [9.99, [955.3410529, 23.82612625]], [10.00, [955.3410529, 23.82612625]], [10.01, [955.3410529, 23.82612625]]] 5 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [949.5652167, 26.03043478]], [9.99, [949.5652167, 26.03043478]], [10.00, [949.5652167, 26.03043478]], [10.01, [949.5652167, 26.03043478]]] 27 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [943.5216861, 28.25348193]], [9.99, [943.5216861, 28.25348193]], [10.00, [943.5216861, 28.25348193]], [10.01, [943.5216861, 28.25348193]]] 29 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [937.2199158, 30.49460585]], [9.99, [937.2199158, 30.49460585]], [10.00, [937.2199158, 30.49460585]], [10.01, [937.2199158, 30.49460585]]] 31 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [930.6697029, 32.75312075]], [9.99, [930.6697029, 32.75312075]], [10.00, [930.6697029, 32.75312075]], [10.01, [930.6697029, 32.75312075]]] 33 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [923.8811464, 35.02831970]], [9.99, [923.8811464, 35.02831970]], [10.00, [923.8811464, 35.02831970]], [10.01, [923.8811464, 35.02831970]]] 7 beta is, -, times the threshold value 2 the long-term behavior is [[9.98, [916.8646074, 37.31947743]], [9.99, [916.8646074, 37.31947743]], [10.00, [916.8646074, 37.31947743]], [10.01, [916.8646074, 37.31947743]]] 37 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [909.6306685, 39.62585316]], [9.99, [909.6306685, 39.62585316]], [10.00, [909.6306685, 39.62585316]], [10.01, [909.6306685, 39.62585316]]] 39 beta is, --, times the threshold value 10 the long-term behavior is [[9.98, [902.1900937, 41.94669340]], [9.99, [902.1900937, 41.94669340]], [10.00, [902.1900937, 41.94669340]], [10.01, [902.1900937, 41.94669340]]] #Problem 2 # A1 := RandNice([x, y], 8); A1 := [(6 - 5 x - 6 y) (7 - 4 x - 7 y), (3 - 6 x - 5 y) (7 - 7 x - 3 y)] A2 := RandNice([x, y], 8); A2 := [(5 - 4 x - 3 y) (7 - 8 x - 2 y), (3 - x - y) (3 - 5 x - 5 y)] A3 := RandNice([x, y], 8); A3 := [(2 - 2 x - 2 y) (3 - 2 x - 8 y), (4 - 7 x - 2 y) (1 - 5 x - y)] EquPts(A1, [x, y]); /[-12 21] [-7 15] [8 7 ] [28 21]\ { [---, --], [--, --], [-, --], [--, --] } \[11 11] [11 11] [9 27] [37 37]/ EquPts(A2, [x, y]); / [1 17] [16 -13] [29 -11]\ { [-4, 7], [-, --], [--, ---], [--, ---] } \ [6 6 ] [5 5 ] [30 30 ]/ EquPts(A3, [x, y]); / [1 1] [2 3] [5 13]\ { [0, 1], [-, -], [-, -], [--, --] } \ [2 4] [5 5] [38 38]/ StEquPts(A1, [x, y]); /[-12 21]\ { [---, --] } \[11 11]/ StEquPts(A2, [x, y]); /[29 -11]\ { [--, ---] } \[30 30 ]/ StEquPts(A3, [x, y]); {} Dis2(A1, x, y, [-12/11 + 0.1, 21/11 + 0.1], 0.01, 10); [[0.01, [-0.990909091, 2.009090909]], [0.02, [-0.9568090913, 1.922090909]], [0.03, [-0.9371430026, 1.853119534]], [0.04, [-0.9275162176, 1.801696233]], [0.05, [-0.9242337659, 1.765837453]], [0.06, [-0.9246687848, 1.742646218]], [0.07, [-0.9271805301, 1.729024387]], [0.08, [-0.9308305876, 1.722212553]], [0.09, [-0.9351052086, 1.720035151]], [0.10, [-0.9397236843, 1.720911910]], [...981 terms...], [9.92, [-1.090909088, 1.909090905]], [9.93, [-1.090909088, 1.909090905]], [9.94, [-1.090909088, 1.909090905]], [9.95, [-1.090909088, 1.909090905]], [9.96, [-1.090909088, 1.909090905]], [9.97, [-1.090909088, 1.909090905]], [9.98, [-1.090909088, 1.909090905]], [9.99, [-1.090909088, 1.909090905]], [10.00, [-1.090909088, 1.909090905]], [10.01, [-1.090909088, 1.909090905]]] Dis2(A2, x, y, [29/30 + 0.1, -11/30 + 0.1], 0.01, 10); [[0.01, [1.066666667, -0.2666666667]], [0.02, [1.051333334, -0.2886666667]], [0.03, [1.037494445, -0.3068636445]], [0.04, [1.025343997, -0.3216861203]], [0.05, [1.014918935, -0.3335878177]], [0.06, [1.006141805, -0.3430168143]], [0.07, [0.9988635102, -0.3503925749]], [0.08, [0.9928993844, -0.3560916156]], [0.09, [0.9880558115, -0.3604408073]], [0.10, [0.9841475332, -0.3637164784]], [...981 terms...], [9.92, [0.9666666671, -0.3666666677]], [9.93, [0.9666666671, -0.3666666677]], [9.94, [0.9666666671, -0.3666666677]], [9.95, [0.9666666671, -0.3666666677]], [9.96, [0.9666666671, -0.3666666677]], [9.97, [0.9666666671, -0.3666666677]], [9.98, [0.9666666671, -0.3666666677]], [9.99, [0.9666666671, -0.3666666677]], [10.00, [0.9666666671, -0.3666666677]], [10.01, [0.9666666671, -0.3666666677]]] Dis2(A2, x, y, [8/9 + 0.1, 7/27 + 0.1], 0.01, 10); [[0.01, [0.9888888889, 0.3592592593]], [0.02, [0.9894320988, 0.2974677641]], [0.03, [0.9871684993, 0.2386313516]], [0.04, [0.9825576159, 0.1831166422]], [0.05, [0.9761736587, 0.1312350995]], [0.06, [0.9686534920, 0.08321923089]], [0.07, [0.9606347419, 0.03920395204]], [0.08, [0.9526956407, -0.00078314218]], [0.09, [0.9453079399, -0.03682052167]], [0.10, [0.9388103659, -0.06908078752]], [...981 terms...], [9.92, [0.9666666661, -0.3666666655]], [9.93, [0.9666666661, -0.3666666655]], [9.94, [0.9666666661, -0.3666666655]], [9.95, [0.9666666661, -0.3666666655]], [9.96, [0.9666666661, -0.3666666655]], [9.97, [0.9666666661, -0.3666666655]], [9.98, [0.9666666661, -0.3666666655]], [9.99, [0.9666666661, -0.3666666655]], [10.00, [0.9666666661, -0.3666666655]], [10.01, [0.9666666661, -0.3666666655]]] Dis2(A2, x, y, [-4 + 0.1, 7 + 0.1], 0.01, 10); [[0.01, [-3.9, 7.1]], [0.02, [-4.0680, 7.1260]], [0.03, [-4.094809520, 7.133128200]], [0.04, [-4.099945315, 7.137799858]], [0.05, [-4.103421247, 7.142414051]], [0.06, [-4.106884090, 7.147169209]], [0.07, [-4.110455249, 7.152084568]], [0.08, [-4.114147058, 7.157166736]], [0.09, [-4.117964352, 7.162421632]], [0.10, [-4.121911577, 7.167855328]], [...981 terms...], [9.92, [Float(infinity), Float(infinity)]], [9.93, [Float(infinity), Float(infinity)]], [9.94, [Float(infinity), Float(infinity)]], [9.95, [Float(infinity), Float(infinity)]], [9.96, [Float(infinity), Float(infinity)]], [9.97, [Float(infinity), Float(infinity)]], [9.98, [Float(infinity), Float(infinity)]], [9.99, [Float(infinity), Float(infinity)]], [10.00, [Float(infinity), Float(infinity)]], [10.01, [Float(infinity), Float(infinity)]]] #Since A3 has no stable points, we cannot compare stable and unstable points. #Problem 3 # S := Is*exp(-R[0]*(R - Ir)/N); / R[0] (R - Ir)\ S := Is exp|- -------------| \ N / EquPts(S, [x, y]); {}