Drake
SystemIdentification< CoefficientType > Class Template Reference

Utility functions for system identification. More...

#include <drake/solvers/system_identification.h>

## Classes

struct  SystemIdentificationResult
A helper struct to hold System ID results. More...

## Public Types

typedef ::Polynomial< CoefficientType > PolyType

typedef PolyType::Monomial MonomialType

typedef PolyType::Term TermType

typedef PolyType::VarType VarType

typedef std::map< PolyType, VarTypeLumpingMapType

typedef std::map< VarType, CoefficientType > PartialEvalType

## Static Public Member Functions

static LumpingMapType GetLumpedParametersFromPolynomial (const PolyType &poly, const std::set< VarType > &parameter_vars)
Extract lumped parameters from a given polynomial. More...

static LumpingMapType GetLumpedParametersFromPolynomials (const std::vector< PolyType > &polys, const std::set< VarType > &parameter_vars)
Same as GetLumpedParametersFromPolynomial but for multiple Polynomials. More...

static PolyType RewritePolynomialWithLumpedParameters (const PolyType &poly, const LumpingMapType &lumped_parameters)
Rewrite a Polynomial in terms of lumped parameters. More...

static std::pair< PartialEvalType, CoefficientType > EstimateParameters (const VectorXPoly &polys, const std::vector< PartialEvalType > &active_var_values)
Estimate some parameters of a polynomial based on empirical data. More...

static SystemIdentificationResult LumpedSystemIdentification (const VectorXTrigPoly &polys, const std::vector< PartialEvalType > &active_var_values)
Performs full lumped-parameter identification of a system of TrigPolys. More...

## Detailed Description

### template<typename CoefficientType> class drake::solvers::SystemIdentification< CoefficientType >

Utility functions for system identification.

This class is a holder for templated utility methods. It should not be constructed. It must be template-instantiated (in its cpp file) for each supported variant of Polynomial (currently only Polynomial<double>).

For the purposes of system identification we require here that the set of variables in a polynomial can be divided into two groups:

• "Parameter variables" are unchanged through many evaluations of the Polynomial and so may be factored and renamed (lumped) at will. In effect parameter variables are treated as constants.
• "Active variables" are those that may vary between evaluations of the Polynomial, for instance because they are inputs or state variables of the system.

Note: The term "system identification" used throughout here refers to the process of simplifying the equations defining a physical system to a minimum number of "lumped" parameters and then estimating the values of those parameters based on empirical data.

## Member Typedef Documentation

 typedef std::map LumpingMapType
 typedef PolyType::Monomial MonomialType
 typedef std::map PartialEvalType
 typedef ::Polynomial PolyType
 typedef PolyType::Term TermType
 typedef PolyType::VarType VarType

## Member Function Documentation

 std::pair< typename SystemIdentification< T >::PartialEvalType, T > EstimateParameters ( const VectorXPoly & polys, const std::vector< PartialEvalType > & active_var_values )
static

Estimate some parameters of a polynomial based on empirical data.

Given one or more polynomial equations Pi = 0, and measured values of some its arguments (x, y, ..., referred to as the "active variables"), estimate values for the remaining arguments (a, b, ..., referred to as the "parameters").

Measured x, y, ... is provided in a list of maps, active_var_values.

The return value is a pair, {estimates, error}, where:

• estimates is a map of polynomial VarTypes (a, b, ...) to their estimated values, suitable as input for Polynomial::evaluatePartial.
• error is the root-mean-square error of the estimates.

Here is the call graph for this function:

 SystemIdentification< T >::LumpingMapType GetLumpedParametersFromPolynomial ( const PolyType & poly, const std::set< VarType > & parameter_vars )
static

Extract lumped parameters from a given polynomial.

Given a Polynomial, poly, and a set of variables of poly that should be treated as parameters (that is, variables eligible to be lumped), obtain all of the unique expressions by which combinations of the remaining active variables are multiplied to form the monomials of the Polynomial.

For instance, if we have the polynomial: a*x + b*x + a*c*y + a*c*y**2 And our parameters are a, b, and c, then our lumped parameters are: lump1 == a+b ; lump2 == a*c and we return: { (a + b) -> VarType("lump", 1); (a * c) -> VarType("lump", 2) }

Note however that this function provides no guarantees of the lumped parameter names generated except that they are unique – "lump1" and "lump2" here are examples.

Here is the call graph for this function:

 SystemIdentification< T >::LumpingMapType GetLumpedParametersFromPolynomials ( const std::vector< PolyType > & polys, const std::set< VarType > & parameter_vars )
static

Same as GetLumpedParametersFromPolynomial but for multiple Polynomials.

It is preferrable to use this if you have multiple Polynomials as it saves you from having to union the resulting LumpingMapType results together.

Here is the caller graph for this function:

 SystemIdentification< T >::SystemIdentificationResult LumpedSystemIdentification ( const VectorXTrigPoly & polys, const std::vector< PartialEvalType > & active_var_values )
static

Performs full lumped-parameter identification of a system of TrigPolys.

This is a convenience method meant to capture what is expected to be the most common usage pattern of system ID.

Given one or more TrigPoly expressions to be set equal to zero, and a list of observed values for a subset of the variables, lumps up the remaining variables into lumped parameters and estimates a value for each of those. This is broadly equivalent to calling the following methods in sequence:

• GetLumpedParametersFromPolynomials
• RewritePolynomialWithLumpedParameters
• EstimateParameters

Here is the call graph for this function:

 SystemIdentification< T >::PolyType RewritePolynomialWithLumpedParameters ( const PolyType & poly, const LumpingMapType & lumped_parameters )
static

Rewrite a Polynomial in terms of lumped parameters.

For instance, if we have the polynomial: a*x + b*x + a*c*y + a*c*y**2 And our lumped parameters are: lump1 == a+b ; lump2 == a*c And our polynomial is now: lump1*x + lump2*y + lump2*y**2

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