OpenSim::ActuatorPerturbation Class Reference

#include <ActuatorPerturbation.h>

Inheritance diagram for OpenSim::ActuatorPerturbation:
OpenSim::Object OpenSim::ActuatorPerturbationIndependent

List of all members.

Public Types

enum  PertType { SCALE, DELTA, CONSTANT }
 

Perturbation types.

More...

Public Member Functions

 ActuatorPerturbation (Model *aModel)
 Construct an instance for perturbing actuator forces during an integration.
 ActuatorPerturbation (const ActuatorPerturbation &aActuatorPerturbation)
 Copy constructor.
 ActuatorPerturbation (const std::string &aFileName, bool aUpdateFromXMLNode=true)
 Construct an object from file.
virtual ~ActuatorPerturbation ()
 Destructor.
virtual Objectcopy () const
 Virtual copy constructor.
ActuatorPerturbationoperator= (const ActuatorPerturbation &aActuatorPerturbation)
 Assignment operator.
void setActuator (Actuator *aActuator)
 Set for which actuator a force perturbation should be made.
ActuatorgetActuator () const
 Get for which actuator a force perturbation should be made.
void setAllowNegForce (bool aTrueFalse)
 Set whether it is permissable that a perturbation produces a negative force.
bool getAllowNegForce () const
 Get whether negative force is allowed.
void setPerturbationParameters (PertType aPerturbationType, double aPerturbation)
 Set the perturbation type and the perturbation size.
virtual void setModel (Model &)
 Set a pointer to the model for which this perturbation has been set.
ModelgetModel () const
 Get a pointer to the model for which this perturbation has been set.
void setOn (bool aTrueFalse)
 Turn this perturbation on or off.
bool getOn () const
 Get whether or not this analysis is on.
void setStartTime (double aStartTime)
 Set the time at which to begin executing the perturbation.
double getStartTime () const
 Get the time at which to begin executing the perturbation, expressed in normalized time units, not real time units.
void setEndTime (double aEndTime)
 Set the time at which to end executing the perturbation.
double getEndTime () const
 Get the time at which to end executing the perturbation, expressed in normalized time units, not real time units.
double getPerturbationSize () const
 Get the size of the force perturbation that is made to the action forces.
PertType getPerturbationType () const
 Get the type of the force perturbation that is made to the action forces.
StoragegetForceStorage ()
 Get a pointer to the Storage containing the nominal and perturbed forces.
virtual void reset (const SimTK::State &s)
 Reset the perturbation.

Protected Attributes

Actuator_actuator
 Which actuator.
bool _allowNegForce
 Negative force flag.
double _perturbationSize
 Force perturbation.
PertType _perturbationType
 Type of perturbation.
double _force
 Nominal actuator force.
Storage_forceStore
 Storage for holding nominal and perturbed force.
Model_model
 Model.

Member Enumeration Documentation

Perturbation types.

See setPerturbation().

Enumerator:
SCALE 
DELTA 
CONSTANT 

Constructor & Destructor Documentation

ActuatorPerturbation::ActuatorPerturbation ( Model aModel  ) 

Construct an instance for perturbing actuator forces during an integration.

Parameters:
aModel Model for which actuator forces are to be perturbed.
ActuatorPerturbation::ActuatorPerturbation ( const ActuatorPerturbation aActuatorPerturbation  ) 

Copy constructor.

Parameters:
aActuatorPerturbation ActuatorPerturbation to copy.
ActuatorPerturbation::ActuatorPerturbation ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)

Construct an object from file.

The object is constructed from the root element of the XML document. The type of object is the tag name of the XML root element.

Parameters:
aFileName File name of the document.
ActuatorPerturbation::~ActuatorPerturbation (  )  [virtual]

Destructor.


Member Function Documentation

Object * ActuatorPerturbation::copy (  )  const [virtual]

Virtual copy constructor.

Reimplemented from OpenSim::Object.

Actuator * ActuatorPerturbation::getActuator (  )  const

Get for which actuator a force perturbation should be made.

Returns:
Pointer to the actuator.
bool ActuatorPerturbation::getAllowNegForce (  )  const

Get whether negative force is allowed.

Returns:
allowNegForce Flag
See also:
setAllowNegForce()

Reimplemented in OpenSim::ActuatorPerturbationIndependent.

double ActuatorPerturbation::getEndTime (  )  const

Get the time at which to end executing the perturbation, expressed in normalized time units, not real time units.

Returns:
End time expressed in NORMALIZED time units.
Storage * ActuatorPerturbation::getForceStorage (  ) 

Get a pointer to the Storage containing the nominal and perturbed forces.

Returns:
Pointer to the force storage.
Model * ActuatorPerturbation::getModel (  )  const

Get a pointer to the model for which this perturbation has been set.

Returns:
Pointer to the model.
bool ActuatorPerturbation::getOn (  )  const

Get whether or not this analysis is on.

Returns:
True if on, false if off.
double ActuatorPerturbation::getPerturbationSize (  )  const

Get the size of the force perturbation that is made to the action forces.

Returns:
aPerturbation
ActuatorPerturbation::PertType ActuatorPerturbation::getPerturbationType (  )  const

Get the type of the force perturbation that is made to the action forces.

Returns:
aPerturbationType
double ActuatorPerturbation::getStartTime (  )  const

Get the time at which to begin executing the perturbation, expressed in normalized time units, not real time units.

Returns:
Start time expressed in NORMALIZED time units.
ActuatorPerturbation & ActuatorPerturbation::operator= ( const ActuatorPerturbation aActuatorPerturbation  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

void ActuatorPerturbation::reset ( const SimTK::State &  s  )  [virtual]

Reset the perturbation.

This method resets any internal objects so that a new perturbation series can be run cleanly.

Specifically, for this class, the force storage object is reset (or emptied) so that any new force perturbations are stored at the beginning of the force storage object.

Reimplemented in OpenSim::ActuatorPerturbationIndependent.

void ActuatorPerturbation::setActuator ( Actuator aAct  ) 

Set for which actuator a force perturbation should be made.

Parameters:
aAct Pointer to the actuator.

Reimplemented in OpenSim::ActuatorPerturbationIndependent.

void ActuatorPerturbation::setAllowNegForce ( bool  aTrueFalse  ) 

Set whether it is permissable that a perturbation produces a negative force.

Parameters:
allowNegForce Flag indicates whether a negative force is permitted
void ActuatorPerturbation::setEndTime ( double  aEndTime  ) 

Set the time at which to end executing the perturbation.

Note that the end time should be specified in normalized time units, not in real time units.

Parameters:
aEndTime Time at which the perturbation should end execution in NORMALIZED time units.
void ActuatorPerturbation::setModel ( Model aModel  )  [virtual]

Set a pointer to the model for which this perturbation has been set.

void ActuatorPerturbation::setOn ( bool  aTrueFalse  ) 

Turn this perturbation on or off.

Parameters:
aTureFalse Turns analysis on if "true" and off if "false".
void ActuatorPerturbation::setPerturbationParameters ( PertType  aPerturbationType,
double  aPerturbationSize 
)

Set the perturbation type and the perturbation size.

Three different types of perturbation are allowed, as listed in the enum PertType.

PertType SCALE
The force perturbation (df) that is made is computed by multiplying the action force (f) by the perturbation:
df = perturbation * f

The perturbation factor may be any value; however, a value between 0.0 and 1.0 what is typically used.

PertType DELTA
The force perturbation (df) that is made is computed by adding the perturbation to the the action force (f) by the perturbation:
df = f + perturbation

PertType CONSTANT
The force perturbation (df) that is made is computed by seting the action force (f) equal to the perturbation:
df = perturbation

Parameters:
aPerturbationType Perturbation type.
aPerturbation Perturbation value.
void ActuatorPerturbation::setStartTime ( double  aStartTime  ) 

Set the time at which to begin executing the perturbation.

Note that the start time should be specified in normalized time units, not in real time units.

Parameters:
aStartTime Start time expressed in NORMALIZED time units.

Member Data Documentation

Which actuator.

Negative force flag.

Nominal actuator force.

Storage for holding nominal and perturbed force.

Force perturbation.

Type of perturbation.


The documentation for this class was generated from the following files:

Generated on Sun Sep 25 00:19:46 2011 for OpenSim by  doxygen 1.6.1