Lodestar
An integrated real-time control package in C++
ls::systems::TransferFunction Class Reference
Inheritance diagram for ls::systems::TransferFunction:
[legend]
Collaboration diagram for ls::systems::TransferFunction:
[legend]

Public Member Functions

 TransferFunction ()
 Default constructor.
 
 TransferFunction (const TransferFunction &other)
 Copy constructor. More...
 
 TransferFunction (const Eigen::MatrixXd &num, const Eigen::MatrixXd &den)
 Constructs a transfer function from a vector of numerator and denominator coefficients. More...
 
Eigen::MatrixXd getNum () const
 Gets numerator coefficients. More...
 
void setNum (const Eigen::MatrixXd &num)
 Sets numerator coefficients. More...
 
long getNumDegree () const
 
Eigen::MatrixXd getDen () const
 Gets denominator coefficients. More...
 
void setDen (const Eigen::MatrixXd &den)
 Set denominator coefficients. More...
 
long getDenDegree () const
 
void normalizeInPlace ()
 Normalizes transfer function in place.
 
TransferFunction normalized () const
 Creates normalized transfer function. More...
 
StateSpace toStateSpace () const
 Converts transfer function to state space object. More...
 
StateSpace toDiscreteStateSpace (double dt) const
 Converts transfer function to discrete-time state space object. More...
 
StateSpace toDiscreteStateSpace (double dt, double alpha) const
 Convert transfer function to discrete-time state space object. More...
 
 TransferFunction (const GiNaC::ex &tf, const GiNaC::ex &symbol)
 Constructs a transfer function from the given symbolic expression. More...
 
GiNaC::ex getNumExpression (const GiNaC::ex &symbol) const
 Generates a symbolic expression of the numerator polynomial. More...
 
GiNaC::ex getDenExpression (const GiNaC::ex &symbol) const
 Generates a symbolic expression of the denominator polynomial. More...
 
GiNaC::ex getExpression (const GiNaC::ex &symbol) const
 Generates a symbolic expression of the transfer function. More...
 
void copyFromExpression (const GiNaC::ex &tf, const GiNaC::ex &symbol)
 Copies transfer function coefficients from the given symbolic expression. More...
 

Constructor & Destructor Documentation

◆ TransferFunction() [1/3]

ls::systems::TransferFunction::TransferFunction ( const TransferFunction other)

Copy constructor.

Parameters
otherTransfer function to copy.

◆ TransferFunction() [2/3]

ls::systems::TransferFunction::TransferFunction ( const Eigen::MatrixXd &  num,
const Eigen::MatrixXd &  den 
)
inline

Constructs a transfer function from a vector of numerator and denominator coefficients.

Note
Coefficients are in descending order (starting with the monomial with highest power).
Parameters
numNumerator coefficients.
denDenominator coefficients.

◆ TransferFunction() [3/3]

ls::systems::TransferFunction::TransferFunction ( const GiNaC::ex &  tf,
const GiNaC::ex &  symbol 
)

Constructs a transfer function from the given symbolic expression.

Parameters
tfTransfer function expression.
symbolSymbol used for the independent variable.

Member Function Documentation

◆ copyFromExpression()

void ls::systems::TransferFunction::copyFromExpression ( const GiNaC::ex &  tf,
const GiNaC::ex &  symbol 
)

Copies transfer function coefficients from the given symbolic expression.

Parameters
tfTransfer function expression.
symbolSymbol used for the independent variable.

◆ getDen()

Eigen::MatrixXd ls::systems::TransferFunction::getDen ( ) const

Gets denominator coefficients.

Returns
Denominator coefficients.

◆ getDenDegree()

long ls::systems::TransferFunction::getDenDegree ( ) const

Returns polynomial degree of the denominator.

Returns
denominator degree.

◆ getDenExpression()

GiNaC::ex ls::systems::TransferFunction::getDenExpression ( const GiNaC::ex &  symbol) const

Generates a symbolic expression of the denominator polynomial.

Parameters
symbolSymbol to use for the independent variable.
Returns
GiNaC expression of the denominator polynomial.

◆ getExpression()

GiNaC::ex ls::systems::TransferFunction::getExpression ( const GiNaC::ex &  symbol) const

Generates a symbolic expression of the transfer function.

Parameters
symbolSymbol to use for the independent variable.
Returns
GiNaC expression of the transfer function.

◆ getNum()

Eigen::MatrixXd ls::systems::TransferFunction::getNum ( ) const

Gets numerator coefficients.

Returns
Numerator coefficients.

◆ getNumDegree()

long ls::systems::TransferFunction::getNumDegree ( ) const

Returns polynomial degree of the numerator.

Returns
Numerator degree.

◆ getNumExpression()

GiNaC::ex ls::systems::TransferFunction::getNumExpression ( const GiNaC::ex &  symbol) const

Generates a symbolic expression of the numerator polynomial.

Parameters
symbolSymbol to use for the independent variable.
Returns
GiNaC expression of the numerator polynomial.

◆ normalized()

ls::systems::TransferFunction ls::systems::TransferFunction::normalized ( ) const

Creates normalized transfer function.

Returns
Normalized transfer function.

◆ setDen()

void ls::systems::TransferFunction::setDen ( const Eigen::MatrixXd &  den)

Set denominator coefficients.

Parameters
denDenominator coefficients.

◆ setNum()

void ls::systems::TransferFunction::setNum ( const Eigen::MatrixXd &  num)

Sets numerator coefficients.

Parameters
numNumerator coefficients.

◆ toDiscreteStateSpace() [1/2]

ls::systems::StateSpace ls::systems::TransferFunction::toDiscreteStateSpace ( double  dt) const

Converts transfer function to discrete-time state space object.

Note
This method uses the backward difference method by default.
See also
ls::analysis::BilinearTransformation::c2dBwdDiff
Parameters
dtSampling period.
Returns
Discrete-time state space system.

◆ toDiscreteStateSpace() [2/2]

ls::systems::StateSpace ls::systems::TransferFunction::toDiscreteStateSpace ( double  dt,
double  alpha 
) const

Convert transfer function to discrete-time state space object.

This method adds the option to set alpha in the generalized bilinear transform.

Parameters
dtSampling period.
alphaGeneralized bilinear transform parameter.
Returns
Discrete-time state space system.

◆ toStateSpace()

ls::systems::StateSpace ls::systems::TransferFunction::toStateSpace ( ) const

Converts transfer function to state space object.

Returns
TState space object.

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