- #1
Daniel1992
- 22
- 0
I am trying to program Simpson's Rule in Fortran
I=(1/3)*h*(y0 + 4*y1 + 2*y2 + 4*y3 + 2*y4 + ... 2*yn-2 + 4*yn-1 + yn)
n=100 (number of strips)
I have generated the y values but I don't know how to get Fortran to follow the pattern in the brackets after h to add up the y values.
Any help would be appreciated.
I=(1/3)*h*(y0 + 4*y1 + 2*y2 + 4*y3 + 2*y4 + ... 2*yn-2 + 4*yn-1 + yn)
n=100 (number of strips)
I have generated the y values but I don't know how to get Fortran to follow the pattern in the brackets after h to add up the y values.
Any help would be appreciated.