View source: R/map_derivative.R
create_derivative_map | R Documentation |
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.
create_derivative_map()
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. |
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
Returns a list of functions to operate with the mapping, see create_maptype_map
.
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()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.