SpECTRE  v2024.04.12
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>

Classes

struct  UpdateFraction
 

Public Types

using options = tmpl::list< UpdateFraction >
 

Public Member Functions

 Controller (const double update_fraction)
 
 Controller (Controller &&)=default
 
Controlleroperator= (Controller &&)=default
 
 Controller (const Controller &)=default
 
Controlleroperator= (const Controller &)=default
 
DataVector operator() (const double time, const DataVector &timescales, const std::array< DataVector, DerivOrder > &q_and_derivs, double q_time_offset, double deriv_time_offset)
 
void assign_time_between_updates (const double current_min_timescale)
 Takes the current minimum of all timescales for a specific control system and uses that to set the time between updates.
 
bool is_ready (const double time)
 Returns true if the controller is ready to calculate the control signal.
 
double next_expiration_time (const double current_expiration_time)
 Calculates the new expiration time as the old expiration time plus the time between updates.
 
void set_initial_update_time (const double initial_time)
 Sets the last time updated to the initial time.
 
double get_update_fraction () const
 Return the update fraction.
 
void pup (PUP::er &p)
 

Static Public Attributes

static constexpr Options::String help
 

Friends

template<size_t LocalDerivOrder>
bool operator== (const Controller< LocalDerivOrder > &lhs, const Controller< LocalDerivOrder > &rhs)
 

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.

Member Data Documentation

◆ help

template<size_t DerivOrder>
constexpr Options::String Controller< DerivOrder >::help
staticconstexpr
Initial value:
{
"Computes control signal used to reset highest derivative of a function "
"of time. Also determines when a function of time needs to be updated "
"next."}

The documentation for this class was generated from the following file: