GithubHelp home page GithubHelp logo

knut0815 / fakequadrature Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pog87/fakequadrature

0.0 0.0 0.0 418 KB

Quadrature under Fake Nodes

License: MIT License

Python 0.61% Jupyter Notebook 99.39%

fakequadrature's Introduction

FakeQuadrature

FOSS Python software related to the Fake Nodes approach for getting a more stable quadrature without computing new samples.

Authors: S. De Marchi, G. Elefante, E. Perracchione, D. Poggiali, Università di Padova.

Quote this work

To use this work in any scientific report or publication, please cite:

  • S. De Marchi, G. Elefante, E. Perracchione, D. Poggiali, Quadrature at fake nodes link, preprint.
  • S. De Marchi, F. Marchetti, E. Perracchione, D. Poggiali, Polynomial interpolation via mapped bases without resampling link, J. Comput. Appl. Math., 364 (2020), 112347--12.
  • J.P. Berrut, S. De Marchi, G. Elefante, F. Marchetti, Treating the Gibbs phenomenon in barycentric rational interpolation via the S-Gibbs algorithm, to appear on Appl. Math. Letters. 2019.

img

How to use this software

Clone this repo in your folder and import it

import numpy as np
from fakequadrature import quadrature_weights

then define the function you want to integrate, the mapping function S and the nodes of quadrature, for instance

from scipy.special import erf
f = lambda x: erf( x )
S = lambda x: -2 * np.cos( np.pi* (x+2)/2 )
x = np.linspace( -2, 2, 20 )

so you can now compute the integral of f(x) in the interval [-2,2] with S-FakeNodes

weights = quadrature_weights( x, (-2,2), mapping = S )
Integral = np.dot( f(x) , weights ) 

if you want to compute the approximate integral the usual way, it is sufficient not to specify a mapping S.

Fake Nodes for quadrature

This software extends the fake nodes approach to quadrature formula for mitigating both Runge and Gibbs phenomena when computing the quadrature wheigts.

img

Quadrature under Fake Nodes mitigate the Runge and Gibbs effect.

fakequadrature's People

Contributors

pog87 avatar emmaa89 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.