Drake
drake::benchmarks::cylinder_torque_free_analytical_solution Namespace Reference

## Functions

void TestDrakeSolutionVsExactSolutionForTorqueFreeCylinder (const drake::systems::RigidBodyPlant< double > &rigid_body_plant, const drake::systems::Context< double > &context, const TorqueFreeCylinderExactSolution &torque_free_cylinder_solution, const double tolerance, drake::systems::ContinuousState< double > *stateDt_drake)
This function tests Drake solution versus an exact solution for torque-free motion of axis-symmetric uniform rigid cylinder B in Newtonian frame/World N, where torque-free means the moment of forces about B's mass center is zero. More...

void IntegrateForwardWithVariableStepRungeKutta3 (const drake::systems::RigidBodyPlant< double > &rigid_body_plant, const double dt_max, const double t_final, const double maximum_absolute_error_per_integration_step, const TorqueFreeCylinderExactSolution &torque_free_cylinder_solution, drake::systems::Context< double > *context, drake::systems::ContinuousState< double > *stateDt_drake)
Numerically integrate rigid body plant's equations of motion from time t = 0 to time t_final with a 3rd-order variable-step Runge-Kutta integrator. More...

void TestDrakeSolutionForSpecificInitialValue (const drake::systems::RigidBodyPlant< double > &rigid_body_plant, const TorqueFreeCylinderExactSolution &torque_free_cylinder_solution, const bool should_numerically_integrate, drake::systems::Context< double > *context, drake::systems::ContinuousState< double > *stateDt_drake)
This function tests Drake's calculation of the time-derivative of the state at an initial condition, and depending on should_numerically_integrate, also tests Drake's numerical integration of the rigid body's equations of motion. More...

void TestDrakeSolutionForVariousInitialValues (const drake::systems::RigidBodyPlant< double > &rigid_body_plant, drake::systems::Context< double > *context, drake::systems::ContinuousState< double > *stateDt_drake)
This function sets up various initial values for Drake to test against an exact solution. More...

GTEST_TEST (uniformSolidCylinderTorqueFree, testA)
This function tests Drake's simulation of the motion of an axis-symmetric rigid body B (uniform cylinder) in a Newtonian frame (World) N. More...

## Function Documentation

 drake::benchmarks::cylinder_torque_free_analytical_solution::GTEST_TEST ( uniformSolidCylinderTorqueFree , testA )

This function tests Drake's simulation of the motion of an axis-symmetric rigid body B (uniform cylinder) in a Newtonian frame (World) N.

Since the only external forces on B are uniform gravitational forces, the moment of all forces about B's mass center is zero ("torque-free"), there exists an exact closed-form analytical solution for B's motion. Specifically, this function tests Drake's solution against an exact solution for: quaternion, angular velocity, and angular acceleration expressed in B (body-frame); position, velocity, and acceleration expressed in N (World). Algorithm from [Kane, 1983] Sections 1.13 and 3.1, Pages 60-62 and 159-169.

Here is the call graph for this function:

 void drake::benchmarks::cylinder_torque_free_analytical_solution::IntegrateForwardWithVariableStepRungeKutta3 ( const drake::systems::RigidBodyPlant< double > & rigid_body_plant, const double dt_max, const double t_final, const double maximum_absolute_error_per_integration_step, const TorqueFreeCylinderExactSolution & torque_free_cylinder_solution, drake::systems::Context< double > * context, drake::systems::ContinuousState< double > * stateDt_drake )

Numerically integrate rigid body plant's equations of motion from time t = 0 to time t_final with a 3rd-order variable-step Runge-Kutta integrator.

Parameters
 [in] rigid_body_plant A reference to the rigid-body system being simulated. [in] dt_max The maximum (fixed) step size taken by the integrator. Note: t_final is not an exact multiple of dt, the final integration step is adjusted. [in] t_final Value of time that signals the simulation to stop. t_final is not required to be an exact multiple of dt_max as the integration step is adjusted as necessary to land at exactly t_final. [in] maximum_absolute_error_per_integration_step Maximum allowable absolute error (for any variable being integrated) for the numerical-integrator's internal time-step (which can shrink or grow). [in] torque_free_cylinder_solution Data and methods calculate exact solution at time t. [in,out] context On entry, context should be properly filled with all input to System (input ports, parameters, time = 0.0, state). On output, context has been changed so its time = t_final and its state has been updated. [out] stateDt_drake On output, stores time-derivatives of state.

Here is the call graph for this function:

Here is the caller graph for this function:

 void drake::benchmarks::cylinder_torque_free_analytical_solution::TestDrakeSolutionForSpecificInitialValue ( const drake::systems::RigidBodyPlant< double > & rigid_body_plant, const TorqueFreeCylinderExactSolution & torque_free_cylinder_solution, const bool should_numerically_integrate, drake::systems::Context< double > * context, drake::systems::ContinuousState< double > * stateDt_drake )

This function tests Drake's calculation of the time-derivative of the state at an initial condition, and depending on should_numerically_integrate, also tests Drake's numerical integration of the rigid body's equations of motion.

Parameters
 [in] rigid_body_plant A reference to the rigid-body system being simulated. [in] torque_free_cylinder_solution Data and methods calculate exact solution at time t. [in] should_numerically_integrate True if also simulate x seconds and check accuracy of simulation results. [in,out] context On entry, context is properly sized for all input to System (input ports, parameters, time, state). On output, context may be changed with specific values of time and state. [out] stateDt_drake On output, stores time-derivatives of state.

Here is the call graph for this function:

Here is the caller graph for this function:

 void drake::benchmarks::cylinder_torque_free_analytical_solution::TestDrakeSolutionForVariousInitialValues ( const drake::systems::RigidBodyPlant< double > & rigid_body_plant, drake::systems::Context< double > * context, drake::systems::ContinuousState< double > * stateDt_drake )

This function sets up various initial values for Drake to test against an exact solution.

For one (mostly arbitrary) initial value, this also tests Drake's numerical integration of the rigid body's equations of motion.

Parameters
 [in] rigid_body_plant A reference to the rigid-body system being simulated. [in,out] context On entry, context is properly sized for all input to System (input ports, parameters, time, state). On output, context may be changed with specific values of time and state. [out] stateDt_drake On output, stores time-derivatives of state.

Here is the call graph for this function:

Here is the caller graph for this function:

 void drake::benchmarks::cylinder_torque_free_analytical_solution::TestDrakeSolutionVsExactSolutionForTorqueFreeCylinder ( const drake::systems::RigidBodyPlant< double > & rigid_body_plant, const drake::systems::Context< double > & context, const TorqueFreeCylinderExactSolution & torque_free_cylinder_solution, const double tolerance, drake::systems::ContinuousState< double > * stateDt_drake )

This function tests Drake solution versus an exact solution for torque-free motion of axis-symmetric uniform rigid cylinder B in Newtonian frame/World N, where torque-free means the moment of forces about B's mass center is zero.

Parameters
 [in] rigid_body_plant A reference to the rigid-body being simulated. [in] context All input to System (input ports, parameters, time, state) with cache for computations dependent on these values. [in] torque_free_cylinder_solution Class that stores initial values, gravity, and methods to calculation the exact solution at time t. [in] tolerance Minimum tolerance required to match results. [out] stateDt_drake On output, stores derivative values at t = t_final.

Here is the call graph for this function:

Here is the caller graph for this function: