def timeTransitFactor(self, beta):
# E_z0_of_s
z1z2 = -2*self.halfnbrofoscillations*self.L/3 # /3 since A = 0 and B =/= 0
#print "z1z2: " + str(z1z2)
z4z5 = 2*self.halfnbrofoscillations*self.L/3 # /3 since A = 0 and B =/= 0
#print "z4z5: " + str(z4z5)
## Integral
# -inf to z1|z2
I1 = quad(lambda s: self.amplitudeB*exp(((s+z1z2)/self.sigma)**self.p)*cos(2*constants.pi/(beta*self.rf_lambda)*s - self.phi_s),-inf,z1z2)
#print "I1: " + str(I1)
# z2 to z4||z5
I2 = quad(lambda s: (self.amplitudeA*cos(constants.pi*s/self.L)+self.amplitudeB*cos(3*constants.pi*s/self.L))*cos(2*constants.pi/(beta*self.rf_lambda)*s - self.phi_s),z1z2,z4z5)
#print "I2: " + str(I2)
# z5 to inf
I3 = quad(lambda s: self.amplitudeB*exp((-(s-z4z5)/self.sigma)**self.p)*cos(2*constants.pi/(beta*self.rf_lambda)*s - self.phi_s),z4z5,inf)
#print "I3: " + str(I3)
# sum up
res = I1[0]+I2[0]+I3[0]
res = res/self.E_0
return res
accelerator.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录