deltaV: Approximate potential difference between two points

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/deltaV.R

Description

Approximate potential difference between two points

Usage

1
deltaV(f, x, x0, normType = "f")

Arguments

f

Flow equations (right hand side of differential equation)

x

Position where we want to know the approximate potential

x0

Reference position (center of the Taylor expansion)

normType

(default: 'f') Matrix norm used to compute the error

Value

A list containing the approximate potential difference between x and x0 and the estimated error

Author(s)

Pablo Rodríguez-Sánchez (https://pabrod.github.io)

References

https://arxiv.org/abs/1903.05615

See Also

approxPot1D, approxPot2D, norm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)

PabRod/consRvative documentation built on Jan. 3, 2021, 1:48 p.m.