Fortran ~ Trapezoidal rule - Ishwaranand

News

Fortran ~ Trapezoidal rule

Fortran Trapezoidal rule

trapezoidal rule calculator,trapezoidal rule example problems pdf, trapezoidal rule simple definition, trapezoidal rule diagram, trapezoidal rule formula for volume, trapezoidal rule matlab, trapezoidal rule ppt, trapezoidal rule and simpson's rule, trapezoidal rule in surveying, trapezoidal rule mcq, trapezoidal rule area of irregular shape, trapezoidal shape, trapezoidal rule worksheet,
Image Source ~ Crafted With ©Ishwaranand - 2020 ~ Image by ©Ishwaranand

Q.  Write Program using Trapezoidal rule to Calculate the area under a curve...?

PROGRAM TRPRUL

C
C         PROGRAM TO DEMONSTRATE APPLICATION OF TRAPEZOIDAL RULE
C
C        THIS PROGRAM NUMERICALLY INTEGRATES GIVEN EXPRESSION WITHIN
C        SPECIFIED LIMITS OF INTEGRATION
C        AS INTEGRAL OF A FUNCTION IS EQUAL TO AREA UNDER THE CURVE
C        WE CAN ALSO USE THE PROGRAM TO CALCULATE AREA UNDER A CURVE
C
           F(X)=3.12*X**3+1.54*X**2-6.23
C
          WRITE(*,*)'LIMITS OF INTEGRATION(A,B)'
          READ(*,*)A,B
          WRITE(*,*)'NUMBER OF STRIPES'
          READ(*,*)NS
C       STRIP SIZE
          H=(B-A)/NS
          AREA=F(A)+F(B)
          DO 100 X=A+H,B-H,H
          AREA=AREA+2.0*F(X)
100    CONTINUE
          AREA=AREA*H/2.0
          WRITE(*,*)'AREA UNDER THE CURVE=',AREA
          STOP
          END

#OUTPUT
LIMIT OF INTEGRATION (A, B)
0 6
NUMBER OF STRIPS
6
AREA UNDER THE CURVE = 159.00000

No comments

Comment on Ishwaranand or Happy Day
Not, Add any types of links