Drake
SystemIdentification< CoefficientType > Class Template Reference

Utility functions for system identification. More...

#include <drake/solvers/system_identification.h>

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
 Estimate some parameters of a polynomial based on empirical data. More...
 

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)
 

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<PolyType, VarType> LumpingMapType
typedef PolyType::Monomial MonomialType
typedef std::map<VarType, CoefficientType> PartialEvalType

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.
typedef ::Polynomial<CoefficientType> PolyType
typedef PolyType::Term TermType

Member Function Documentation

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

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 call graph for this function:

Here is the caller 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

Here is the call graph for this function:


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