Simbody
3.4 (development)
|
This Measure tracks extreme values attained by the elements of its source operand since the last initialize() call or explicit call to setValue(). More...
#include <Measure.h>
Classes | |
class | Implementation |
Public Member Functions | |
SimTK_MEASURE_HANDLE_PREAMBLE (Extreme, Measure_< T >) | |
Extreme (Subsystem &sub, const Measure_< T > &operand, Operation op=MaxAbs) | |
Default behavior for the Extreme measure is to find the operand's value that is of maximum absolute value. | |
Extreme & | setOperation (Operation op) |
Set the operation to be performed. | |
Operation | getOperation () const |
Return the operation currently being performed by this measure. | |
Real | getTimeOfExtremeValue (const State &state) const |
Return the time at which the reported extreme value first occurred. | |
void | setValue (State &s, const T &value) const |
const Measure_< T > & | getOperandMeasure () const |
Extreme & | setOperandMeasure (const Measure_< T > &s) |
SimTK_MEASURE_HANDLE_POSTSCRIPT (Extreme, Measure_< T >) |
This Measure tracks extreme values attained by the elements of its source operand since the last initialize() call or explicit call to setValue().
The extreme is either minimum or maximum and may be determined by the actual or absolute value of the operand. In any case the value of the Extreme measure is the actual extreme value of the operand, not its absolute value.
The template type T must be the same as the template type of the operand measure. If T is a Vec or Vector type, each element is treated separately.
Normally Extreme is not used directly; it is the common implementation underlying the Minimum, Maximum, MinAbs, and MaxAbs measures.
Information available from this Measure:
The time derivative fdot of f(t)=min_t0_t(s(t')) where s is the source measure and t0 <= t' <= t is
fdot(t) = s(t) < f(ti) && sdot(t) < 0 ? sdot(t) : 0
where ti is the time at the start of the current step.
At the start of a continuous interval, the updated value (if any) replaces the stored value.
If the time derivative of the source operand is available, the measure will arrange to ensure precise isolation of the minimum values by defining a triggered event that watches for negative-to-positive sign changes of the derivative. Then if you output reporting data upon the occurrence of triggered events (as well as your regularly scheduled output) your data will include the precise minimum (to within a specifiable isolation time window).
Additional information available in this case:
SimTK::Measure_< T >::Extreme::Extreme | ( | Subsystem & | sub, |
const Measure_< T > & | operand, | ||
Operation | op = MaxAbs |
||
) | [inline] |
Default behavior for the Extreme measure is to find the operand's value that is of maximum absolute value.
You can change that to minimum and/or actual value.
SimTK::Measure_< T >::Extreme::SimTK_MEASURE_HANDLE_PREAMBLE | ( | Extreme | , |
Measure_< T > | |||
) |
Extreme& SimTK::Measure_< T >::Extreme::setOperation | ( | Operation | op | ) | [inline] |
Set the operation to be performed.
The default operation is MaxAbs.
Operation SimTK::Measure_< T >::Extreme::getOperation | ( | ) | const [inline] |
Return the operation currently being performed by this measure.
Real SimTK::Measure_< T >::Extreme::getTimeOfExtremeValue | ( | const State & | state | ) | const [inline] |
Return the time at which the reported extreme value first occurred.
This is the current time if the operand is at its extreme value now, otherwise it is the time that the extreme value first occurred during a time stepping study. The state must be realized to the level required to evaluate the operand measure.
void SimTK::Measure_< T >::Extreme::setValue | ( | State & | s, |
const T & | value | ||
) | const [inline] |
const Measure_<T>& SimTK::Measure_< T >::Extreme::getOperandMeasure | ( | ) | const [inline] |
Extreme& SimTK::Measure_< T >::Extreme::setOperandMeasure | ( | const Measure_< T > & | s | ) | [inline] |
SimTK::Measure_< T >::Extreme::SimTK_MEASURE_HANDLE_POSTSCRIPT | ( | Extreme | , |
Measure_< T > | |||
) |