CentralDiff
Documentation for CentralDiff.
CentralDiff.AbstractAxisCentralDiff.OrderCentralDiff.dICentralDiff.Operators.f̄nCentralDiff.Operators.δfδxnCentralDiff.TaylorMatrixCentralDiff._generate_termsCentralDiff._shift_and_addCentralDiff.countorderCentralDiff.d2fdxCentralDiff.dfdxCentralDiff.dfdxcCentralDiff.fc
CentralDiff.AbstractAxis — TypeAbstractAxisAn abstract type representing an axis. It serves as the base type for XAxis, YAxis, and ZAxis.
CentralDiff.Order — TypeOrder{N}()
Order(N)Represent the order of a numerical method. N is an integer constant specifying the order.
CentralDiff.dI — TypedI{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)
CentralDiff.TaylorMatrix — MethodTaylorMatrix(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 1CentralDiff._generate_terms — Method_generate_terms(C)Generate expressions for finite difference or interpolation terms. Returns a vector of expressions based on coefficient vector C.
CentralDiff._shift_and_add — Method_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.
CentralDiff.countorder — Methodcountorder(f, hs...)Compute convergence orders for a function over multiple grid spacings. Returns computed orders as a NamedTuple or vector.
CentralDiff.d2fdx — Methodd2fdx(order, F, dxi)
d2fdx(order, axis, F, I, dxi)Compute second derivative of order N along axis at i.
CentralDiff.dfdx — Methoddfdx(order, F, dxi)
dfdx(order, axis, F, I, dxi)Compute first derivative of order N along axis at i.
CentralDiff.dfdxc — Methoddfdxc(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).
CentralDiff.fc — Methodfc(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).
CentralDiff.Operators.f̄n — Methodf̄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.
CentralDiff.Operators.δfδxn — Methodδ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.