Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

suActuatorPerturbation Class Reference

A derivatives callback used for perturbing the actuator forces during a simulation. More...

#include <suActuatorPerturbation.h>

Inheritance diagram for suActuatorPerturbation:

rdDerivCallback rdCallback rdObject suActuatorPerturbationIndependent List of all members.

Public Types

enum  PertType { SCALE, DELTA, CONSTANT }
 Perturbation types. More...


Public Member Functions

 suActuatorPerturbation (rdModel *aModel)
 Construct a derivative callback instance for perturbing actuator forces during an integration.

virtual ~suActuatorPerturbation ()
 Destructor.

void setActuator (int aActuatorIndex)
 Set for which actuator a force perturbation should be made.

int getActuator () 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 setPerturbation (PertType aPerturbationType, double aPerturbation)
 Set the perturbation type and the perturbation size.

double getPerturbation () 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.

rdStoragegetForceStorage ()
 Get a pointer to the rdStorage containing the nominal and perturbed force.

void reset ()
 Reset the perturbation callback.

virtual void computeActuation (double aT, double *aX, double *aY)
 Callback called right after actuation has been computed by the model.

virtual void applyActuation (double aT, double *aX, double *aY)
 Callback called right after actuation has been applied by the model.


Protected Attributes

int _actuator
 Which actuator.

bool _allowNegForce
 Negative force flag *.

double _perturbation
 Force perturbation.

PertType _perturbationType
 Type of perturbation.

double _force
 Nominal actuator force.

rdStorage_forceStore
 Storage for holding nominal and perturbed force.


Private Member Functions

void setNull ()
 Set member variables to approprate NULL values.


Detailed Description

A derivatives callback used for perturbing the actuator forces during a simulation.

Author:
Frank C. Anderson, Saryn R. Goldberg
Version:
1.0


Member Enumeration Documentation

enum suActuatorPerturbation::PertType
 

Perturbation types.

See setPerturbation().


Constructor & Destructor Documentation

suActuatorPerturbation::suActuatorPerturbation rdModel aModel  ) 
 

Construct a derivative callback instance for perturbing actuator forces during an integration.

Parameters:
aModel Model for which actuator forces are to be perturbed.


Member Function Documentation

void suActuatorPerturbation::applyActuation double  aT,
double *  aX,
double *  aY
[virtual]
 

Callback called right after actuation has been applied by the model.

The nominal atuator force is restored.

Reimplemented from rdDerivCallback.

Reimplemented in suActuatorPerturbationIndependent.

void suActuatorPerturbation::computeActuation double  aT,
double *  aX,
double *  aY
[virtual]
 

Callback called right after actuation has been computed by the model.

The nominal atuator force is recorded so that it can be restored, and the actuator force is replaced by its perturbed value.

Parameters:
aT Real time.
aX Controls.
aY States.

Reimplemented from rdDerivCallback.

Reimplemented in suActuatorPerturbationIndependent.

int suActuatorPerturbation::getActuator  )  const
 

Get for which actuator a force perturbation should be made.

Returns:
Actuator to which force is applied..

bool suActuatorPerturbation::getAllowNegForce  )  const
 

Get whether negative force is allowed.

Returns:
allowNegForce Flag
See also:
setAllowNegForce()

rdStorage * suActuatorPerturbation::getForceStorage  ) 
 

Get a pointer to the rdStorage containing the nominal and perturbed force.

Returns:
Pointer to the forceStorage

double suActuatorPerturbation::getPerturbation  )  const
 

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

Returns:
aPerturbation

suActuatorPerturbation::PertType suActuatorPerturbation::getPerturbationType  )  const
 

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

Returns:
aPerturbationType

void suActuatorPerturbation::reset  ) 
 

Reset the perturbation callback.

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 suActuatorPerturbationIndependent.

void suActuatorPerturbation::setActuator int  aActuatorIndex  ) 
 

Set for which actuator a force perturbation should be made.

Parameters:
aIndex Index of the actuator.

void suActuatorPerturbation::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 suActuatorPerturbation::setPerturbation PertType  aPerturbationType,
double  aPerturbation
 

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.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:13 2003 for Simulation Software by doxygen1.3