Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
integrator.h
Go to the documentation of this file.
1/***********************************************************************/
25#ifndef INTEGRATOR_H
26#define INTEGRATOR_H
27
28#include "vector.h"
29
31template <class basetype, class datatype>
33 {
34public:
36 integrator( basetype Tintegrator, basetype Tsampling, const datatype& init_value = 0)
37 : time_constant( Tsampling / Tintegrator), value( init_value)
38 {};
39
41 integrator( basetype Tsampling)
42 : time_constant( Tsampling ), value( 0)
43 {};
44
46 const datatype & response( datatype & right)
47 {
48 value += right * time_constant;
49 return value;
50 };
51
53 const datatype & get_value( void) const
54 {
55 return value;
56 };
57
59 datatype operator () ( void) const
60 {
61 return get_value();
62 };
63
65 void set_value( const datatype & _value)
66 {
67 this->value = _value;
68 };
69
70private:
72 basetype time_constant;
74 datatype value;
75 };
76
77#endif
multi-dimensional integrator
Definition integrator.h:33
datatype operator()(void) const
cast to vector<size> returns current output
Definition integrator.h:59
void set_value(const datatype &_value)
set current output value
Definition integrator.h:65
const datatype & response(datatype &right)
update integrator taking next input value
Definition integrator.h:46
const datatype & get_value(void) const
returns current output
Definition integrator.h:53
integrator(basetype Tsampling)
constructor taking sampling-time only
Definition integrator.h:41
integrator(basetype Tintegrator, basetype Tsampling, const datatype &init_value=0)
constructor taking Ti, Ts and initial values
Definition integrator.h:36
linear algebra implementation