Skip to contents

Least squares shadowing computes derivatives of long time averages <g> = (1/T) int g(u, p, t) dt of ergodic chaotic systems, whose ordinary sensitivities grow without bound. ForwardLSS() and AdjointLSS() solve the discretized least squares problem on the saved points of a solution; NILSS() (forward) and NILSAS() (adjoint) restrict the computation to the unstable subspace, integrating tangent or adjoint solutions over nseg segments of nstep saved points each. TimeDilation(), CosWindowing() and Cos2Windowing() choose how LSS treats the time average.

Usage

ForwardLSS(LSSregularizer = TimeDilation(10), g = NULL, autojacvec = NULL)

AdjointLSS(LSSregularizer = TimeDilation(10), g = NULL, autojacvec = NULL)

TimeDilation(alpha, t0skip = 0, t1skip = 0)

CosWindowing()

Cos2Windowing()

NILSS(nseg, nstep, nus = NULL, g = NULL, seed = NULL, autojacvec = NULL)

NILSAS(
  nseg,
  nstep,
  M = NULL,
  g = NULL,
  seed = NULL,
  autojacvec = NULL,
  adjoint_sensealg = NULL
)

Arguments

LSSregularizer

TimeDilation(alpha, t0skip, t1skip) (the default, weight alpha of the time dilation, times skipped at both ends), CosWindowing() or Cos2Windowing().

g

The instantaneous objective g(u, p, t).

autojacvec

As in sensitivity_algorithms.

alpha, t0skip, t1skip

Time dilation weight and skipped times.

nseg, nstep

Number of segments and of saved points per segment.

nus

Dimension of the unstable subspace for NILSS() (default length(u0) - 1).

seed

Seed of the random initial tangent or adjoint directions.

M

Number of homogeneous adjoint solutions for NILSAS() (at least the number of positive Lyapunov exponents plus one).

adjoint_sensealg

For NILSAS(): the continuous adjoint method of the segment solves. BacksolveAdjoint() integrates the state backward with the adjoint from the state saved at each segment end (Julia's default); the other methods (the default NULL is InterpolatingAdjoint()) read the state from the dense forward solution.

Value

An algorithm object.

Examples

ForwardLSS(g = function(u, p, t) u[3])
#> ForwardLSS(LSSregularizer = TimeDilation(10, 0, 0))
NILSS(10, 101, g = function(u, p, t) u[3])
#> NILSS(nseg = 10, nstep = 101)