scarlleette
Technical User
Hi. I need a help, i am beginner. My problem: Numerical integration of function F(x)= x**2.00, x=<5,8> , number of subintervals: 3000.
my program:
program num_int
!a,b=limits of integration
implicit none
real(kind=8),allocatable :: D,, E, , X)
real :: F,a,b,h
integer :: i,N
read*,N
allocate (D(N,1), E(N,1), X(N))
read*,(D(i,1),i=1,N)
read*,(E(i,1),i=1,N)
print*,"Limits of integration"
read*,a,b
print*,"Number of subintervals"
read*,N
call quad(a,b,h,N)
--------------------------------
subroutine quad(a,b,h,N)
implicit none
real :: h
integer :: N,a,b
h=(b-a)/N
end
-------------------------------
D(i,1)=a
X(i)=0.0d0
do i=0,N-1
X(i)=X(i)+(D(i,1)*E(i,1))**2.00
i am angry and lost. Thank you for everything.
my program:
program num_int
!a,b=limits of integration
implicit none
real(kind=8),allocatable :: D,, E, , X)
real :: F,a,b,h
integer :: i,N
read*,N
allocate (D(N,1), E(N,1), X(N))
read*,(D(i,1),i=1,N)
read*,(E(i,1),i=1,N)
print*,"Limits of integration"
read*,a,b
print*,"Number of subintervals"
read*,N
call quad(a,b,h,N)
--------------------------------
subroutine quad(a,b,h,N)
implicit none
real :: h
integer :: N,a,b
h=(b-a)/N
end
-------------------------------
D(i,1)=a
X(i)=0.0d0
do i=0,N-1
X(i)=X(i)+(D(i,1)*E(i,1))**2.00
i am angry and lost. Thank you for everything.