Module functions of Derivative Operater for NArray.
-
Derivate of z
with respect to dim
th dim using a 2nd
order 3-point differentiation valid for non-uniform grid:
(s**2*z_{i+1} + (t**2 - s**2)*f_{i} - t**2*f_{i-1}) / (s*t*(s + t))
Here, s represents (x_{i} - x_{i-1}) ,t represents (x_{i+1} - x_{i})
and _{i} represents the suffix of {i} th element in the dim th
dimension of the array. ).
ARGUMENTS
- z (NArray): a NArray which you want to derivative.
- x (NArray): a NArray represents the dimension which derivative respect to.
z.rank must be 1.
- dim (Numeric): a Numeric represents the dimention which derivative respect to.
you can give number count backward (dim<0), but z.rank ��dim must be > 0.
- bc (Numeric) : a Numeric to represent boundary condition.
Supported conditions are expressed in terms of boundary extension
applied before differentiation:
- LINEAR_EXT(=1): default value. linear extension using two
grid points at the boundaries.
- CYCLIC_EXT(=2): cyclic extension as k,0,1,..,k,0 for indices 0,1,..,k
- MIRROR_A(=3): for indices 0,1,..,k, extends as 0,0,1,..,k,k
(good for cell interior values with the Neumann condition)
- MIRROR_B(=4): for indices 0,1,..,k, extends as 1,0,1,..,k,k-1
(good for cell boundary values with the Neumann condition)
RETURN VALUE
- O2nd_deriv_data (NArray): (s**2*z_{i+1} + (t**2 - s**2)*f_{i} - t**2*f_{i-1}) / (s*t*(s + t))
-
Derivate of z
with respect to dim
th dim using centeral
differenciation: (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1})
ARGUMENTS
- z (NArray): a NArray which you want to derivative.
- x (NArray): a NArray represents the dimension which derivative respect
to. z.rank must be 1.
- dim (Numeric): a Numeric represents the dimention which derivative
respect to. you can give number count backward (dim<0), but
z.rank ��dim must be > 0.
- bc (Numeric) : a Numeric to represent boundary condition.
See threepoint_O2nd_deriv for supported conditions.
RETURN VALUE
- cderiv_data (NArray): (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1})
-
2nd Derivate of z
with respect to dim
-th dim
covering non-uniform grids. Based on:
( (z_{i+1}-z_{i})/(x_{i+1}-x_{i}) - (z_{i}-z_{i-1})/(x_{i}-x_{i-1}) )
/ ((x_{i+1}-x_{i-1})/2)
ARGUMENTS
- z (NArray): a NArray which you want to derivative.
- x (NArray): a NArray represents the dimension which derivative respect
to. z.rank must be 1.
- dim (Numeric): a Numeric represents the dimention which derivative
respect to. you can give number count backward (dim<0), but
z.rank ��dim must be > 0.
- bc (Numeric) : a Numeric to represent boundary condition.
See threepoint_O2nd_deriv for supported conditions.
RETURN VALUE
- cderiv_data (NArray): (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1})
-
expand boundary with linear value. extend array with 1 grid at each
boundary with dim th dimension, and assign th value which diffrential
value between a grid short of boundary and boundary grid in original array.
(on other wards, 2*z_{0}-z_{1} or 2*z_{n-1}-z_{n-2}: now _{i} represents the
suffix of {i} th element in the ((<dim>)) th dimension of array. ).
ARGUMENTS
- z (NArray): a NArray which you want to expand boundary.
- dim (Numeric): a Numeric represents the dimention which derivative
respect to. you can give number count backward (dim<0), but
z.rank ��dim must be > 0.
RETURN VALUE
-
Diffrence operater. return an NArray which a difference x
( in other wards, (x_{i+1} - x_{i-1}): now _{i} represents the suffix of
{i} th element in the dim th dimension of array. ).
ARGUMENTS
- x (NArray): a NArray which you want to get difference.
- dim (Numeric): a Numeric representing the dimention which derivative
respect to. you can give number count backward (dim<0), but
z.rank ��dim must be > 0.
RETURN VALUE
- cdiff_data (NArray): (x_{i+1} - x_{i-1})