figshare
Browse
Python software for calculating area under a curve.py (1.11 kB)

Python software for calculating the area under a curve

Download (1.11 kB)
software
posted on 2019-12-06, 05:01 authored by Wenfa NgWenfa Ng
Area under the curve represents the summation of a function over an interval, and is of interest in a variety of applications. Typically, the Trapezium rule is used for estimating the area under the curve. Such computations could be automated, and this contribution describes a Python software designed to calculate the area under the curve of y = x2. The function first reads in the lower and upper integration bounds as well as the number of intervals for integration. It subsequently calculates the integration step size to help implement the Trapezium rule for obtaining the area under the curve. Modularity in the software code ensures that the Python software can be readily adapted to calculate the area under the curve for other mathematical functions.

Funding

No funding was used in this work.

History

Usage metrics

    Licence

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC