CentralDiff

Documentation for CentralDiff.

CentralDiff.OrderType
Order{N}()
Order(N)

Represent the order of a numerical method. N is an integer constant specifying the order.

source
CentralDiff.dIType
dI{T<:AbstractAxis}(axis, stride)

Represent a displacement along a specific axis.

Examples

```jldoctest julia> CartesianIndex(1, 1) + dI(XAxis(), 2) CartesianIndex(3, 1)

julia> CartesianIndex(1, 1) + dI(YAxis(), 2) CartesianIndex(1, 3)

julia> CartesianIndex(1, 1, 1) + dI(ZAxis(), 3) CartesianIndex(1, 1, 4)

source
CentralDiff.TaylorMatrixMethod
TaylorMatrix(samples)

Construct a Taylor matrix from the given sample points. Returns a matrix where element (i,j) is i^j / j!.

Example

julia> A = TaylorMatrix(-3//2:3//2)
4×4 Matrix{Rational{Int64}}:
 1  -3//2  9//8  -9//16
 1  -1//2  1//8  -1//48
 1   1//2  1//8   1//48
 1   3//2  9//8   9//16

julia> iA = inv(A)
4×4 Matrix{Rational{Int64}}:
 -1//16   9//16   9//16  -1//16
  1//24  -9//8    9//8   -1//24
  1//2   -1//2   -1//2    1//2
  -1       3      -3       1
source
CentralDiff._generate_termsMethod
_generate_terms(C)

Generate expressions for finite difference or interpolation terms. Returns a vector of expressions based on coefficient vector C.

source
CentralDiff._shift_and_addMethod
_shift_and_add(C1, C2)

Compute the convolution of two coefficient vectors C1 and C2. Returns a vector of length 2N-1, where N is the length of C1 and C2.

source
CentralDiff.countorderMethod
countorder(f, hs...)

Compute convergence orders for a function over multiple grid spacings. Returns computed orders as a NamedTuple or vector.

source
CentralDiff.d2fdxMethod
d2fdx(order, F, dxi)
d2fdx(order, axis, F, I, dxi)

Compute second derivative of order N along axis at i.

source
CentralDiff.dfdxMethod
dfdx(order, F, dxi)
dfdx(order, axis, F, I, dxi)

Compute first derivative of order N along axis at i.

source
CentralDiff.dfdxcMethod
dfdxc(order, F, dxi)
dfdxc(order, axis, F, I, dxi)
dfdxc(order, axis, diff, F, I, dxi)

Compute first derivative of order N along axis at i+1/2 (default, forward) or i-1/2 (backward).

source
CentralDiff.fcMethod
fc(order, F)
fc(order, axis, F, I)
fc(order, axis, diff, F, I)

Compute interpolation of order N along axis at i+1/2 (default, forward) or i-1/2 (backward).

source
CentralDiff.Operators.f̄nMethod
f̄n(n, axis, F, I)
f̄n(n, axis, diff, F, I)

Compute centered average at i+1/2 (default, forward) or i-1/2 (backward) over n points along specified axis. f̄1, f̄3, f̄5, ..., f̄19 for specific n values available.

source
CentralDiff.Operators.δfδxnMethod
δfδxn(n, axis, F, I, dxi)
δfδxn(n, axis, diff, F, I, dxi)

Compute centered difference at i+1/2 (default, forward) or i-1/2 (backward) over n points along specified axis. δfδx1, δfδx3, δfδx5, ..., δfδx19 for specific n values available.

source