def show_results(self):
pl.plot(self.t1, self.n_A1, 'b--', label='A1: Time Step = 0.05')
pl.plot(self.t1, self.n_B1, 'b', label='B1: Time Step = 0.05')
pl.plot(self.t2, self.n_A2, 'g--', label='A2: Time Step = 0.1')
pl.plot(self.t2, self.n_B2, 'g', label='B2: Time Step = 0.1')
pl.plot(self.t1, self.n_A1_true, 'r--', label='True A1: Time Step = 0.05')
pl.plot(self.t1, self.n_B1_true, 'r', label='True B1: Time Step = 0.05')
pl.plot(self.t2, self.n_A2_true, 'c--', label='True A2: Time Step = 0.1')
pl.plot(self.t2, self.n_B2_true, 'c', label='True B2: Time Step = 0.1')
pl.title('Double Decay Probelm-Approximation Compared with True in Defferent Time Steps')
pl.xlim(0.0, 0.1)
pl.ylim(0.0, 100.0)
pl.xlabel('time ($s$)')
pl.ylabel('Number of Nuclei')
pl.legend(loc='best', shadow=True, fontsize='small')
pl.grid(True)
pl.savefig("computational_physics homework 4(improved-7).png")
4(improved-7).py 文件源码
python
阅读 34
收藏 0
点赞 0
评论 0
评论列表
文章目录