| MULTIBODY SIMULATION SOFTWARE - API documentation |
#include <CHfunction_Base.h>

Public Member Functions | |
| virtual ChFunction * | new_Duplicate ()=0 |
| virtual int | Get_Type () |
| virtual double | Get_y (double x)=0 |
| virtual double | Get_y_dx (double x) |
| virtual double | Get_y_dxdx (double x) |
| virtual double | Get_weight (double x) |
| virtual void | Extimate_x_range (double &xmin, double &xmax) |
| virtual void | Extimate_y_range (double xmin, double xmax, double &ymin, double &ymax, int derivate) |
| virtual double | Get_y_dN (double x, int derivate) |
| virtual double | Compute_max (double xmin, double xmax, double sampling_step, int derivate) |
| virtual double | Compute_min (double xmin, double xmax, double sampling_step, int derivate) |
| virtual double | Compute_mean (double xmin, double xmax, double sampling_step, int derivate) |
| virtual double | Compute_sqrmean (double xmin, double xmax, double sampling_step, int derivate) |
| virtual double | Compute_int (double xmin, double xmax, double sampling_step, int derivate) |
| virtual double | Get_Ca_pos () |
| virtual double | Get_Ca_neg () |
| virtual double | Get_Cv () |
| virtual int | MakeOptVariableTree (ChList< chjs_propdata > *mtree) |
| virtual int | OptVariableCount () |
| OPT_VARIABLES_START virtual OPT_VARIABLES_END int | HandleNumber () |
| virtual int | HandleAccess (int handle_id, double mx, double my, bool set_mode) |
| virtual void | StreamOUT (ChStreamOutAscii &mstream) |
| virtual void | StreamIN (ChStreamInBinary &mstream) |
| virtual void | StreamOUT (ChStreamOutBinary &mstream) |
| virtual int | FilePostscriptPlot (ChFile_ps *m_file, int plotY, int plotDY, int plotDDY) |
| virtual int | FileAsciiPairsSave (ChStreamOutAscii &m_file, double xmin=0, double xmax=1, int msamples=200) |
Static Public Member Functions | |
| static int | VariableTreeToFullNameVar (ChList< chjs_propdata > *mtree, ChList< chjs_fullnamevar > *mlist) |
THE INTERFACE BASE CLASS FOR SCALAR FUNCTIONS OF TYPE:
y= f(x)
The ChFunction class defines the base class for all Chrono functions of type y=f(x), that is scalar functions of an input variable x (usually, the time). ChFunctions are often used to set time-dependent properties, for example to set motion laws in linear actuators, engines, etc. This base class just represent a constant function of the type y= C. Inherited classes must override at least the Get_y() method, in order to represent more complex functions.
| virtual void chrono::ChFunction::Extimate_x_range | ( | double & | xmin, |
| double & | xmax | ||
| ) | [virtual] |
These functions can be used to implement automatic zooming on the most representative range of function (if GUI is implemented)
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Oscilloscope, chrono::ChFunction_Mocap, chrono::ChFunction_Operation, chrono::ChFunction_Fillet3, chrono::ChFunction_ConstAcc, chrono::ChFunction_Recorder, chrono::ChFunction_Integrate, chrono::ChFunction_Sigma, chrono::ChFunction_Poly345, chrono::ChFunction_Derive, chrono::ChFunction_Mirror, and chrono::ChFunction_Repeat.
| int chrono::ChFunction::FileAsciiPairsSave | ( | ChStreamOutAscii & | m_file, |
| double | xmin = 0, |
||
| double | xmax = 1, |
||
| int | msamples = 200 |
||
| ) | [virtual] |
Save function as X-Y pairs separated by space, with CR at each pair, into an Ascii file. The output file can be later loaded into Excel, GnuPlot or other tools. The function is 'sampled' for nsteps times, from xmin to xmax.
| int chrono::ChFunction::FilePostscriptPlot | ( | ChFile_ps * | m_file, |
| int | plotY, | ||
| int | plotDY, | ||
| int | plotDDY | ||
| ) | [virtual] |
Plot function in graph space of the ChFile_ps postscript file where zoom factor, centering, colour, thickness etc. are already defined. If plotDY=true, plots also the derivative, etc.
| virtual int chrono::ChFunction::Get_Type | ( | ) | [virtual] |
Each class inherited from the ChFunction class must return an unique integer identifier with the virtual function Get_type(). This is useful for fast run-time downcasting etc.
Reimplemented in chrono::ChFunction_Oscilloscope, chrono::ChFunction_Sequence, chrono::ChFunction_Mocap, chrono::ChFunction_Jscript, chrono::ChFunction_Operation, chrono::ChFunction_Fillet3, chrono::ChFunction_ConstAcc, chrono::ChFunction_Recorder, chrono::ChFunction_Integrate, chrono::ChFunction_Poly345, chrono::ChFunction_Sigma, chrono::ChFunction_Sine, chrono::ChFunction_Derive, chrono::ChFunction_Mirror, chrono::ChFunction_Noise, chrono::ChFunction_Repeat, chrono::ChFunction_Poly, chrono::ChFunction_Matlab, chrono::ChFunction_Const, and chrono::ChFunction_Ramp.
| virtual double chrono::ChFunction::Get_weight | ( | double | x | ) | [virtual] |
Returns the weight of the function (useful for applications where you need to mix different weighted ChFunctions)
Reimplemented in chrono::ChFunction_Sequence.
| virtual double chrono::ChFunction::Get_y | ( | double | x | ) | [pure virtual] |
Returns the y value of the function, at position x. (For this base class, it will be a constant value y=C).
Implemented in chrono::ChFunction_Sequence, chrono::ChFunction_Oscilloscope, chrono::ChFunction_Jscript, chrono::ChFunction_Mocap, chrono::ChFunction_Operation, chrono::ChFunction_Fillet3, chrono::ChFunction_Integrate, chrono::ChFunction_Recorder, chrono::ChFunction_ConstAcc, chrono::ChFunction_Ramp, chrono::ChFunction_Const, chrono::ChFunction_Sine, chrono::ChFunction_Derive, chrono::ChFunction_Mirror, chrono::ChFunction_Noise, chrono::ChFunction_Repeat, chrono::ChFunction_Sigma, chrono::ChFunction_Poly, chrono::ChFunction_Poly345, and chrono::ChFunction_Matlab.
| double chrono::ChFunction::Get_y_dN | ( | double | x, |
| int | derivate | ||
| ) | [virtual] |
Generic derivative: if derivate=0 is like Get_y(), if derivate=1 is like Get_y_dx(), etc. Note: in current release 'derivate' can be only 0,1,2
| virtual double chrono::ChFunction::Get_y_dx | ( | double | x | ) | [virtual] |
Returns the dy/dx derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get dy/dx only from the Get_y() function. (however, if the analytical derivative is known, it may better to implement a custom method).
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Mocap, chrono::ChFunction_Fillet3, chrono::ChFunction_Recorder, chrono::ChFunction_ConstAcc, chrono::ChFunction_Ramp, chrono::ChFunction_Const, chrono::ChFunction_Sine, chrono::ChFunction_Sigma, chrono::ChFunction_Poly, chrono::ChFunction_Poly345, and chrono::ChFunction_Matlab.
| virtual double chrono::ChFunction::Get_y_dxdx | ( | double | x | ) | [virtual] |
Returns the ddy/dxdx double derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get ddy/dxdx only from the Get_y() function. (however, if the analytical derivative is known, it may be better to implement a custom method).
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Mocap, chrono::ChFunction_Fillet3, chrono::ChFunction_Recorder, chrono::ChFunction_ConstAcc, chrono::ChFunction_Ramp, chrono::ChFunction_Const, chrono::ChFunction_Sine, chrono::ChFunction_Sigma, chrono::ChFunction_Poly, chrono::ChFunction_Poly345, and chrono::ChFunction_Matlab.
| virtual int chrono::ChFunction::HandleAccess | ( | int | handle_id, |
| double | mx, | ||
| double | my, | ||
| bool | set_mode | ||
| ) | [virtual] |
Gets the x and y position of handle, given identifier. If set mode, x and y values are stored. Return false if handle not found.
Reimplemented in chrono::ChFunction_Sequence.
| OPT_VARIABLES_START virtual OPT_VARIABLES_END int chrono::ChFunction::HandleNumber | ( | ) | [virtual] |
If the function has some handles (mouse-sensible markers on screen), implement these functions:
Reimplemented in chrono::ChFunction_Sequence.
| void chrono::ChFunction::StreamIN | ( | ChStreamInBinary & | mstream | ) | [virtual] |
Method to allow deserializing a persistent binary archive (ex: a file) into transient data.
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Oscilloscope, chrono::ChFunction_ConstAcc, chrono::ChFunction_Operation, chrono::ChFunction_Mocap, chrono::ChFunction_Jscript, chrono::ChFunction_Integrate, chrono::ChFunction_Fillet3, chrono::ChFunction_Const, chrono::ChFunction_Ramp, chrono::ChFunction_Recorder, chrono::ChFunction_Sigma, chrono::ChFunction_Poly345, chrono::ChFunction_Sine, chrono::ChFunction_Mirror, chrono::ChFunction_Repeat, chrono::ChFunction_Derive, chrono::ChFunction_Poly, chrono::ChFunction_Noise, and chrono::ChFunction_Matlab.
| void chrono::ChFunction::StreamOUT | ( | ChStreamOutAscii & | mstream | ) | [virtual] |
Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Oscilloscope, chrono::ChFunction_ConstAcc, chrono::ChFunction_Operation, chrono::ChFunction_Mocap, chrono::ChFunction_Jscript, chrono::ChFunction_Integrate, chrono::ChFunction_Fillet3, chrono::ChFunction_Const, chrono::ChFunction_Ramp, chrono::ChFunction_Recorder, chrono::ChFunction_Sigma, chrono::ChFunction_Poly345, chrono::ChFunction_Sine, chrono::ChFunction_Mirror, chrono::ChFunction_Repeat, chrono::ChFunction_Derive, chrono::ChFunction_Poly, chrono::ChFunction_Noise, and chrono::ChFunction_Matlab.
| void chrono::ChFunction::StreamOUT | ( | ChStreamOutBinary & | mstream | ) | [virtual] |
Method to allow serializing transient data into a persistent binary archive (ex: a file).
Reimplemented in chrono::ChFunction_Sequence, chrono::ChFunction_Oscilloscope, chrono::ChFunction_ConstAcc, chrono::ChFunction_Operation, chrono::ChFunction_Mocap, chrono::ChFunction_Jscript, chrono::ChFunction_Integrate, chrono::ChFunction_Fillet3, chrono::ChFunction_Const, chrono::ChFunction_Ramp, chrono::ChFunction_Recorder, chrono::ChFunction_Sigma, chrono::ChFunction_Poly345, chrono::ChFunction_Sine, chrono::ChFunction_Mirror, chrono::ChFunction_Repeat, chrono::ChFunction_Derive, chrono::ChFunction_Poly, chrono::ChFunction_Noise, and chrono::ChFunction_Matlab.
CHRONO::ENGINE