extrapolation_integration

Integration using the extrapolation method as an array reduction operation

https://github.com/irukoa/extrapolation_integration

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Integration using the extrapolation method as an array reduction operation

Basic Info
  • Host: GitHub
  • Owner: irukoa
  • License: gpl-3.0
  • Language: Fortran
  • Default Branch: main
  • Size: 28.3 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created about 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

Language DOI Testing suite

Extrapolation Integration

This is a tiny modern Fortran library to implement the Richardson extrapolation method for integration. For more information, see Ref. [1].

API

The library adds the extrapolation(array) array reduction function. This is used as fortran result = extrapolation(array) where the type of array(:) is any of real(sp), complex(sp), real(dp) or complex(dp) and result is an scalar of the corresponding type.

If array(:), of size $N$, holds a sampling of $f(x)$ in the range $x\in[a, b]$ discretized according to array(i) $=f(x_i)$, where

$$ x_i = a + (b-a) \frac{i-1}{N-1}, $$

then, on output, result represents the unnormalized integral of $f(x)$, i.e.,

$$ \frac{1}{b - a}\int_{a}^{b}f(x)dx. $$

Three cases are distinguished, - $N$ can be expressed as $2^M + 1$ for some $M\in\mathbb{N}$: the extrapolation method is employed, and the expected accuracy is $\mathcal{O}(h^{2M})$, where $h = (b-a)/2$. - $N$ cannot be expressed as $2^M + 1$: the trapezoidal rule is employed and the expected accuracy is $\mathcal{O}(h^{2})$, where $h = (b-a)/(N-1)$. - $N = 1$: no integration and result = array(1).

Interface

fortran function extrapolation(array) ${type}$, intent(in) :: array(:) ${type}$ :: extrapolation end function extrapolation

Working principle

The extrapolation method computes an approximation to

$$ \frac{1}{b - a}\int_{a}^{b}f(x)dx, $$

by employing relatively inaccurate trapezoidal rule approximations. The method works by averaging these approximations such that error elimination is achieved iteratively [1]. This requires, that for a final result accurate up to $\mathcal{O}(h^{2M})$, $M$ trapezoidal rule approximations be computed, each with step size $h_i = (b-a)/2^i$.

The implementation takes advantage of the fact that if the number of sampling points can be expressed as $2^M+1$, then, only a single sampling of $f(x)$ with step size $h_M = (b-a)/2^M$ is required to compute all $M$ trapezoidal rule approximations. The library reorders the data of the discretization of $f(x)$ and computes iteratively an extrapolation reduction.

Build

An automated build is available for Fortran Package Manager users. This is the recommended way to build and use extrapolation integration in your projects. You can add extrapolation integration to your project dependencies by including

[dependencies] Extrapolation_Integration = { git="https://github.com/irukoa/Extrapolation_Integration.git" } in the fpm.toml file.

[1] R. L. Burden y J. D. Faires, Numerical analysis, 9. ed., International ed. Belmont, Calif.: Brooks/Cole, 2011, pp. 213-220.

Owner

  • Name: Álvaro R. Puente-Uriona
  • Login: irukoa
  • Kind: user
  • Location: Donostia
  • Company: CFM/MPC-UPV/EHU

PhD Student in Solid State Physics, check my CV at https://irukoa.github.io/

Citation (CITATION.cff)

cff-version: 1.2.0
title: Extrapolation Integration
message: Integration using the extrapolation method as an array reduction operation.
type: software
authors:
  - given-names: Álvaro
    family-names: R. Puente-Uriona
    email: alvaro.ruiz@ehu.eus
    affiliation: UPV/EHU
    orcid: 'https://orcid.org/0000-0003-1915-8804'
identifiers:
  - type: doi
    value: 10.5281/zenodo.10675749
    description: Zenodo
repository-code: 'https://github.com/irukoa/Extrapolation_Integration'
url: 'https://github.com/irukoa/Extrapolation_Integration'
abstract: >-
  Extrapolation Integration. A Fortran library with
  utilities to compute the Richardson extrapolation
  integral of an array.
keywords:
  - Fortran
  - Numerical Analysis
  - Numerical integration methods
license: GPL-3.0

GitHub Events

Total
Last Year