create_derivative_map: Create a mapping from function values to the first derivative

View source: R/map_derivative.R

create_derivative_mapR Documentation

Create a mapping from function values to the first derivative

Description

Create a mapping from a discretized version of a function with values given on an x-mesh to the first derivatives for a subset of the x-values of the source mesh.

Usage

create_derivative_map()

Details

The following fields are required in the parameter list to initialize the mapping:

mapname Name of the mapping
maptype Must be "derivative_map"
src_idx Vector of source indices
tar_idx Vector of target indices.
src_x Vector of x-values of the source mesh
tar_x Vector of x-values of the target mesh. Must be a subset of the x-values of the source mesh and must not include the largest x-value of the source mesh.
\loadmathjax

Let \mjseqnx_i denote the x-values of the mesh and \mjseqny_i the associated y-vales of the function. A finite-difference approximation of the first derivative is given by \mjsdeqn \Delta_i = \frac\vecy_i+1 - \vecy_i\vecx_i+1-\vecx_i

Value

Returns a list of functions to operate with the mapping, see create_maptype_map.

See Also

Other mappings: create_compound_map(), create_convolution_with_xtrafo_map(), create_derivative2nd_map(), create_linearinterpol_map(), create_linearinterpol_with_xtrafo_map(), create_linearmap_map(), create_maptype_map(), create_map(), create_nonlinear_map(), create_normerr_map(), create_product_map()

Examples

params <- list(
  mapname = "myderivmap",
  maptype = "derivative_map",
  src_idx = 1:4,
  tar_idx = 5:6,
  src_x = 1:4,
  tar_x = 2:3
)
mymap <- create_derivative_map()
mymap$setup(params)
x <- c(1,2,4,7,0,0)
mymap$propagate(x)
mymap$jacobian(x)


gschnabel/nucdataBaynet documentation built on Feb. 3, 2023, 4:13 a.m.