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)