chrono::ChFunctionPoly23 Class Reference

Description

Cubic smooth step.

y(x) = ampl * (x - x_start)^2 * (x - x_end)^2 * (3 - 2*(x - x_start)) with x in [x_start, x_end]. First derivatives at the start and end points are zero.

#include <ChFunctionPoly23.h>

Inheritance diagram for chrono::ChFunctionPoly23:
Collaboration diagram for chrono::ChFunctionPoly23:

Public Member Functions

 ChFunctionPoly23 (double ampl, double x_start, double x_end)
 
 ChFunctionPoly23 (const ChFunctionPoly23 &other)
 
virtual ChFunctionPoly23Clone () const override
 "Virtual" copy constructor (covariant return type).
 
virtual Type GetType () const override
 Return the unique function type identifier.
 
virtual double GetVal (double x) const override
 Return the function output for input x. More...
 
virtual double GetDer (double x) const override
 Return the first derivative of the function. More...
 
virtual double GetDer2 (double x) const override
 Return the second derivative of the function. More...
 
void SetStartArg (double x_start)
 Set the start of the step: GetVal(x_start) = 0.
 
void SetEndArg (double x_end)
 Set the end of the step: GetVal(x_end) = amplitude.
 
void SetAmplitude (double ampl)
 Set the value of the function at the end of the step.
 
double GetStart () const
 Get the start of the step: GetVal(x_start) = 0.
 
double GetEnd () const
 Get the end of the step: GetVal(x_end) = amplitude.
 
double GetAmplitude () const
 Get the value of the function at the end of the step.
 
virtual double GetPositiveAccelerationCoeff () const override
 Compute the positive acceleration coefficient. More...
 
virtual double GetNegativeAccelerationCoeff () const override
 Compute the negative acceleration coefficient. More...
 
virtual double GetVelocityCoefficient () const override
 Compute the velocity coefficient. More...
 
virtual void ArchiveOut (ChArchiveOut &archive_out) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in) override
 Method to allow de-serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChFunction
 ChFunction (const ChFunction &other)
 
virtual double GetDer3 (double x) const
 Return the third derivative of the function. More...
 
virtual double GetDerN (double x, int der_order) const
 Return the Nth derivative of the function (up to 3rd derivative). More...
 
virtual double GetWeight (double x) const
 Return the weight of the function. More...
 
virtual void Update (double x)
 Update the function at the provided value of its argument.
 
virtual double GetMax (double xmin, double xmax, double sampling_step, int der_order) const
 Estimate the maximum of the function (or its der_order derivative) in the range [xmin, xmax]. More...
 
virtual double GetMin (double xmin, double xmax, double sampling_step, int der_order) const
 Estimate the minimum of the function (or its der_order derivative) in the range [xmin, xmax]. More...
 
virtual double GetMean (double xmin, double xmax, double sampling_step, int der_order) const
 Estimate the mean of the function (or its der_order derivative) in the range [xmin, xmax]. More...
 
virtual double GetSquaredMean (double xmin, double xmax, double sampling_step, int der_order) const
 Estimate the squared mean of the function (or its der_order derivative) in the range [xmin, xmax]. More...
 
virtual double GetIntegral (double xmin, double xmax, double sampling_step, int der_order) const
 Estimate the integral of the function (or its der_order derivative) over the range [xmin, xmax]. More...
 
virtual void OutputToASCIIFile (std::ostream &file, double xmin, double xmax, int samples, char delimiter)
 Store X-Y pairs to an ASCII File. More...
 
virtual ChMatrixDynamic SampleUpToDerN (double xmin, double xmax, double step, int derN=0)
 Sample function on given interval [xmin, xmax], up to derN derivative (0 being the function ouput itself). More...
 
double operator() (double arg) const
 Alias operator of the GetVal function.
 

Additional Inherited Members

- Public Types inherited from chrono::ChFunction
enum  Type {
  BSPLINE, CONSTANT, CONSTACC, CONSTJERK,
  CUSTOM, CYCLOIDAL, DERIVATIVE, FILLET3,
  INTEGRAL, INTERP, LAMBDA, MIRROR,
  OPERATOR, POLY, POLY23, POLY345,
  RAMP, REPEAT, SEQUENCE, SINE,
  SINE_STEP
}
 Enumeration of function types.
 

Member Function Documentation

◆ GetDer()

double chrono::ChFunctionPoly23::GetDer ( double  x) const
overridevirtual

Return the first derivative of the function.

Default implementation computes a numerical differentiation. Inherited classes may override this method with a more efficient implementation (e.g. analytical solution).

Reimplemented from chrono::ChFunction.

◆ GetDer2()

double chrono::ChFunctionPoly23::GetDer2 ( double  x) const
overridevirtual

Return the second derivative of the function.

Default implementation computes a numerical differentiation. Inherited classes may override this method with a more efficient implementation (e.g. analytical solution).

Reimplemented from chrono::ChFunction.

◆ GetNegativeAccelerationCoeff()

virtual double chrono::ChFunctionPoly23::GetNegativeAccelerationCoeff ( ) const
inlineoverridevirtual

Compute the negative acceleration coefficient.

(derived classes should override this).

Reimplemented from chrono::ChFunction.

◆ GetPositiveAccelerationCoeff()

virtual double chrono::ChFunctionPoly23::GetPositiveAccelerationCoeff ( ) const
inlineoverridevirtual

Compute the positive acceleration coefficient.

(derived classes should override this).

Reimplemented from chrono::ChFunction.

◆ GetVal()

double chrono::ChFunctionPoly23::GetVal ( double  x) const
overridevirtual

Return the function output for input x.

Must be overridden by specialized classes.

Implements chrono::ChFunction.

◆ GetVelocityCoefficient()

virtual double chrono::ChFunctionPoly23::GetVelocityCoefficient ( ) const
inlineoverridevirtual

Compute the velocity coefficient.

(derived classes must override this).

Reimplemented from chrono::ChFunction.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/functions/ChFunctionPoly23.h
  • /builds/uwsbel/chrono/src/chrono/functions/ChFunctionPoly23.cpp