qlibs::ltisys is a class that evaluates single-input, single-output (SISO) transfer function models in real-valued systems. A transfer function is a model that describes the frequency-dependent response of a linear time-invariant system, and this class can handle both continuous-time and discrete-time systems. qlibs::ltisys can be used for simulating dynamic systems and implementing filters, compensators, or controllers.
Continous-time transfer functions
Here, the transfer function G(s) is the linear mapping of the Laplace transform of the input, U(s)= \mathcal{L}[u(t)], to the Laplace transform of the output Y(s)= \mathcal{L}[y(t)].
N(s) and D(s) are the numerator and denominator polynomials in descending powers of s, respectively.
To instantiate a continuous transfer function, you should define a variable of type qlibs::continuousSystem, two arrays of N+1 elements with the coefficients of the polynomials for both, the numerator and denominator, and finally, an array of type qlibs::continuousStates to hold the N states of the system. Then, you can call qlibs::continuousSystem::setup() to construct the system and set initial conditions. Subsequently, you can evaluate the system with a given input-signal by just calling qlibs::continuousSystem::excite() .
Attention
The user must ensure that the evaluation of the system is executed periodically at the required time step.
Example: Evaluate the given continuous transfer function
Continuous transfer function for easy LTI system definition.
Definition ltisys.hpp:61
Discrete-time transfer functions
The z-transform is used in discrete-time systems to deal with the relationship between an input signal u(t) and an output signal y(t) , so the transfer function is similarly written as G(z^{-1}) and is often referred to as the pulse-transfer function.
Discrete systems are instantiated in a similar way to continuous systems, but there are some differences. States should be stored in an array of type qlibs::discreteStates. The size of polynomials can vary according to their order. Please take a look at the following example:
Example: Evaluate the given discrete transfer function