Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : olexandr543@yahoo.com
A library for working with periodic polynomials (very basic functionality). Provides also simple tools to make a numerical function a periodic (or somewhat similar) one.
Synopsis
- polyG1 :: Floating a => (a -> a) -> (a -> a) -> Vector a -> a -> a
- trigPolyCos :: Floating a => (a -> a) -> Vector a -> a -> a
- trigPolySin :: Floating a => (a -> a) -> Vector a -> a -> a
- trigPoly :: Floating a => (a -> a) -> Vector a -> (a -> a) -> Vector a -> a -> a
- periodizer :: RealFrac a => (a -> b) -> a -> a -> a -> b
- concatPeriodizer :: (RealFrac a, Num b) => (a -> b) -> a -> a -> a -> b
- polyG2 :: RealFrac a => (a -> a) -> (a -> a) -> a -> a -> Vector a -> a -> a
- polyG3 :: RealFrac a => (a -> a) -> (a -> a) -> a -> a -> Vector a -> a -> a
The simplest finite periodic polynomials
polyG1 :: Floating a => (a -> a) -> (a -> a) -> Vector a -> a -> a Source #
The first function f :: a -> a
is applied to the vector to produce weighted coefficients for the sum and the second one g :: a -> a
is used as a basis
function. For the periodic function g the resulting function is also periodic with the same period. Among possible variants there are finite trigonometric
polynomials. See as examples trigPolySin
and trigPolyCos
functions.
trigPolyCos :: Floating a => (a -> a) -> Vector a -> a -> a Source #
A finite trigonometric polynomial of cosines. The Vector
argument is used to produce its coefficients (weights) by applying to each of the element the function
f:: a -> a
given as the first argument.
trigPolySin :: Floating a => (a -> a) -> Vector a -> a -> a Source #
A finite trigonometric polynomial of sines. The Vector
argument is used to produce its coefficients (weights) by applying to each of the element the function
f:: a -> a
given as the first argument.
trigPoly :: Floating a => (a -> a) -> Vector a -> (a -> a) -> Vector a -> a -> a Source #
Sum of the sine and cosine finite trigonometric polynomials. Can represent Fourier series (without the first coefficient), but no numerical high accuracy is guaranteed.
Periodizer functions
periodizer :: RealFrac a => (a -> b) -> a -> a -> a -> b Source #
Makes a function f :: a -> b
periodic with the period given by the third argument and the starting point given by the second argument.
concatPeriodizer :: (RealFrac a, Num b) => (a -> b) -> a -> a -> a -> b Source #
Modified periodizer that tries to concat the pieces of the function so that it can be (generally speaking) continuous. Needs more mathematical studies.