SpECTRE  2021.08.02
Controller< DerivOrder > Class Template Reference

A PND (proportional to Q and N derivatives of Q) controller that computes the control signal: More...

#include <Controller.hpp>

Public Member Functions

DataVector operator() (const DataVector &timescales, const std::array< DataVector, DerivOrder+1 > &q_and_derivs, double q_time_offset, double deriv_time_offset) const noexcept
 

Detailed Description

template<size_t DerivOrder>
class Controller< DerivOrder >

A PND (proportional to Q and N derivatives of Q) controller that computes the control signal:

\[ U(t) = \sum_{k=0}^{N} a_{k} \frac{d^kQ}{dt^k} \]

where N is specified by the template parameter DerivOrder.

If an averager is used for q_and_derivs (as we typically do), there is an induced time offset, \(\Delta t\), due to the time-weighted averaging. Therefore, the q_and_derivs that we have in hand are at some time \(t_{0}\). However, we desire q_and_derivs at the current time \(t = t_{0} + \Delta t\) to determine the appropriate control signal. We accomplish this by Taylor expanding \(Q(t_{0} + \Delta t)\). The averager allows for averaging of \(Q\) and its derivatives OR to not average \(Q\) while still averaging the derivatives (the derivatives are always averaged in order to reduce noise due to numerical differentiation). When they are both averaged, the time offset will be identical for \(Q\) and the derivatives, i.e. q_time_offset = deriv_time_offset. If an unaveraged \(Q\) is used, then the time offset associated with \(Q\) is zero, i.e. q_time_offset=0. and the derivative time offset, deriv_time_offset, remains non-zero.