module NumRu::Derivative in derivative.rb

todo

Index

module NumRu::Derivative

Module functions of Derivative Operater for NArray.

threepoint_O2nd_deriv(z, x, dim, bc=LINEAR_EXT)

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

RETURN VALUE

cderiv(z, x, dim, bc=LINEAR_EXT)

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

RETURN VALUE

deriv2nd(z, x, dim, bc=LINEAR_EXT)

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

RETURN VALUE

b_expand_linear_ext(z, dim)

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

RETURN VALUE

cdiff(x, dim)

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

RETURN VALUE