Il Corona virus di Wuhan ha una progressione di crescita ben conosciuta e riportata dal sito dell’organizzazione mondiale della Sanità (www.who.int) con i report ufficiali pubblicati quasi giornalmente.

Ecco il link ai report sulla reale diffusione della malattia cosi come ufficializzato dalla WHO

Ho chiesto ai miei studenti di fare un programmino con una struttura dati (array monodimensionale) per contenere il numero di infettati se ogni giorno il tasso di infezione è del 2.5% come riporta il seguente grafico:

Corona Virus

Guardando il prossimo report inserisco nel coding java prodotto i dati ufficiali:
il 30 gennaio i dati degli infetti sono 7818

Inizio introducendo nell’elemento 0 dell’array questi dati e provo a calcolare gli elementi successivi cercando di prevedere se non ci fossero elementi che intervengano nella diffusione della malattia (pandemia) quanti ammalati avremo esattamente il 29 di febbraio 2020. Proverò a controllare la previsione sperando ovviamente di sbagliare.

Il numero di malati raddoppia ogni 7 giorni, il numero di infetti possibili raddoppia ogni giorno ed il numero di morti è del 3,10% sui malati.
L’infezione si diffonde senza interventi umani contenitivi quindi simulare e calcolare la progressione geometrica della malattia.

Segue il codice e il video del suo sviluppo:


package coronavirus;

public class CoronaVIRUS {

    public static void main(String[] args) {
       //we define 3 arrays  
      int days=100;
      double infected[]= new double[days];
      double illnes[]= new double[days];
      double death[]= new double[days];
      
      infected[0]=7818;
      for( int i=1;i<infected.length;i++)
        {
          infected[i]=Math.round(infected[i-1]+infected[i-1]*0.21)  ;
      
        }
      PrintArray(infected, "infected");
    
    illnes[0]=7818;
      for( int i=1;i<illnes.length;i++)
        {
          illnes[i]=Math.round(illnes[i-1]+illnes[i-1]*0.10)  ;
      
        }
       System.out.println("----------------------");
      PrintArray(illnes, "ill");
      
    
      for( int i=0;i<death.length;i++)
        {
          death[i]=Math.round(illnes[i]*0.031)  ;
      
        }
      System.out.println("----------------------");
      PrintArray(death, "death");
    }

    public static void PrintArray(double v[], String comment)
    { for( int i=0;i<v.length;i++)
        {System.out.println(v[i]+" "+ comment+"  day: "+i );
        }
    }
    
    
    
}

Nei commenti indica la tua previsione calcolata esattamente al giorno 29/2/2020 dalla data di inserimento del commento.

Ecco il code che calcola alcune previsioni matematiche senza considerare nessun intervento umano nella diffusione della malattia.I dati assolutamente non sono una previsione ma il risultato di un esercizio matematico che al massimo può indicare l'andamento della progressione geometrica.


7818.0 infected  day: 0   30/01/2020
9460.0 infected  day: 1   31/01
11447.0 infected  day: 2   1/2
13851.0 infected  day: 3   2/2
16760.0 infected  day: 4   3/2
20280.0 infected  day: 5   4/2
24539.0 infected  day: 6   5/2
29692.0 infected  day: 7   6/2
35927.0 infected  day: 8   7/2
43472.0 infected  day: 9
52601.0 infected  day: 10
63647.0 infected  day: 11
77013.0 infected  day: 12
93186.0 infected  day: 13
112755.0 infected  day: 14
136434.0 infected  day: 15
165085.0 infected  day: 16
199753.0 infected  day: 17
241701.0 infected  day: 18
292458.0 infected  day: 19
353874.0 infected  day: 20
428188.0 infected  day: 21
518107.0 infected  day: 22
626909.0 infected  day: 23
758560.0 infected  day: 24
917858.0 infected  day: 25
1110608.0 infected  day: 26
1343836.0 infected  day: 27
1626042.0 infected  day: 28
1967511.0 infected  day: 29
2380688.0 infected  day: 30   29/02/2020   ***********************************
2880632.0 infected  day: 31
3485565.0 infected  day: 32
4217534.0 infected  day: 33
5103216.0 infected  day: 34
6174891.0 infected  day: 35
7471618.0 infected  day: 36
9040658.0 infected  day: 37
1.0939196E7 infected  day: 38
1.3236427E7 infected  day: 39
1.6016077E7 infected  day: 40
1.9379453E7 infected  day: 41
2.3449138E7 infected  day: 42
2.8373457E7 infected  day: 43
3.4331883E7 infected  day: 44
4.1541578E7 infected  day: 45
5.0265309E7 infected  day: 46
6.0821024E7 infected  day: 47
7.3593439E7 infected  day: 48
8.9048061E7 infected  day: 49
1.07748154E8 infected  day: 50
1.30375266E8 infected  day: 51
1.57754072E8 infected  day: 52
1.90882427E8 infected  day: 53
2.30967737E8 infected  day: 54
2.79470962E8 infected  day: 55
3.38159864E8 infected  day: 56
4.09173435E8 infected  day: 57
4.95099856E8 infected  day: 58
5.99070826E8 infected  day: 59
7.24875699E8 infected  day: 60
8.77099596E8 infected  day: 61
1.061290511E9 infected  day: 62
1.284161518E9 infected  day: 63
1.553835437E9 infected  day: 64
1.880140879E9 infected  day: 65
2.274970464E9 infected  day: 66
2.752714261E9 infected  day: 67
3.330784256E9 infected  day: 68
4.03024895E9 infected  day: 69
4.87660123E9 infected  day: 70
5.900687488E9 infected  day: 71
7.13983186E9 infected  day: 72
8.639196551E9 infected  day: 73
1.0453427827E10 infected  day: 74
1.2648647671E10 infected  day: 75
1.5304863682E10 infected  day: 76
1.8518885055E10 infected  day: 77
2.2407850917E10 infected  day: 78
2.711349961E10 infected  day: 79
3.2807334528E10 infected  day: 80
3.9696874779E10 infected  day: 81
4.8033218483E10 infected  day: 82
5.8120194364E10 infected  day: 83
7.032543518E10 infected  day: 84
8.5093776568E10 infected  day: 85
1.02963469647E11 infected  day: 86
1.24585798273E11 infected  day: 87
1.5074881591E11 infected  day: 88
1.82406067251E11 infected  day: 89
2.20711341374E11 infected  day: 90
2.67060723063E11 infected  day: 91
3.23143474906E11 infected  day: 92
3.91003604636E11 infected  day: 93
4.7311436161E11 infected  day: 94
5.72468377548E11 infected  day: 95
6.92686736833E11 infected  day: 96
8.38150951568E11 infected  day: 97
1.014162651397E12 infected  day: 98
1.22713680819E12 infected  day: 99
----------------------
7818.0 ill  day: 0  30/01/2020
8600.0 ill  day: 1  31/01
9460.0 ill  day: 2  1/2
10406.0 ill  day: 3 2/2
11447.0 ill  day: 4 3/2
12592.0 ill  day: 5 4/2
13851.0 ill  day: 6 5/2
15236.0 ill  day: 7 6/2
16760.0 ill  day: 8  7/2
18436.0 ill  day: 9  8/2
20280.0 ill  day: 10 9/2
22308.0 ill  day: 11
24539.0 ill  day: 12
26993.0 ill  day: 13
29692.0 ill  day: 14
32661.0 ill  day: 15
35927.0 ill  day: 16
39520.0 ill  day: 17
43472.0 ill  day: 18
47819.0 ill  day: 19
52601.0 ill  day: 20
57861.0 ill  day: 21
63647.0 ill  day: 22
70012.0 ill  day: 23
77013.0 ill  day: 24
84714.0 ill  day: 25
93185.0 ill  day: 26
102504.0 ill  day: 27
112754.0 ill  day: 28
124029.0 ill  day: 29
136432.0 ill  day: 30 29/02/2020   ***********************************
150075.0 ill  day: 31
165083.0 ill  day: 32
181591.0 ill  day: 33
199750.0 ill  day: 34
219725.0 ill  day: 35
241698.0 ill  day: 36
265868.0 ill  day: 37
292455.0 ill  day: 38
321701.0 ill  day: 39
353871.0 ill  day: 40
389258.0 ill  day: 41
428184.0 ill  day: 42
471002.0 ill  day: 43
518102.0 ill  day: 44
569912.0 ill  day: 45
626903.0 ill  day: 46
689593.0 ill  day: 47
758552.0 ill  day: 48
834407.0 ill  day: 49
917848.0 ill  day: 50
1009633.0 ill  day: 51
1110596.0 ill  day: 52
1221656.0 ill  day: 53
1343822.0 ill  day: 54
1478204.0 ill  day: 55
1626024.0 ill  day: 56
1788626.0 ill  day: 57
1967489.0 ill  day: 58
2164238.0 ill  day: 59
2380662.0 ill  day: 60
2618728.0 ill  day: 61
2880601.0 ill  day: 62
3168661.0 ill  day: 63
3485527.0 ill  day: 64
3834080.0 ill  day: 65
4217488.0 ill  day: 66
4639237.0 ill  day: 67
5103161.0 ill  day: 68
5613477.0 ill  day: 69
6174825.0 ill  day: 70
6792308.0 ill  day: 71
7471539.0 ill  day: 72
8218693.0 ill  day: 73
9040562.0 ill  day: 74
9944618.0 ill  day: 75
1.093908E7 ill  day: 76
1.2032988E7 ill  day: 77
1.3236287E7 ill  day: 78
1.4559916E7 ill  day: 79
1.6015908E7 ill  day: 80
1.7617499E7 ill  day: 81
1.9379249E7 ill  day: 82
2.1317174E7 ill  day: 83
2.3448891E7 ill  day: 84
2.579378E7 ill  day: 85
2.8373158E7 ill  day: 86
3.1210474E7 ill  day: 87
3.4331521E7 ill  day: 88
3.7764673E7 ill  day: 89
4.154114E7 ill  day: 90
4.5695254E7 ill  day: 91
5.0264779E7 ill  day: 92
5.5291257E7 ill  day: 93
6.0820383E7 ill  day: 94
6.6902421E7 ill  day: 95
7.3592663E7 ill  day: 96
8.0951929E7 ill  day: 97
8.9047122E7 ill  day: 98
9.7951834E7 ill  day: 99
----------------------
242.0 death  day: 0 30/01/2020
267.0 death  day: 1
293.0 death  day: 2
323.0 death  day: 3
355.0 death  day: 4
390.0 death  day: 5
429.0 death  day: 6
472.0 death  day: 7
520.0 death  day: 8
572.0 death  day: 9
629.0 death  day: 10
692.0 death  day: 11
761.0 death  day: 12
837.0 death  day: 13
920.0 death  day: 14
1012.0 death  day: 15
1114.0 death  day: 16
1225.0 death  day: 17
1348.0 death  day: 18
1482.0 death  day: 19
1631.0 death  day: 20
1794.0 death  day: 21
1973.0 death  day: 22
2170.0 death  day: 23
2387.0 death  day: 24
2626.0 death  day: 25
2889.0 death  day: 26
3178.0 death  day: 27
3495.0 death  day: 28
3845.0 death  day: 29
4229.0 death  day: 30  29/02/2020********************************
4652.0 death  day: 31
5118.0 death  day: 32
5629.0 death  day: 33
6192.0 death  day: 34
6811.0 death  day: 35
7493.0 death  day: 36
8242.0 death  day: 37
9066.0 death  day: 38
9973.0 death  day: 39
10970.0 death  day: 40
12067.0 death  day: 41
13274.0 death  day: 42
14601.0 death  day: 43
16061.0 death  day: 44
17667.0 death  day: 45
19434.0 death  day: 46
21377.0 death  day: 47
23515.0 death  day: 48
25867.0 death  day: 49
28453.0 death  day: 50
31299.0 death  day: 51
34428.0 death  day: 52
37871.0 death  day: 53
41658.0 death  day: 54
45824.0 death  day: 55
50407.0 death  day: 56
55447.0 death  day: 57
60992.0 death  day: 58
67091.0 death  day: 59
73801.0 death  day: 60
81181.0 death  day: 61
89299.0 death  day: 62
98228.0 death  day: 63
108051.0 death  day: 64
118856.0 death  day: 65
130742.0 death  day: 66
143816.0 death  day: 67
158198.0 death  day: 68
174018.0 death  day: 69
191420.0 death  day: 70
210562.0 death  day: 71
231618.0 death  day: 72
254779.0 death  day: 73
280257.0 death  day: 74
308283.0 death  day: 75
339111.0 death  day: 76
373023.0 death  day: 77
410325.0 death  day: 78
451357.0 death  day: 79
496493.0 death  day: 80
546142.0 death  day: 81
600757.0 death  day: 82
660832.0 death  day: 83
726916.0 death  day: 84
799607.0 death  day: 85
879568.0 death  day: 86
967525.0 death  day: 87
1064277.0 death  day: 88
1170705.0 death  day: 89
1287775.0 death  day: 90
1416553.0 death  day: 91
1558208.0 death  day: 92
1714029.0 death  day: 93
1885432.0 death  day: 94
2073975.0 death  day: 95
2281373.0 death  day: 96
2509510.0 death  day: 97
2760461.0 death  day: 98
3036507.0 death  day: 99
BUILD SUCCESSFUL (total time: 0 seconds)