Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Flu diagram

237 views
S = [49000000] B = [8] C = [17640] NUM_YEARS = 180 for yr in range(NUM_YEARS): iyr = i[t-1]+8*s(t-1)-2/3*I[t-1]+2/3*i[t-1]-1/3*i[t-1] syr = s[t-1] -bsi ryr = r[t-1] + 1/3*i[t-1] i.append(iyr) s.append(syr) r.append(ryr) print A[NUM_YEARS] print B[NUM_YEARS] print C[NUM_YEARS] r(0)=0 s(0)+1-i(0)-r(0) i(0)=10/4900000
*** WARNING: Code contains possible implicit multiplication *** *** Check if any of [ 3I(t, 3I(t, 3I(t, 3I(t ] need a "*" sign for multiplication, e.g. 5x should be 5*x ! *** Error in lines 5-11 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute flags=compile_flags) in namespace, locals File "<string>", line 2 iyr = i[t-Integer(1)]+bs(t-Integer(1))-Integer(2)/3I(t-Integer(1))+Integer(2)/3I(t-Integer(1))-Integer(1)/3I(t-Integer(1)) ^ SyntaxError: invalid syntax
Apts = zip(list(range(NUM_YEARS+1)),A) P = list_plot(Apts,plotjoined=True) Bpts = zip(list(range(NUM_YEARS+1)),B) Q = list_plot(Bpts,plotjoined=True,color='red') Cpts = zip(list(range(NUM_YEARS+1)),C) R = list_plot(Cpts,plotjoined=True,color='green') show(P+Q+R)
total = [i[t]+r[t]+s[t](NUM_YEARS+1) for i in range] Tpts = zip(list(range(NUM_YEARS+1)),total) T = list_plot(Tpts,plotjoined=True, color='purple') show(P+Q+R+T)