GithubHelp home page GithubHelp logo

tanderson92 / singularintegrals.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliaapproximation/singularintegrals.jl

0.0 0.0 0.0 69 KB

A Julia package for computing singular integrals

License: MIT License

Julia 100.00%

singularintegrals.jl's Introduction

SingularIntegrals.jl

A Julia package for computing singular integrals

Build Status codecov

This package supports computing singular integrals involving Hilbert/Stieltjes/Cauchy, log, and power law kernels.

Some examples:

julia> using SingularIntegrals, ClassicalOrthogonalPolynomials

julia> P = Legendre(); x = axes(P, 1); f = expand(P, exp); #  expand exp(x) in Legendre polynomials

julia> @time inv.(10 .- x') * f # Stieltjes: ∫₋₁¹ exp(x) / (10-x) dx
  0.000034 seconds (22 allocations: 2.266 KiB)
0.24332755428373515

julia> @time inv.(0.1+0im .- x') * f - inv.(0.1-0im .- x') * f  -2π*im*exp(0.1) # example of Plemelj
  0.000052 seconds (49 allocations: 6.031 KiB)
true

julia> @time abs.(10 .- x') .^ 0.2 * f # Power law: ∫₋₁¹ (10-x)^0.2 * exp(x) dx
  0.000077 seconds (21 allocations: 1.875 KiB)
3.7006631248289135

julia> @time abs.(0.3 .- x') .^ 0.2 * f # ∫₋₁¹ abs(0.3-x)^0.2 * exp(x) dx
  0.000040 seconds (25 allocations: 2.172 KiB)
1.9044201526740234

julia> W = Weighted(ChebyshevU()); f = expand(W, x -> exp(x) * sqrt(1-x^2));

julia> @time log.(abs.(10 .- x')) * f # Log-kernel: ∫₋₁¹ log(10-x) * exp(x) * sqrt(1-x^2) dx
  0.000040 seconds (14 allocations: 400 bytes)
4.043032838853287

julia> @time log.(abs.(0.3 .- x')) * f # ∫₋₁¹ log(abs(0.3-x)) * exp(x) * sqrt(1-x^2) dx
  0.000035 seconds (116 allocations: 6.250 KiB)
-2.320391559008445

singularintegrals.jl's People

Contributors

dlfivefifty avatar github-actions[bot] avatar navidcy avatar tsgut 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.