Documentation
Tools for embedded systems
|
A numerical state object. More...
#include <numa.hpp>
Public Member Functions | |
virtual | ~nState () |
nState (const real_t x0=0.0_re, const real_t sn_1=0.0_re, const real_t sn_2=0.0_re) noexcept | |
Constructor for the state object. | |
void | init (const real_t x0=0.0_re, const real_t sn_1=0.0_re, const real_t sn_2=0.0_re) noexcept |
Initialize the state object. | |
real_t | integrate (const real_t s, const real_t dt, const bool bUpdate=true) noexcept |
Perform a numerical integration step. | |
real_t | derive (const real_t s, const real_t dt, const bool bUpdate=true) noexcept |
Perform a numerical derivation step by using the delta rule. | |
void | setIntegrationMethod (integrationMethod m) noexcept |
Set integration method . | |
void | setDerivationMethod (derivationMethod m) noexcept |
Set derivation method. | |
real_t | operator() (void) const noexcept |
Get the value of the state. | |
A numerical state object.
A numerical state object can be used to compute in real-time the numerical approximations of integral and derivative operations for data values sampled periodically.
|
inlinevirtual |
|
inlinenoexcept |
Constructor for the state object.
[in] | x0 | initial condition at time t(0) |
[in] | sn_1 | initial condition at time (t-1) |
[in] | sn_2 | initial condition at time (t-2) |
Perform a numerical derivation step by using the delta rule.
[in] | s | The input signal |
[in] | dt | The time-step given in seconds. |
[in] | bUpdate | Flag to update the states ( true by default). |
|
noexcept |
Initialize the state object.
[in] | x0 | initial condition at time t(0) |
[in] | sn_1 | initial condition at time (t-1) |
[in] | sn_2 | initial condition at time (t-2) |
Perform a numerical integration step.
[in] | s | The input signal |
[in] | dt | The time-step given in seconds. |
[in] | bUpdate | Flag to update the states ( true by default). |
|
inlinenoexcept |
Get the value of the state.
|
inlinenoexcept |
Set derivation method.
[in] | m | The desired derivation method. Use one of the following: |
DERIVATION_2POINTS
: (default) Derivative using two points.
DERIVATION_BACKWARD
: Derivative using the three-point backward-difference.
DERIVATION_FORWARD
: Derivative using the three-point forward-difference.
true
on success, otherwise return false
.
|
inlinenoexcept |
Set integration method .
[in] | m | The desired integration method. Use one of the following: |
INTEGRATION_RECTANGULAR
: Integrate using the Rectangular rule.
INTEGRATION_TRAPEZOIDAL
: (default) Integrate using the Trapezoidal rule.
INTEGRATION_SIMPSON
: Integrate using the Simpson's 1/3 rule.
INTEGRATION_QUADRATIC
: Integrate using a parabola fit to three points.
true
on success, otherwise return false
.