Login
Register
New Members

Earn Revenue

Help
Forum
Articles
Practice Tests
Ask Experts
Question Papers
Jobs
Universities
Colleges
Courses
Schools
Reviews

Learn English

Gift Shop

Social Hub

Training

New Posts

My India

Members

Post Content

Resources
»
Articles/Knowledge Sharing
»
Computer & Technology
understanding simpsons 1/3rd rule using Fortran for integration
Posted Date: 12Mar2008
Last Updated:
12Mar2008
Category:
Computer & Technology
Author:
ashish singh
Member Level:
Gold
Points
: 4
Numerical integration using simpsons 1/3rd rule
The general problem of Numerical Integration may be stated as follows. Given a set of data points (x0,y0),(x1,y1),(x2,y2)……….(xn,yn) of a function y=f(x), where f(x) is not known explicitly, it is required to compute the value of the definite integral.
Simpson`s 1/3 Rule is also used for solving Numerical Integration problem and it is also same as the Trepezoisdal Rule including some differences.
In Simpson`s 1/3 Rule the value of dependent variable i.e. y0,y1,y2….. yn which are actually the functional value of independent variablex0,x1,x2……..xn which are increases by h in every step.
After creating table of using following formula we can solve the given Numerical Integation problem.
I=(h*(y0+4(y1+y3+y5…………)+2*(y2+y4+y6……….)+yn))/3
The required condirion for this rule is n must be multiple of 3 where n is number of strips.
Fortran Program for Simpson`s 1/3Rule :
C PROGRAM FOR SIMPSON'S 1/3 RULE
FUNTION F(X)
F=1/(1+X)
RETURN
END
WRITE(*,*)'ENTER UPPER AND LOWER LIMIT'
READ(*,*)A,B
WRITE(*,*)'ENTER THE NUMBER OF INTERVALS'
READ(*,*)N
H=(BA)/N
SUM=F(A)+F(B)
D=4
DO 5 I=1,N1
X=A+I*H
SUM=SUM+D*F(X)
D=6D
5 CONTINUE
S=H/3*SUM
WRITE(*,*)'INTEGRAL=',S
END
Output
SIMPSON’S 1/3 RULE
D:\FORTRAN\BINB>FL SIMP13.FOR
Microsoft (R) FORTRAN Optimizing Compiler Version 5.10
Copyright (c) Microsoft Corp 19821991. All rights reserved.
SIMP13.FOR
Microsoft (R) SegmentedExecutable Linker Version 5.15
Copyright (C) Microsoft Corp 19841991. All rights reserved.
Object Modules [.OBJ]: SIMP13.OBJ
Run File [SIMP13.exe]: SIMP13.EXE
List File [NUL.MAP]: NUL
Libraries [.LIB]:
Definitions File [NUL.DEF]: ;
D:\FORTRAN\BINB>SIMP13
ENTER UPPER AND LOWER LIMIT
0
5
ENTER THE NUMBER OF INTERVALS
10
INTEGRAL= 1.793170
D:\FORTRAN\BINB>SIMP13
ENTER UPPER AND LOWER LIMIT
0
4
ENTER THE NUMBER OF INTERVALS
9
INTEGRAL= 1.579433
Did you like this resource? Share it with your friends and show your love!
Tweet
Responses to "understanding simpsons 1/3rd rule using Fortran for integration"
No responses found. Be the first to respond...
Feedbacks
Post Comment:
Notify me by email when others post comments to this article.
Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
No HTML formatting and links to other web sites are allowed.
This is a strictly moderated site. Absolutely no spam allowed.
Name:
Sign In
to fill automatically.
Email:
(Will not be published, but
required
to validate comment)
Type the numbers and letters shown on the left.
Submit Article
Return to
Article Index
Subscribe to Email
Get Jobs by Email
Forum posts by Email
Articles by Email
Awards & Gifts
Active Members
Today
R Pramod
(80)
K Mohan
(62)
Neha
(36)
Last 7 Days
R Pramod
(962)
K Mohan
(462)
Ashutosh
(401)
more...
Online Members
priya
Aryamolr
chetan
vamshi
premkumar
vibin
Qasim
Jebaprincy
md.danish
Nidhi
palash
More...