[关闭]
@rrtcc 2016-10-09T15:00:26.000000Z 字数 1753 阅读 48

第四次作业

摘要

Exercise1.5

重新考虑两种类型的核A与核B的衰变问题,但现在假设A型的核衰变为B型的核,而B型的核衰变为A型的核。严格地说,这不是“衰变”的过程,因为B型核可以转变回A型核,更好的类比是一个可以在相同能量的两个状态A和B之间相互转换的谐振系统。
相应的速率方程为rate equtions
为简单起见,我们假设两种类型的衰变的是由相同的时间常数τ来描述。 解出这个方程系统的核数,NA和NB,以时间函数的形式。 考虑不同的初始条件,如NA = 100,NB = 0等,并取tau = 1s。 表明你的数值结果与系统达到的状态,NA和NB是常数的想法一致。 在这种稳定状态下,时间导数dNA / dt和dNB / dt应该消失。

原题:Consider again a decay problem with two types of nuclei A and B, but now suppose that nuclei of type A decay into ones of type B, while nuclei of type B decay into ones of type A. Strictly speaking, this is not a "decay" process, since it is possible for the type B nuclei to turn back into type A nuclei. A better analogy would be a resonance in which a system can tunnel or move back and forth between two states A and B which have equal energies.where for simplicity we have assumed that the two types of decay are characterized by the same time constant, tau. Solve this system of equation for the numbers of nuclei, NA and NB, as functions of time. Consider different initial conditions, such as NA=100, NB=0, etc, and take tau=1s. Show that your numerical results are consistent with the idea that the system reaches a steady state in which NA and NB are constant. In such a steady state, the time derivatives dNA/dt and dNB/dt should vanish.

背景介绍

本次作业的任务主要是解一个常微分方程组,于是考虑用欧拉近似法来解,使用一级欧拉近似法,考虑如下近似
将近似结合速率方程可以得到如下的近似方程近似方程

解该近似方程

正文

依照如上近似,设计代码

先考虑初始化代码中所需要的参数和变量,然后根据近似做相应的计算,再利用pylab绘图,最后可以验证题中假设
这是本次作业的代码
运行代码,输入不同的初始值,可以得到结果如下
The initial number of A:0
The initial number of B:100
The initial number of time:1
Time_of_duration:5
The time step: 0.05
01
The initial number of A:60
The initial number of B:40
The initial number of time:1
Time_of_duration:5
The time step: 0.05
02
The initial number of A:60
The initial number of B:40
The initial number of time:0.5
Time_of_duration:5
The time step: 0.05
03

结论

1.在不同初始条件下,数值结果与题中所述系统达到的NA和NB是常数的状态一致
2.当τ减小时,达到平衡的过程缩短了
3.采用近似后,本题近似精度尚可,但当步数增多时,误差会因积累而越来越大,可考虑采用scipy.integrate库做更精确的运算。

致谢

用Python做科学计算
什么是欧拉方法(Euler's method)?

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注