Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
TransferFunction Class Reference

Detailed Description

Represents a linear-time-invariant (LTI) system in transfer function form, e.g.

complex rational functions corresponding to the Laplace transform or z-transform of the impulse response (https://en.wikipedia.org/wiki/Transfer_function).

For example, to create the transfer function H(s) = 1/(s + 1), you can write:

TransferFunction H(1.0 / (s + 1.0));
TransferFunction(const TransferFunction &)=delete
const MatrixX< symbolic::RationalFunction > & H() const
Returns the transfer function matrix.
Definition transfer_function.h:58
static symbolic::RationalFunction s()
Returns a symbolic::RationalFunction s which can be used to build a continuous-time transfer function...
Definition transfer_function.h:65

To create the transfer function H(z) = 1/(z - 0.5), you can write:

double time_step = 0.1;
TransferFunction H(1.0 / (z - 0.5), time_step);
static symbolic::RationalFunction z()
Returns a symbolic::RationalFunction s which can be used to build a discrete-time transfer function s...
Definition transfer_function.h:76
double time_step() const
Returns the time step.
Definition transfer_function.h:61

Note that TransferFunction is not a LeafSystem. To use it in the Systems framework, you must convert it to state-space form, represented by LinearSystem.

#include <drake/systems/primitives/transfer_function.h>

Public Member Functions

 TransferFunction ()
 Constructs a zero-input, zero-output (continuous-time) transfer function.
 TransferFunction (MatrixX< symbolic::RationalFunction > H, double time_step=0.0)
 Constructs a transfer function from the symbolic form.
 TransferFunction (symbolic::RationalFunction H, double time_step=0.0)
 Convenience overload for single-input, single-output (SISO) systems.
 ~TransferFunction ()=default
 TODO(russt): Construct a TransferFunction from a LinearSystem once we have more symbolic support for complex numbers (#20159).
const MatrixX< symbolic::RationalFunction > & H () const
 Returns the transfer function matrix.
double time_step () const
 Returns the time step.
Does not allow copy, move, or assignment
 TransferFunction (const TransferFunction &)=delete
TransferFunctionoperator= (const TransferFunction &)=delete
 TransferFunction (TransferFunction &&)=delete
TransferFunctionoperator= (TransferFunction &&)=delete

Static Public Member Functions

static symbolic::RationalFunction s ()
 Returns a symbolic::RationalFunction s which can be used to build a continuous-time transfer function symbolically.
static symbolic::Variable s_var ()
 Returns the singleton symbolic::Variable denoting the complex frequency (σ+jω) used in the Laplace transform for continuous-time transfer functions.
static symbolic::RationalFunction z ()
 Returns a symbolic::RationalFunction s which can be used to build a discrete-time transfer function symbolically.
static symbolic::Variable z_var ()
 Returns the singleton symbolic::Variable denoting the complex frequency (σ+jω) used in the Z transform for discrete-time transfer functions.

Constructor & Destructor Documentation

◆ TransferFunction() [1/5]

TransferFunction ( const TransferFunction & )
delete

◆ TransferFunction() [2/5]

◆ TransferFunction() [3/5]

Constructs a zero-input, zero-output (continuous-time) transfer function.

◆ TransferFunction() [4/5]

TransferFunction ( MatrixX< symbolic::RationalFunction > H,
double time_step = 0.0 )
explicit

Constructs a transfer function from the symbolic form.

If time_step is zero, then the model is of a continuous-time system, and H must only be a function of s(). If time_step > 0, then the model is of a discrete-time system, and H must only be a function of z().

Exceptions
std::exceptionif time_step is negative.
std::exceptionif H has variables other than s() or z(), as described above.

◆ TransferFunction() [5/5]

TransferFunction ( symbolic::RationalFunction H,
double time_step = 0.0 )
explicit

Convenience overload for single-input, single-output (SISO) systems.

◆ ~TransferFunction()

~TransferFunction ( )
default

TODO(russt): Construct a TransferFunction from a LinearSystem once we have more symbolic support for complex numbers (#20159).

Member Function Documentation

◆ H()

const MatrixX< symbolic::RationalFunction > & H ( ) const

Returns the transfer function matrix.

◆ operator=() [1/2]

TransferFunction & operator= ( const TransferFunction & )
delete

◆ operator=() [2/2]

TransferFunction & operator= ( TransferFunction && )
delete

◆ s()

Returns a symbolic::RationalFunction s which can be used to build a continuous-time transfer function symbolically.

◆ s_var()

symbolic::Variable s_var ( )
static

Returns the singleton symbolic::Variable denoting the complex frequency (σ+jω) used in the Laplace transform for continuous-time transfer functions.

◆ time_step()

double time_step ( ) const

Returns the time step.

◆ z()

Returns a symbolic::RationalFunction s which can be used to build a discrete-time transfer function symbolically.

◆ z_var()

symbolic::Variable z_var ( )
static

Returns the singleton symbolic::Variable denoting the complex frequency (σ+jω) used in the Z transform for discrete-time transfer functions.


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