Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. program main
  2.  
  3. external one,two,three,four
  4.  
  5. integer :: n = 100
  6. real :: s1=0,s2=0,t1=0,t2=0,t3=0,t4=0,a=1,b=10 !ti - значения каждого интеграла
  7. real :: h=0
  8. real :: r(100)=0,theta(100)=0
  9. real :: phi(100,100)=0
  10. h=(b-a)/n
  11. s1=2./3. !cos(x)**2*sin(x) от нуля до пи
  12. s2=-8./15. !(1-3*cos(x)**2)*cos(x)**2*sin(x) от нуля до пи
  13. theta(1)=0
  14. theta(2)=acos(-1.0)/6.0
  15. theta(3)=acos(-1.0)/4.0
  16. theta(4)=acos(-1.0)/3.0
  17. theta(5)=acos(-1.0)/2.0
  18. theta(6)=acos(-1.0)
  19.  
  20. open(11,file='phi.txt')
  21. do i=1,n !сетка
  22. r(i)=i*h
  23. end do
  24.  
  25. do j=1,6 !для каждого угла
  26. do i=1,n
  27. call QG10(0,r(i),one,t1)
  28. call QG10(0, 1/r(i), two, t2)
  29. !call GL5(r(i),two,t2)
  30. !call GL5(r(i),four,t4)
  31. call QG10(0,r(i),three,t3)
  32. call QG10(0, 1/r(i), four, t4)
  33. phi(i,j)=2*acos(-1.0)*(s1*(t1/r(i)+t2)+(1-3*cos(theta(j))**2)*s2*(t3/r(i)**3+t4*r(i)**2)/4)
  34. end do
  35. end do
  36. do i=1,n
  37. write(11,*) r(i),phi(i,1),phi(i,2),phi(i,3),phi(i,4),phi(i,5),phi(i,6)
  38. end do
  39. write(*,*) t4
  40. close(11)
  41. end
  42.  
  43. real function coeff(x)
  44. coeff=14440.0*x/(x**6-36*x**5+450*x**4-2400*x**3+5400*x**2-4320*x+720)**2
  45. end function
  46.  
  47. subroutine GL5(r,f,s)
  48. real::x1=0.263560,x2=1.41340,x3=3.59643,x4=7.08581,x5=12.6408
  49. s=exp(-r)*(f(x1+r)*coeff(x1)+f(x2+r)*coeff(x2)+f(x3+r)*coeff(x3)+f(x4+r)*coeff(x4)+f(x5+r)*coeff(x5))
  50. end subroutine
  51.  
  52. real function one(r)
  53. one=exp(-r)*r**2
  54. end function
  55.  
  56. real function two(r)
  57. two=exp(-1./r)/r
  58. end function
  59.  
  60. real function three(r)
  61. three=exp(-r)*r**4
  62. end function
  63.  
  64. real function four(r)
  65. four=exp(-1./r)/r**3
  66. end function
  67.  
  68. !real function two(r)
  69. ! two=r
  70. !end function
  71.  
  72. !real function four(r)
  73. ! four=1.0/r
  74. !end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement