Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168738
Image: ubuntu2004
b = 1/11 a = 6.8*b t = 1# Anzahl der Zeitabschnitte d = 1# Dauer eines Zeitabschnittes in Tagen S = [] I = [] R = [] S.append(9000) I.append(1000) R.append(0) n = S[0]+I[0]+R[0] print n for i in srange(1,t+1,1): #print i S.append( S[i-1]-a*I[i-1]*(S[i-1]/n*d)) I.append( I[i-1]+(a*I[i-1]*S[i-1]/n -b*I[i-1])*d) R.append( R[i-1]+b*I[i-1]*d ) #print 'S =' #print S[i] #print 'I =' #print I[i] #print 'R =' #print R[i] #print S[i]+I[i]+R[i] print 'S =' print S print 'I =' print I print 'R =' print R
10000 S = [9000, 8443.63636363636] I = [1000, 1465.45454545455] R = [0, 1000/11]
b = 1/11 a = 6.8*b t = 24 # Anzahl der Zeitabschnitte d = 1/2# Dauer eines Zeitabschnittes in Tagen S = [] I = [] R = [] S.append(9000) I.append(1000) R.append(0) n = S[0]+I[0]+R[0] for i in srange(1,t+1,1): #print i S.append( S[i-1]-a*I[i-1]*(S[i-1]/n*d)) I.append( I[i-1]+(a*I[i-1]*S[i-1]/n -b*I[i-1])*d) R.append( R[i-1]+b*I[i-1]*d ) #print 'S =' #print S[i] #print 'I =' #print I[i] #print 'R =' #print R[i] #print S[i]+I[i]+R[i] s = list_plot(S,rgbcolor=(1,0.75,0), plotjoined=True, legend_label='$S-Anfaellige$') i = list_plot(I,rgbcolor=(1,0,0), plotjoined=True, legend_label='$I-Infizierte$') r = list_plot(R,rgbcolor=(0,1,0), plotjoined=True, legend_label='$R-Genesene$') p = s+i+r p.set_legend_options(loc = 4, shadow=True) p.axes_label_color((0,0,1)) p.axes_labels(['$Zeitabschnitte$','$Anzahl der Menschen$']) p.axes_range(0,t,-n/3,n) show(p)