Rigid Body Dynamics Library
|
#include <Function.h>
Public Member Functions | |
Sinusoid (double amplitude, double frequency, double phase=0) | |
void | setAmplitude (double amplitude) |
void | setFrequency (double frequency) |
void | setPhase (double phase) |
double | getAmplitude () const |
double | getFrequency () const |
double | getPhase () const |
virtual double | calcValue (const RigidBodyDynamics::Math::VectorNd &x) const |
virtual double | calcDerivative (const std::vector< int > &derivComponents, const RigidBodyDynamics::Math::VectorNd &x) const |
virtual int | getArgumentSize () const |
virtual int | getMaxDerivativeOrder () const |
Public Member Functions inherited from Function_< double > | |
virtual | ~Function_ () |
virtual double | calcValue (const RigidBodyDynamics::Math::VectorNd &x) const=0 |
virtual double | calcDerivative (const std::vector< int > &derivComponents, const RigidBodyDynamics::Math::VectorNd &x) const=0 |
virtual int | getArgumentSize () const=0 |
virtual int | getMaxDerivativeOrder () const=0 |
Private Attributes | |
double | a |
double | w |
double | p |
This is a Function_ subclass whose output value is a sinusoid of its argument: f(x) = a*sin(w*x + p) where a is amplitude, w is frequency in radians per unit of x, p is phase in radians.
This is only defined for a scalar (double) return value.
Definition at line 301 of file Function.h.
|
inline |
Create a Function::Sinusoid object, returning a*sin(w*x+p).
[in] | amplitude | 'a' in the above formula |
[in] | frequency | 'w' in the above formula |
[in] | phase | 'p' in the above formula |
Definition at line 310 of file Function.h.
|
inlinevirtual |
Calculate a partial derivative of this function at a particular point.
Which derivative to take is specified by listing the input components with which to take it. For example, if derivComponents=={0}, that indicates a first derivative with respective to component 0. If derivComponents=={0, 0, 0}, that indicates a third derivative with respective to component 0. If derivComponents=={4, 7}, that indicates a partial second derivative with respect to components 4 and 7.
derivComponents | The input components with respect to which the derivative should be taken. Its size must be less than or equal to the value returned by getMaxDerivativeOrder(). |
x | The RigidBodyDynamics::Math::VectorNd of input arguments. Its size must equal the value returned by getArgumentSize(). |
Implements Function_< double >.
Definition at line 330 of file Function.h.
References std::cos(), std::pow(), std::sin(), and MX_Xd_dynamic::size().
|
inlinevirtual |
Calculate the value of this function at a particular point.
x | the RigidBodyDynamics::Math::VectorNd of input arguments. Its size must equal the value returned by getArgumentSize(). |
Implements Function_< double >.
Definition at line 323 of file Function.h.
References std::sin().
|
inline |
Definition at line 317 of file Function.h.
|
inlinevirtual |
This provides compatibility with std::vector without requiring any copying. Get the number of components expected in the input vector.
Implements Function_< double >.
Definition at line 353 of file Function.h.
|
inline |
Definition at line 318 of file Function.h.
|
inlinevirtual |
Get the maximum derivative order this Function_ object can calculate.
Implements Function_< double >.
Definition at line 354 of file Function.h.
|
inline |
Definition at line 319 of file Function.h.
|
inline |
Definition at line 313 of file Function.h.
|
inline |
Definition at line 314 of file Function.h.
|
inline |
Definition at line 315 of file Function.h.
|
private |
This provides compatibility with std::vector without requiring any copying.
Definition at line 366 of file Function.h.
|
private |
Definition at line 366 of file Function.h.
|
private |
Definition at line 366 of file Function.h.