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

suActuatorPerturbationIndependent Class Reference

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

#include <suActuatorPerturbationIndependent.h>

Inheritance diagram for suActuatorPerturbationIndependent:

suActuatorPerturbation rdDerivCallback rdCallback rdObject List of all members.

Public Member Functions

 suActuatorPerturbationIndependent (rdModel *aModel)
 Construct a derivative callback instance for perturbing actuator forces during an integration while forcing all other muscles to exert their nominal force.

virtual ~suActuatorPerturbationIndependent ()
 Destructor.

void setRecordUnperturbedForces (bool aTrueFalse)
 Set whether to record unperturbed forces or to apply a force perturbation.

bool getRecordUnperturbedForces ()
 Get whether to record unperturbed forces or to apply a force perturbation.

rdStoragegetUnperturbedForceStorage ()
 Get a pointer to the rdStorage containing the unperturbed forces.

rdStoragegetPerturbedForceStorage ()
 Get a pointer to the rdStorage containing the perturbed forces.

void reset ()
 Set the step counter to zero and reset the perturbed force storage.

int getStep ()
 Get the current value of the step counter.

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

rdStorage_unperturbedForceStorage
 Storage for holding unperturbed forces.

rdStorage_perturbedForceStorage
 Storage for holding perturbed forces.

bool _recordUnperturbedForces
 Flag that determines whether the nominal forces should be recorded.

double * _forces
 Vector of nominal forces at current time step.

int _step
 Counter to track the number of integration steps.


Private Member Functions

void setNull ()
 Set member data to null values.

void constructColumnLabels ()
 Construct the column labels.

void constructDescription ()
 Construct a description.


Detailed Description

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

The "Independent" in the name refers to the fact that all of the unperturbed muscles are forced to exert the force that they did during the nominal simulation during which they were recorded (ie, the intrinsic properties of the muscles are not taken into account). This is also true for the perturbed muscle - the perturbation is made to the nominal force without taking into account the intrinsic properties of the muscle. NOTES: When you use this callBack to make a perturbation the actuator force, this change in the force IS NOT recoreded in the state file. If you want to run an induced accleration analysis using results from a perturbation, you must first alter the states field to accurately reflect the changes made to the forces.

This callBack requires that two unperturbed integration be performed prior to running a perturbation. The first is to establish the correct number of timesteps used in the simulation. The integrator should be set to use the existing DTVector prior to running the second unperturbed simulation, during which the unperturbed forces should be recorded. The user is responsible for running these unperturbed integrations.The callBack should be reset between running simulations.

This callBack will only work properly when the integration start time is t = 0.0.

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

Todo:
Make the manager a global static variable so that any class can get the manager and query it for information. For example, this class would like to know whether the integrator has been set to use a specified set of time steps. If the manager were available, the integrator could be gotten and queried for this information.


Constructor & Destructor Documentation

suActuatorPerturbationIndependent::suActuatorPerturbationIndependent rdModel aModel  ) 
 

Construct a derivative callback instance for perturbing actuator forces during an integration while forcing all other muscles to exert their nominal force.

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


Member Function Documentation

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

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

The perturbed actuator force is recorded and then the unperturbed actuator force is restored.

Reimplemented from suActuatorPerturbation.

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

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

The nominal actuator 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 suActuatorPerturbation.

rdStorage * suActuatorPerturbationIndependent::getPerturbedForceStorage  ) 
 

Get a pointer to the rdStorage containing the perturbed forces.

Returns:
Pointer to the perturbed force storage.

bool suActuatorPerturbationIndependent::getRecordUnperturbedForces  ) 
 

Get whether to record unperturbed forces or to apply a force perturbation.

It is the user's responsibility to ensure that, during the first run of the simulation, this flag is set to "true" to record the forces that can be used during the second run when the this flag is set to "false" and the forces are perturbed.

Returns:
True if set to record unperturbed forces; false otherwise.

int suActuatorPerturbationIndependent::getStep  ) 
 

Get the current value of the step counter.

Returns:
The current integrator step value.

rdStorage * suActuatorPerturbationIndependent::getUnperturbedForceStorage  ) 
 

Get a pointer to the rdStorage containing the unperturbed forces.

Returns:
Pointer to the unperturbed force storage.

void suActuatorPerturbationIndependent::setRecordUnperturbedForces bool  aTrueFalse  ) 
 

Set whether to record unperturbed forces or to apply a force perturbation.

It is the user's responsibility to ensure that, during the first run of the simulation, this flag is set to "true" to record the forces that can be used during the second run when the this flag is set to "false" and the forces are perturbed.

Parameters:
aTrueFalse Flag to indicate whether forces should be recorded (true) or perturbed (false).


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