# NOT RUN {
# One dimensional flow
f <- function(x) { cos(x) }
# Evaluation points
x0 <- 1
x1 <- 1.02
dV <- deltaV(f, x1, x0)
# Two dimensional flow
f <- function(x) { c(
-2*x[1]*x[2],
-x[1]^2 - 1
)}
# Evaluation points
x0 <- matrix(c(1,2), ncol = 1)
x1 <- matrix(c(0.98,2.01), ncol = 1)
dV <- deltaV(f, x1, x0)
# }
Run the code above in your browser using DataLab