Author Topic: Re: a test or experiment in epidemiology  (Read 1002 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: a test or experiment in epidemiology
« on: March 24, 2020, 05:09:55 am »
According to your program, it will take 32 days to end people around 7 billion.
Quite dangerous.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #1 on: March 24, 2020, 10:04:01 pm »
Didn't I post something here suggesting graphics and talking about people who survive the virus and build resistance and modelling something other than a nose dive into death and desolation?

Maybe I forgot to hit the post button.

OK now I checked, it's posted. I will work up a graphic to show what I mean.
« Last Edit: March 24, 2020, 10:05:56 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #2 on: March 27, 2020, 12:00:06 pm »
Sorry for not getting back to you, I find my enthusiasm for Pandemic modeling anemic.

Plus could not think of good example to follow. I was thinking Predator Pray might kick in where too much success for Predator leads to starvation and death of that population, virus not quite the same, virus does not have 100% kill no where near that! In fact virus does not kill, it's the body's reaction to virus that is deadly specially when health is already compromised so the models have to consider sub groups of people at different health risks.

What I really dislike about the OP and follow up reply is that there is no accounting for immunity, everybody dies in that catastrophic model when in fact everyone mostly lives and gets some sort of immunity but also possible lung or other body damage.  eh! too complex.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #3 on: March 27, 2020, 05:11:55 pm »
Here is something interesting, Numberphile talking about disease modeling:

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #4 on: March 27, 2020, 07:29:39 pm »
OK, I confess, I fudged numbers until the graphs matched the video :P

Code: QB64: [Select]
  1. _TITLE "The Curve: Blue = Susceptible, Red Infected, Green = Neither S nor I"
  2. ' Numberphile math model of disease spread
  3. ' [youtube]https://www.youtube.com/watch?v=k6nLfCbAzgo[/youtube]
  4.  
  5. SCREEN _NEWIMAGE(1000, 400, 32)
  6. DIM SHARED S, I, R, Trans, Recov, dt
  7. Trans = 3.2
  8. Recov = .23
  9. maxT = 1
  10. I = .01
  11. S = 1 - I
  12. dt = .01
  13. WHILE t < 1000
  14.     newS = S + dSdt
  15.     newI = I + dIdt
  16.     newR = R + dRdt
  17.     PSET (t, 400 - 400 * newS), &HFF0000FF
  18.     PSET (t, 400 - 400 * newI), &HFFFF0000
  19.     PSET (t, 400 - 400 * newR), &HFF00BB00
  20.     S = newS
  21.     I = newI
  22.     R = newR
  23.     t = t + 1
  24. FUNCTION dSdt ()
  25.     dSdt = (-Trans * S * I) * dt
  26. FUNCTION dIdt ()
  27.     dIdt = (Trans * S * I - Recov * I) * dt
  28. FUNCTION dRdt ()
  29.     dRdt = (Recov * I) * dt
  30.  

Marked as best answer by ron77 on March 28, 2020, 12:46:22 pm

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #5 on: March 27, 2020, 07:52:51 pm »
Man at my age I am still studying the curves!

Here is a model where the disease dies out leaving a portion of the population still susceptible! by lowering the transmission rate = Trans, I also increased dt = the time periods of snap shots lets say, because the model stretches out over time to play itself out.

Code: QB64: [Select]
  1. _TITLE "The Curve: Blue = Susceptible, Red Infected, Green = Neither S nor I"
  2. ' Numberphile math model of disease spread
  3. ' [youtube]https://www.youtube.com/watch?v=k6nLfCbAzgo[/youtube]
  4.  
  5. SCREEN _NEWIMAGE(1000, 400, 32)
  6. DIM SHARED S, I, R, Trans, Recov, dt
  7. Trans = .9 ' Transmission Rate - this number is the one we might greatest control over
  8. Recov = .23 ' Recovery Rate - mostly up to nature but medicines might speed up recovery rate
  9. I = .001 ' Infected 1/1000 infected
  10. S = 1 - I ' Susceptible to Infection
  11. R = 0 'obvious at start none have recovered
  12. dt = .02 ' as reduce Trans time periods 3.2 start dt at .01 increase dt time period because it drags out life of infection
  13. WHILE t < 1000
  14.     newS = S + dSdt
  15.     newI = I + dIdt
  16.     newR = R + dRdt
  17.     PSET (t, 400 - 400 * newS), &HFF0000FF
  18.     PSET (t, 400 - 400 * newI), &HFFFF0000
  19.     PSET (t, 400 - 400 * newR), &HFF00BB00
  20.     S = newS
  21.     I = newI
  22.     R = newR
  23.     t = t + 1
  24. FUNCTION dSdt ()
  25.     dSdt = (-Trans * S * I) * dt
  26. FUNCTION dIdt ()
  27.     dIdt = (Trans * S * I - Recov * I) * dt
  28. FUNCTION dRdt ()
  29.     dRdt = (Recov * I) * dt
  30.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a test or experiment in epidemiology
« Reply #6 on: March 28, 2020, 11:10:02 am »
This one looks perfect for InForm, hope I am not too rusty, it worked great in JB.