MBSim |
Project Page |
A spring damper force law between . More...
#include <rotational_spring_damper.h>
Public Member Functions | |
| RelativeRotationalSpringDamper (const std::string &name) | |
| void | updateh (double, int i=0) |
| void | updateg (double) |
| void | updategd (double) |
| void | connect (Frame *frame1, Frame *frame2) |
| Connect the RelativeRotationalSpringDamper to frame1 and frame2. | |
| bool | isActive () const |
| bool | gActiveChanged () |
| virtual bool | isSingleValued () const |
| asks the link if it contains single valued force laws that contribute to the right-hand side vector h | |
| std::string | getType () const |
| void | init (InitStage stage) |
| plots time series header | |
| void | setForceFunction (Function2< double, double, double > *func_) |
| Set function for the torque calculation. | |
| void | setRelativeBody (RigidBody *body_) |
| Set a projection direction for the resulting torque If this function is not set, or frame is NULL, than torque calculated by setForceFunction is applied on the two connected frames in the direction of the two connected frames. | |
| void | plot (double t, double dt=1) |
| plots time dependent data | |
| void | initializeUsingXML (MBXMLUtils::TiXmlElement *element) |
Protected Attributes | |
|
Function2< double, double, double > * | func |
| Frame * | refFrame |
| RigidBody * | body |
| fmatvec::Vec3 | torqueDir |
| fmatvec::Vec3 | WtorqueDir |
Private Attributes | |
| std::string | saved_frameOfReference |
| std::string | saved_ref1 |
| std::string | saved_ref2 |
| fmatvec::Vec | saved_direction |
A spring damper force law between .
This class connects two frames and applies a torque in it, which depends in the relative rotation and velocity between the two frames. ONLY between relative rotational bodies!!!
| bool MBSim::RelativeRotationalSpringDamper::gActiveChanged | ( | ) | [inline, virtual] |
Implements MBSim::Link.
| std::string MBSim::RelativeRotationalSpringDamper::getType | ( | ) | const [inline, virtual] |
Reimplemented from MBSim::LinkMechanics.
| void MBSim::RelativeRotationalSpringDamper::init | ( | InitStage | stage | ) | [virtual] |
| bool MBSim::RelativeRotationalSpringDamper::isActive | ( | ) | const [inline, virtual] |
Implements MBSim::Link.
| virtual bool MBSim::RelativeRotationalSpringDamper::isSingleValued | ( | ) | const [inline, virtual] |
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Reimplemented from MBSim::Link.
| void MBSim::RelativeRotationalSpringDamper::plot | ( | double | t, |
| double | dt = 1 |
||
| ) | [virtual] |
plots time dependent data
| simulation | time |
| simulation | time step size for derivative calculation |
Reimplemented from MBSim::LinkMechanics.
| void MBSim::RelativeRotationalSpringDamper::setForceFunction | ( | Function2< double, double, double > * | func_ | ) | [inline] |
Set function for the torque calculation.
The first input parameter to that function is the relative rotation g between frame2 and frame1. The second input parameter to that function is the relative rotational velocity gd between frame2 and frame1. The return value of that function is used as the torque of the RelativeRotationalSpringDamper.
| void MBSim::RelativeRotationalSpringDamper::setRelativeBody | ( | RigidBody * | body_ | ) |
Set a projection direction for the resulting torque If this function is not set, or frame is NULL, than torque calculated by setForceFunction is applied on the two connected frames in the direction of the two connected frames.
If this function is set, than this torque is first projected in direction dir and then applied on the two connected frames in the projected direction; (!) this might induce violation of the global equality of torques (!). The direction vector dir is given in coordinates of frame refFrame.
1.8.0