Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. program shri
  2.  
  3. real(8) :: Y1(2) = 0d0,Y2(2) = 0d0, Eleft = 0d0,Eright = 0d0,E(20) = 0d0,Esearch = 0d0
  4. real(8) :: step = 0d0,acc = 1.d-5,h = 0d0,hmin = 1.d-10,xn = 0d0,xnd = 0d0,first = 0d0
  5. real(8) :: second = 0d0,third = 0d0,coeff = 0d0,u0 = 0d0,psi(201) = 0d0,norma = 0d0,x0 = 0d0
  6. real(8) :: slandau = 0d0, eps = 0d0,elandau(20) = 0d0
  7. integer :: j = 1,amount=999
  8. common /block/ Esearch, U0,coeff
  9. external pot
  10.  
  11. coeff = 4.205208417d0
  12.  
  13. !------
  14. U0=1.0d0
  15. !------
  16.  
  17. step = U0 / 1.d3
  18. slandau = 1.d0/2.d0*(-1.d0+dsqrt(1.d0+coeff*4.d0*U0))
  19.  
  20. !подсчет из Ландау-----------
  21.  
  22. do while(eps.le.slandau)
  23. elandau(j) = -(1.d0/(4.d0*coeff))*(-(1.d0+2.d0*(eps))+dsqrt(1.d0+coeff*4.d0*U0))**2
  24. eps = eps + 1.
  25. j=j+1
  26. end do
  27. write(*,*)
  28. j=1
  29. !------------------------
  30.  
  31. do i=1,amount
  32.  
  33. Eleft=-u0+step*(i-1)
  34. Eright=-u0+step *i
  35.  
  36. xnd=0.d0
  37.  
  38. Esearch=Eleft
  39. xn=-200.d0
  40. Y1(1)=dexp(dsqrt(-coeff*Esearch)*xn)
  41. Y1(2)=Y1(1)*dsqrt(-coeff*Esearch)
  42. h=0.001d0
  43. call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  44. xn=200.d0
  45. h=-0.0001d0
  46. Y2(1)=dexp(-dsqrt(-coeff*Esearch)*xn)
  47. Y2(2)=-Y2(1)*dsqrt(-coeff*Esearch)
  48. call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  49. first=y1(2)/y1(1)-y2(2)/y2(1)
  50. Esearch=Eright
  51. xn=-100.d0
  52. Y1(1)=dexp(dsqrt(-coeff*Esearch)*xn)
  53. Y1(2)=Y1(1)*dsqrt(-coeff*Esearch)
  54. h=0.001d0
  55. call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  56. xn=200.d0
  57. h=-0.0001d0
  58. Y2(1)=dexp(-dsqrt(-coeff*Esearch)*xn)
  59. Y2(2)=-Y2(1)*dsqrt(-coeff*Esearch)
  60. call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  61. second=y1(2)/y1(1)-y2(2)/y2(1)
  62. if((first*second)<0) then
  63. do while(dabs(Eleft-Eright)>1.d-5)
  64. Esearch=(Eleft+Eright)/2
  65. E(j)=Esearch
  66. xn=-200.d0
  67. Y1(1)=dexp(dsqrt(-coeff*Esearch)*xn)
  68. Y1(2)=Y1(1)*dsqrt(-coeff*Esearch)
  69. h=0.1d-5
  70. call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  71. xn=200.d0
  72. h=-0.1d-5
  73. Y2(1)=dexp(-dsqrt(-coeff*Esearch)*xn)
  74. Y2(2)=-Y2(1)*dsqrt(-coeff*Esearch)
  75. call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  76. third=y1(2)/y1(1)-y2(2)/y2(1)
  77. if((first*third)<0) then
  78. Eleft=Esearch
  79. else
  80. Eright=Esearch
  81. end if
  82. end do
  83. j=j+1
  84. else
  85. continue
  86. end if
  87. end do
  88.  
  89. write(*,*) 'Energy'
  90. write(*,*) 'Prog Theor'
  91. do i=1,j-1
  92. write(*,*) E(i), elandau(i), E(i)-elandau(i)
  93. end do
  94. write(*,*) 'levels: ', j-1
  95.  
  96. open(12, file = 'd1.txt')
  97. Esearch=E(1)
  98. x0=-100.d0
  99. Y1(1)=dexp(dsqrt(-coeff*Esearch)*x0)
  100. Y1(2)=Y1(1)*dsqrt(-coeff*Esearch)
  101. step =0.1d0
  102. h=0.0001d0
  103. xn=-100.d0
  104. xnd=-10.d0
  105. call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  106. x0=-10.d0
  107. acc=1.d-7
  108. do i=1,100
  109. Y2(1)=Y1(1)
  110. Y2(2)=Y1(2)
  111. xnd=-10.d0+step * i
  112. xn=x0
  113. call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  114. psi(i)=Y2(1)
  115. end do
  116. x0=100.d0
  117. Y1(1)=dexp(-dsqrt(-coeff*Esearch)*x0)
  118. Y1(2)=-Y1(1)*dsqrt(-coeff*Esearch)
  119. s=0.1d0
  120. h=-0.0001d0
  121. xn=100.d0
  122. xnd=10.d0
  123. call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  124. x0=10.d0
  125. acc=1.d-7
  126. do i=1,100
  127. Y2(1)=Y1(1)
  128. Y2(2)=Y1(2)
  129. xnd=10.d0-step *i
  130. xn=x0
  131. call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  132. psi(201-i)=Y2(1)
  133. end do
  134.  
  135. !norma=0.d0
  136. !do i=1,67
  137. ! norma=norma+step /3*((psi(3*(i-1)+1))**2+4*(psi(3*(i-1)+2))**2+(psi(3*(i-1)+3))**2)
  138. !end do
  139. !norma=dsqrt(norma)
  140. do i=1,201
  141. write(12,*) -10.d0+step*i, psi(i) !psi(i)/norma
  142. end do
  143.  
  144. !--------------------------------------
  145.  
  146. !open(13, file = 'd2.txt')
  147. !Esearch=E(2)
  148. !x0=-100.d0
  149. !Y1(1)=dexp(dsqrt(-coeff*Esearch)*x0)
  150. !Y1(2)=Y1(1)*dsqrt(-coeff*Esearch)
  151. !step =0.1d0
  152. !h=0.0001d0
  153. !xn=-100.d0
  154. !xnd=-10.d0
  155. !call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  156. !x0=-10.d0
  157. !acc=1.d-7
  158. !do i=1,100
  159. ! Y2(1)=Y1(1)
  160. ! Y2(2)=Y1(2)
  161. ! xnd=-10.d0+step *i
  162. ! xn=x0
  163. ! call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  164. ! psi(i)=Y2(1)
  165. !end do
  166. !x0=100.d0
  167. !Y1(1)=dexp(-dsqrt(-coeff*Esearch)*x0)
  168. !Y1(2)=-Y1(1)*dsqrt(-coeff*Esearch)
  169. !step =0.1d0
  170. !h=-0.0001d0
  171. !xn=100.d0
  172. !xnd=10.d0
  173. !call merson(xn,xnd,acc,h,hmin,2,Y1,pot)
  174. !x0=10.d0
  175. !acc=1.d-7
  176. !do i=1,100
  177. ! Y2(1)=Y1(1)
  178. ! Y2(2)=Y1(2)
  179. ! xnd=10.d0-s*i
  180. ! xn=x0
  181. ! call merson(xn,xnd,acc,h,hmin,2,Y2,pot)
  182. ! psi(201-i)=Y2(1)
  183. !end do
  184.  
  185. !norma=0.d0
  186. !do i=1,67
  187. ! norma=norma+step /3*((psi(3*(i-1)+1))**2+4*(psi(3*(i-1)+2))**2+(psi(3*(i-1)+3))**2)
  188. !end do
  189. !norma=dsqrt(norma)
  190. !do i=1,201
  191. ! write(13,*) -10.d0+step *i, psi(i)/norma
  192. !end do
  193.  
  194. end
  195.  
  196. !для Мерсона в потенциале ch**2---------
  197. subroutine pot(x, y, dy)
  198. real(8) :: x, y(2), dy(2), U0, Esearch, coeff
  199. common /block/ Esearch, U0,coeff
  200. dy(1)=y(2)
  201. dy(2)=-coeff*(Esearch+U0/(dcosh(x))**2)*y(1)
  202. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement