Hello, for my FORTRAN class it wants me to use the method of Riemann's sums to find the area under the curve for the function f(x) = -(x-3)**2 +9, and stop when successive iterations yield a change of less than 0.0000001. I know im going to have to used double precision. Im just confused on how to set it up. This is what I am thinking...(adsbygoogle = window.adsbygoogle || []).push({});

Im going to need a loop from 1 to count, then my deltaX will be upperbound-lowerbound/count.

Then Inside that do loop im going to need another one that does from 1 to 6 by iterations of deltaX. Then I am going to need to compute the Area(where I am stumped). After that I am going to want to say if the area after minus the area before is greater then 0.0000001 then count=count + 1. So far this is what my do loops look like. Im just wondering if i am headed in the correct direction of not? Can anyone help me please?!?!

DO I=1,COUNT,1

deltaX = (upperBOUND-lowerBOUND)/COUNT

DO J = 0,6,deltaX

F_X=-(J-3)**2 + 9

ENDDO

ENDDO

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Riemann Sum

Loading...

Similar Threads - Fortran Riemann | Date |
---|---|

How to buy Fortran Programming Software Commersial License | Jan 30, 2018 |

Fortran for Computational Fluid Dynamics Problems | Jan 11, 2018 |

Porting Python Code to Fortran for Parallel Computing | Dec 15, 2017 |

Riemann Sum with Fortran 90 | Apr 20, 2008 |

**Physics Forums - The Fusion of Science and Community**