Drake
|
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, VarType > | LumpingMapType |
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 > ¶meter_vars) |
Extract lumped parameters from a given polynomial. More... | |
static LumpingMapType | GetLumpedParametersFromPolynomials (const std::vector< PolyType > &polys, const std::set< VarType > ¶meter_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) |
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:
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.
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:
typedef ::Polynomial<CoefficientType> PolyType |
typedef PolyType::Term TermType |
typedef PolyType::VarType VarType |
|
static |
|
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.
|
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.
|
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