signals-cpp
Loading...
Searching...
No Matches
TrapezoidalIntegratorSpec Struct Reference

Specification for numerically integrating a black box function using the Trapezoidal method. More...

#include <Integration.h>

Static Public Member Functions

template<typename T, typename BaseSignalSpec, typename TangentSignalSpec>
static bool integrate (Signal< T, BaseSignalSpec, TangentSignalSpec > &xInt, const Signal< T, TangentSignalSpec, TangentSignalSpec > &x, const double &t0, const double &tf, const bool &insertIntoHistory)
 Trapezoidal integration implementation.
 

Detailed Description

Specification for numerically integrating a black box function using the Trapezoidal method.

Member Function Documentation

◆ integrate()

template<typename T, typename BaseSignalSpec, typename TangentSignalSpec>
static bool TrapezoidalIntegratorSpec::integrate ( Signal< T, BaseSignalSpec, TangentSignalSpec > & xInt,
const Signal< T, TangentSignalSpec, TangentSignalSpec > & x,
const double & t0,
const double & tf,
const bool & insertIntoHistory )
inlinestatic

Trapezoidal integration implementation.

Parameters
xIntThe output signal representing the integration.
xThe input signal to be integrated.
t0The start time for the integration.
tfThe time to integrate to. Ideally the delta from the start time is small.
insertIntoHistoryWhether to store the result in xInt's memory.
Returns
Whether the integration was successful.

Trapezoidal integration increments the current integral by

\(\frac{x(t_0)+x(t_f)}{2}\Delta t\)


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