Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 430 Bytes

递归差分方程.md

File metadata and controls

23 lines (17 loc) · 430 Bytes

打递归表

递归打表

data = RecurrenceTable[{r[n + 1] == r[n] + 0.60 i[n], 
   i[n + 1] == 0.4 i[n] + 0.001407 i[n] s[n], 
   s[n + 1] == s[n] - 0.001407 i[n] s[n], i[0] == 5, s[0] == 995, 
   r[0] == 0}, {r[n], i[n], s[n]}, {n, 1, 22}]

取出 r[n] 构造新列表(注意:以 1 开始)

data2 = data[[All, 1]]

画图

ListLinePlot[data2, Mesh -> All, 
 PlotStyle -> {PointSize[0.015]}]