SpECTRE  v2022.09.02
control_system::UpdateControlSystem< ControlSystem > Struct Template Reference

Functor for updating control systems when they are ready. More...

#include <UpdateControlSystem.hpp>

Static Public Member Functions

template<typename DbTags , typename Metavariables , typename ArrayIndex , typename... TupleTags>
static void apply (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const double time, tuples::TaggedTuple< TupleTags... > data)

Static Public Attributes

static constexpr size_t deriv_order = ControlSystem::deriv_order

Detailed Description

template<typename ControlSystem>
struct control_system::UpdateControlSystem< ControlSystem >

Functor for updating control systems when they are ready.


The apply operator of this struct is meant to be called by the UpdateMessageQueue action once an entire measurement has been made.

Requires a few tags to be in the DataBox of the ControlComponent that this is running on:

If these are not in the DataBox, an error will occur.

The algorithm to determine whether or not to update the functions of time is as follows:

  1. Ensure this control system is active. If it isn't, end here and don't process the measurements.
  2. Determine if we need to update now. This is done by checking if the next measurement scheduled to happen will be after the current expiration time of the function of time we are controlling. If it is, we need to update now, otherwise the functions of time will be expired the next time we measure.
  3. Determine if we should store the current measurement. Not all control systems are on the same timescale; some are on shorter timescales (like characteristic speed control), some are on longer timescales (like Rotation). The ones on longer timescales don't need to record measurements as often as the ones on shorter timescales. If they did, this could introduce unnecessary noise into the measurements. It also causes the control errors to be calculated based off only measurements from the end of the update interval. This is not what we want. We want measurements throughout the update interval. If we don't need to store the current measurement and we don't need to update now, end here.
  4. Calculate the control error and update the averager (store the current measurement).
  5. Determine if we need to update. We only want to update at the very end of the update interval, not sooner. If we don't need to update, end here.
  6. Compute control signal using the control error and its derivatives.
  7. Determine the new expiration time.
  8. Update the function of time.
  9. Update the damping timescale using the control error and one derivative.
  10. Determine the new measurement timescale for this function of time using the new damping timescale.
  11. Update the measurement timescale.
  12. Write the function of time, control error, their derivatives, and the control signal to disk if specified in the input file.

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