
Analytic tools: Laplace transform and inversion, Laurent coefficients, Walsh-Hadamard, polynomials, heat equation
Source:R/AnalyticTools.R
LaplaceTransformNum.RdLaplaceTransformNum: int_0^inf f(t) exp(-s t) dt by the
exp-sinh double-exponential rule. TalbotInverse: fixed Talbot
inversion (Abate and Valko 2004), F must accept complex arguments.
StehfestInverse: Gaver-Stehfest inversion with weights V_k.
LaurentCoefficients: a_k by the trapezoidal Cauchy integral on
the circle |z - c| = radius. HadamardTransform and
HadamardInverse: orthonormal fast Walsh-Hadamard transform (its own
inverse). PolyExpand: product of polynomial powers (ascending
coefficients). PolyFactorModP: Cantor-Zassenhaus factorisation over
GF(p) for an odd prime p < 2^26 (square-free, distinct-degree and
equal-degree steps, Philox random splitting). RationalCancel: lowest
terms of an integer rational function by the primitive pseudo-remainder gcd.
HeatEquationSeries: separation of variables for u_t = alpha u_xx
with zero boundaries and Simpson Fourier-sine coefficients.
QuadraticRoots: cancellation-free roots. FunctionalNorm:
trapezoidal L2 norm and scaled function.
Usage
LaplaceTransformNum(f, s, h = 1/128)
TalbotInverse(F, t, M = 24)
StehfestInverse(F, t, N = 16)
LaurentCoefficients(f, c, orders, radius = 1, n = 256)
HadamardTransform(x)
HadamardInverse(y)
PolyExpand(factors, powers = NULL)
PolyFactorModP(coeffs, p, seed = 0)
RationalCancel(num, den)
HeatEquationSeries(f, length, alpha, x, t, n_terms = 50, n_quad = 1000)
QuadraticRoots(a, b, c)
FunctionalNorm(t, f)Arguments
- f
A function (of real, or complex for
LaurentCoefficients, argument).- s
Laplace variable(s), real and positive.
- h
Double-exponential step.
- F
Laplace-domain function.
- t
Time point(s), or the grid for
FunctionalNorm.- M
Number of Talbot nodes.
- N
Number of Stehfest terms (even).
- c
Expansion centre (complex).
- orders
Integer orders of the coefficients.
- radius
Contour radius.
- n
Number of contour points.
- x
Numeric vector (length a power of two), or evaluation points.
- y
Transformed vector.
- factors
List of coefficient vectors.
- powers
Integer powers, or NULL for ones.
- coeffs
Ascending integer coefficients.
- p
Odd prime.
- seed
Philox seed for the random splitting.
- num, den
Integer numerator and denominator coefficients.
- length
Rod length.
- alpha
Diffusivity.
- n_terms
Number of modes.
- n_quad
Simpson panels.
- a, b
Quadratic coefficients (with
c).
References
Takahasi, H. and Mori, M. (1974). Publ. RIMS 9, 721-741. Abate, J. and Valko, P. P. (2004). Int. J. Numer. Meth. Engng 60, 979-993. Stehfest, H. (1970). Comm. ACM 13, 47-49. Trefethen, L. N. and Weideman, J. A. C. (2014). SIAM Review 56, 385-458. Pratt, W. K. et al. (1969). Proc. IEEE 57, 58-68. Cantor, D. G. and Zassenhaus, H. (1981). Math. Comp. 36, 587-592. Cohen, H. (1996). A Course in Computational Algebraic Number Theory. Collins, G. E. (1967). J. ACM 14, 128-142. Haberman, R. (2013). Applied Partial Differential Equations. Press, W. H. et al. (2007). Numerical Recipes, 3rd ed. Ramsay, J. O. and Silverman, B. W. (2005). Functional Data Analysis.
Examples
TalbotInverse(function(s) 1 / (s + 1), 1)
#> [1] 0.3678794
PolyFactorModP(c(-1, 0, 0, 1), 7)$factors
#> [[1]]
#> [1] 3 1
#>
#> [[2]]
#> [1] 5 1
#>
#> [[3]]
#> [1] 6 1
#>
QuadraticRoots(1, -3, 2)$real
#> [1] 2 1