Module: stateData

Object that is to be used by an integrator. It’s basically an interface with only one method: the \(F\) function describing a dynamic model \(\dot X = F(X,t)\).


class StateData
#include <stateData.h>

Represents a physical state, which has a name, a value, and a derivative.

Public Functions

StateData(std::string inName, const Eigen::MatrixXd &newState)

Creates a new state with the given name and set’s the initial state.

The state derivative will be resized to the same size as the state and zero’d.

virtual std::unique_ptr<StateData> clone() const

Clone constructor for polymorphic class

virtual ~StateData() = default

Destructor

void setState(const Eigen::MatrixXd &newState)

Updates the value of the state

void setDerivative(const Eigen::MatrixXd &newDeriv)

Updates the derivative of the value of the state

inline Eigen::MatrixXd getState() const

Retrieves a copy of the current state

inline Eigen::MatrixXd getStateDeriv() const

Retrieves a copy of the current state derivative

inline std::string getName() const

Returns the name of the state

inline uint32_t getRowSize() const

Returns the row-size of the state

inline uint32_t getColumnSize() const

Returns the column-size of the state

inline uint32_t getDerivativeRowSize() const

Returns the row-size of the derivative of the state

inline uint32_t getDerivativeColumnSize() const

Returns the column-size of the derivative of the state

void scaleState(double scaleFactor)

Multiples the state by a scalar

void addState(const StateData &other)

Adds the values of the other state to this state

virtual void propagateState(double dt)

Propagates the state in time with the stored derivative

Public Members

Eigen::MatrixXd state

[-] State value storage

Eigen::MatrixXd stateDeriv

[-] State derivative value storage

const std::string stateName

[-] Name of the state

BSKLogger bskLogger

&#8212; BSK Logging