R/finite_differences.R

Defines functions finite_differences

Documented in finite_differences

#' Perform Method of Finite Differences Over Multiple Columns
#' 
#' @param xs raw data to be differentiated
#' @param S sample rate of data to return derivatives using raw time
#' @return set of first-order numerical derivatives estimated from data, using finDiff

.packageName <- 'sindyr'

finite_differences = function(xs,S) {
  dx = c()
  for (i in 1:ncol(xs)) { # if we have lots of state variables, let's findDiff 'em individually
    dx = cbind(dx,finite_difference(xs[,i],S))
  }
  return(dx) # Sorry dx, I have to ask you to leave. Know I'll miss you.
}

Try the sindyr package in your browser

Any scripts or data that you put into this service are public.

sindyr documentation built on July 8, 2020, 5:51 p.m.