simulateRACVM: Rotational/Advective Correlated velocity movement

View source: R/simulateRACVM.R

simulateRACVMR Documentation

Rotational/Advective Correlated velocity movement

Description

Simulates 2D correlated velocity movement model with rotation and advection

Usage

simulateRACVM(
  tau = 1,
  eta = 1,
  omega = 0,
  mu = 0,
  v0 = NULL,
  Tmax = 100,
  dt = 0.01
)

Arguments

tau

characteristic time scale of autocorrelation

eta

random speed parameter. In the case where ω = 0, the mean square speed of movement is E(|V|^2) = η^2 + μ^2. In the case were μ = ω = 0, the mean tangential speed is E(|V|) = η √(π)/2.

omega

rotational velocity

mu

advective velocity (can be complex value where real and imaginary parts are x and y components of velocity)

v0

initial velocity

Tmax

max time

dt

time interval of simulation

Details

This function simulates a Rotational-Advective CVM explicitly using the governing OU equation, using a discretization in which dt << tau.

Value

a list with the following elements

T

the time vector

V

the (complex) vector of velocities

Z

the (complex) vector of locations

XY

a two-column matrix of x-y coordinates of locations

parameters

a named list of model parameters.

See Also

estimateRACVM

Examples

require(smoove)

racvm1 <- simulateRACVM(tau = 4, eta = 1, omega = 2, mu = 0, Tmax = 100, dt = .01)
racvm2 <- simulateRACVM(tau = 4, eta = 1, omega = 0, mu = 1, Tmax = 100, dt = .01)
racvm3 <- simulateRACVM(tau = 4, eta = 1, omega = 2, mu = 1, Tmax = 100, dt = .01)

layout(rbind(c(1,2),c(1,3)))
sapply(list(racvm1, racvm2, racvm3),
       function(x)
         with(x, plot(
           Z,
           asp = 1,
           type = "l",
           main = paste0("RACVM(",
                         paste(unlist(parameters),
                               collapse = ", "), ")")
         )))


racvm1 <- simulateRACVM(tau = 3, eta = 32, omega = .5, mu = 0, Tmax = 10, dt = .1)
with(racvm1, scan_track(x = Re(Z), y = Im(Z), time = T))


# Compare with simulateRACVM2

# racvm1b <- simulateRACVM2(tau = 4, eta = 1, omega = 2, mu = 0, Tmax = 100, dt = .01)
# racvm2b <- simulateRACVM2(tau = 4, eta = 1, omega = 0, mu = 1, Tmax = 100, dt = .01)
# racvm3b <- simulateRACVM2(tau = 4, eta = 1, omega = 2, mu = 1, Tmax = 100, dt = .01)
# 
# racvm1 <- simulateRACVM(tau = 4, eta = 1, omega = 1, mu = 0, Tmax = 10, dt = .01)
# racvm1b <- simulateRACVM2(tau = 4, eta = 1, omega = 1, mu = 0, Tmax = 10, dt = .01)
# with(racvm1, scan_track(x = Re(Z), y = Im(Z), time = T))
# with(racvm1b, scan_track(x = Re(Z), y = Im(Z), time = T))

EliGurarie/smoove documentation built on Aug. 2, 2022, 10:26 p.m.