• Stars
    star
    536
  • Rank 82,794 (Top 2 %)
  • Language
    Julia
  • License
    Other
  • Created over 11 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Julia package for function approximation

ApproxFun.jl

CI codecov deps version Aqua QA Join the chat at https://gitter.im/JuliaApproximation/ApproxFun.jl

ApproxFun is a package for approximating functions. It is in a similar vein to the Matlab package Chebfun and the Mathematica package RHPackage.

The ApproxFun Documentation contains detailed information, or read on for a brief overview of the package. The documentation contains examples of usage, such as solving ordinary and partial differential equations.

The ApproxFun Examples repo contains many examples of using this package, in Jupyter notebooks and Julia scripts. Note that this is independently maintained, so it might not always be in sync with the latest version of ApproxFun. We recommend checking the examples in the documentation first, as these will always be compatible with the latest version of the package.

Introduction

Approximating Functions

Take your two favourite functions on an interval and create approximations to them as simply as:

using LinearAlgebra, SpecialFunctions, Plots, ApproxFun
x = Fun(identity,0..10)
f = sin(x^2)
g = cos(x)

Evaluating f(.1) will return a high accuracy approximation to sin(0.01). All the algebraic manipulations of functions are supported and more. For example, we can add f and g^2 together and compute the roots and extrema:

h = f + g^2
r = roots(h)
rp = roots(h')

plot(h; label="f + g^2")
scatter!(r, h.(r); label="roots")
scatter!(rp, h.(rp); label="extrema")

Differentiation and integration

Notice from above that to find the extrema, we used ' overridden for the differentiate function. Several other Julia base functions are overridden for the purposes of calculus. We may check that the exponential is its own derivative, by evaluating the norm of the difference and checking that it is small:

f = Fun(exp, -1..1)
norm(f-f')  # 4.4391656415701095e-14

Similarly, cumsum defines an indefinite integration operator:

g = cumsum(f)
g = g + f(-1)
norm(f-g) # 3.4989733283850415e-15d

Algebraic and differential operations are also implemented where possible, and most of Julia's built-in functions (and special functions from SpecialFunctions.jl) are overridden to accept Funs:

x = Fun()
f = erf(x)
g = besselj(3,exp(f))
h = airyai(10asin(f)+2g)

Examples of Usage

Check the documentation for examples of usage.

References

J. L. Aurentz & R. M. Slevinsky (2019), On symmetrizing the ultraspherical spectral method for self-adjoint problems, arxiv:1903.08538

S. Olver & A. Townsend (2014), A practical framework for infinite-dimensional linear algebra, Proceedings of the 1st First Workshop for High Performance Technical Computing in Dynamic Languages, 57–62

A. Townsend & S. Olver (2014), The automatic solution of partial differential equations using a global spectral method, J. Comp. Phys., 299: 106–123

S. Olver & A. Townsend (2013), Fast inverse transform sampling in one and two dimensions, arXiv:1307.1223

S. Olver & A. Townsend (2013), A fast and well-conditioned spectral method, SIAM Review, 55:462–489

More Repositories

1

FastGaussQuadrature.jl

Julia package for Gaussian quadrature
Julia
298
star
2

FastTransforms.jl

πŸš€ Julia package for orthogonal polynomial transforms πŸ‚
Julia
265
star
3

DomainSets.jl

A Julia package for describing domains as continuous sets of elements
Julia
72
star
4

SingularIntegralEquations.jl

Julia package for solving singular integral equations
Julia
62
star
5

ClassicalOrthogonalPolynomials.jl

A Julia package for classical orthogonal polynomials and expansions
Julia
38
star
6

ContinuumArrays.jl

A package for representing quasi arrays with continuous indices
Julia
27
star
7

HarmonicOrthogonalPolynomials.jl

A Julia package for working with spherical harmonic expansions
Julia
24
star
8

ApproxFunExamples

Examples for using ApproFun.jl
Jupyter Notebook
24
star
9

FrameFun.jl

Exploring practical possibilities of approximating functions with frames rather than with a basis
Julia
23
star
10

SpectralMeasures.jl

Julia package for finding the spectral measure of structured self adjoint operators
Julia
22
star
11

DomainIntegrals.jl

A package for computing integrals over domains like they are defined in DomainSets.jl.
Julia
21
star
12

MultivariateOrthogonalPolynomials.jl

Supports approximating functions and solving differential equations on various higher dimensional domains such as disks and triangles
Julia
17
star
13

CompactBases.jl

Julia library for function approximation with compact basis functions
Julia
16
star
14

GenericFFT.jl

A package for computing the FFT with arbitrary floating point numbers
Julia
14
star
15

FastTransformsForwardDiff.jl

A Julia package to support forward-mode auto-differentiation for fast transforms
Julia
13
star
16

BasisFunctions.jl

A collection of methods for manipulating various well-known types of basis functions and recombining them into more general dictionaries
Julia
13
star
17

QuasiArrays.jl

A package for representing quasi-arrays
Julia
12
star
18

ApproxFunBase.jl

Core functionality of ApproxFun
Julia
12
star
19

OscillatoryIntegrals.jl

Calculate oscillatory integrals using Julia
Julia
10
star
20

SemiclassicalOrthogonalPolynomials.jl

A Julia repository for semiclassical orthogonal polynomials
Julia
7
star
21

OrthogonalPolynomialsQuasi.jl

A package for representing orthogonal polynomials as quasi arrays
Julia
7
star
22

ApproxFunFourier.jl

Support for Fourier-based spaces in ApproxFun
Julia
7
star
23

PiecewiseOrthogonalPolynomials.jl

A Julia package for piecewise spectral methods such as p-FEM
Julia
6
star
24

SingularIntegrals.jl

A Julia package for computing singular integrals
Julia
6
star
25

GridArrays.jl

GridArrays associates an array of grid points with a domain
Julia
5
star
26

CompositeTypes.jl

A common interface for composite types, which may consist of several components
Julia
4
star
27

SpectralTimeStepping.jl

Time-stepping methods with spectral bases in space
Julia
3
star
28

ApproxFunOrthogonalPolynomials.jl

Support for orthogonal polynomial-based spaces in ApproxFun
Julia
3
star
29

ApproxFunSingularities.jl

Support for spaces with singularities in ApproxFun
Julia
3
star
30

RatFun.jl

A package for working with functions expressible as a Fun divided by another Fun.
Julia
2
star
31

HierarchicalSingularIntegralEquations.jl

Solve singular integral equations using hierarchical methods
Julia
2
star
32

AlgebraicCurveOrthogonalPolynomials.jl

Mathematica
1
star
33

ChebyshevTransforms.jl

Julia
1
star
34

EquilibriumMeasures.jl

Calculate equilibrium measures from potentials
Julia
1
star
35

AnnuliOrthogonalPolynomials.jl

Julia
1
star