Simbody  3.8
Force_LinearBushing.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_
2 #define SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2009-12 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
27 #include "SimTKcommon.h"
28 #include "simbody/internal/Force.h"
29 
36 namespace SimTK {
102 public:
125  const MobilizedBody& body1, const Transform& frameFOnB1,
126  const MobilizedBody& body2, const Transform& frameMOnB2,
127  const Vec6& stiffness, const Vec6& damping);
128 
147  const MobilizedBody& body1,
148  const MobilizedBody& body2,
149  const Vec6& stiffness, const Vec6& damping);
150 
153 
154 
155  //--------------------------------------------------------------------------
169 
170  LinearBushing& setDefaultFrameOnBody1(const Transform& X_B1F);
208 
227  const Vec6& getDefaultStiffness() const;
233  const Vec6& getDefaultDamping() const;
235 
236 
237 
238  //--------------------------------------------------------------------------
255 
256  const LinearBushing& setFrameOnBody1(State& state,
269  const Transform& X_B1F) const;
283  const Transform& X_B2M) const;
296  const Vec6& stiffness) const;
309  const Vec6& damping) const;
310 
320  const Transform& getFrameOnBody1(const State& state) const;
330  const Transform& getFrameOnBody2(const State& state) const;
340  const Vec6& getStiffness(const State& state) const;
350  const Vec6& getDamping(const State& state) const;
352 
353 
354 
355  //--------------------------------------------------------------------------
366 
367  const Vec6& getQ(const State& state) const;
380 
388  const Transform& getX_GF(const State& state) const;
389 
397  const Transform& getX_GM(const State& state) const;
398 
406  const Transform& getX_FM(const State& state) const;
408 
409 
410 
411  //--------------------------------------------------------------------------
422 
423  const Vec6& getQDot(const State& state) const;
436 
448  const SpatialVec& getV_GF(const State& state) const;
449 
461  const SpatialVec& getV_GM(const State& state) const;
462 
475  const SpatialVec& getV_FM(const State& state) const;
477 
478 
479 
480  //--------------------------------------------------------------------------
491 
492  const Vec6& getF(const State& state) const;
506 
516  const SpatialVec& getF_GM(const State& state) const;
517 
528  const SpatialVec& getF_GF(const State& state) const;
530 
531 
532 
533  //--------------------------------------------------------------------------
539 
540  Real getPotentialEnergy(const State& state) const;
549 
560  Real getPowerDissipation(const State& state) const;
561 
575  Real getDissipatedEnergy(const State& state) const;
576 
589  void setDissipatedEnergy(State& state, Real energy) const;
591 
592  // Don't show this in Doxygen.
595  (LinearBushing, LinearBushingImpl, Force);
597 };
598 
599 } // namespace SimTK
600 
601 #endif // SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
Includes internal headers providing declarations for the basic SimTK Core classes,...
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:68
This force element represents a bushing acting to connect a frame F fixed on one body (B1) to a frame...
Definition: Force_LinearBushing.h:101
const Transform & getDefaultFrameOnBody1() const
Return the frame F on body B1 that will be used by default as one of the frames connected by the bush...
const SpatialVec & getV_GF(const State &state) const
Obtain the spatial velocity V_GF giving the velocity of body 1's frame F in the Ground frame.
const LinearBushing & setDamping(State &state, const Vec6 &damping) const
Set the damping coefficients c that will be used for this Bushing when evaluated using this State.
LinearBushing & setDefaultStiffness(const Vec6 &stiffness)
Set the stiffnesses (spring constants) k that will be used by default for this Bushing; these must be...
Real getDissipatedEnergy(const State &state) const
Obtain the total amount of energy dissipated by this Bushing since some arbitrary starting point.
const Transform & getX_GF(const State &state) const
Obtain the spatial transform X_GF giving the location and orientation of body 1's frame F in Ground.
LinearBushing(GeneralForceSubsystem &forces, const MobilizedBody &body1, const Transform &frameFOnB1, const MobilizedBody &body2, const Transform &frameMOnB2, const Vec6 &stiffness, const Vec6 &damping)
Create a LinearBushing between a pair of arbitrary frames, one fixed to each of two bodies.
const SpatialVec & getV_GM(const State &state) const
Obtain the spatial velocity V_GM giving the velocity of body 2's frame M in the Ground frame.
const Transform & getFrameOnBody1(const State &state) const
Return the frame F on body B1 currently being used by this State as one of the frames connected by th...
const Vec6 & getDamping(const State &state) const
Return the damping coefficients c currently being used for this Bushing by this State.
const Vec6 & getDefaultStiffness() const
Return the stiffnesses k that will be used by default for this Bushing.
const Vec6 & getDefaultDamping() const
Return the damping coefficients c that will be used by default for this Bushing.
const SpatialVec & getV_FM(const State &state) const
Obtain the spatial velocity V_FM giving the velocity of body 2's frame M in body 1's frame F,...
const Transform & getX_GM(const State &state) const
Obtain the spatial transform X_GM giving the location and orientation of body 2's frame M in Ground.
const Transform & getFrameOnBody2(const State &state) const
Return the frame M on body B2 currently being used by this State as one of the frames connected by th...
const LinearBushing & setStiffness(State &state, const Vec6 &stiffness) const
Set the stiffnesses (spring constants) k that will be used for this Bushing when evaluated using this...
const SpatialVec & getF_GF(const State &state) const
Return the spatial force F_GF being applied by this Bushing to body 1 at its F frame,...
Real getPowerDissipation(const State &state) const
Obtain the rate at which energy is being dissipated by this Bushing, that is, the power being lost.
const LinearBushing & setFrameOnBody2(State &state, const Transform &X_B2M) const
Set the frame M on body B2 that will be used as one of the frames connected by the bushing when evalu...
LinearBushing(GeneralForceSubsystem &forces, const MobilizedBody &body1, const MobilizedBody &body2, const Vec6 &stiffness, const Vec6 &damping)
Create a LinearBushing connecting the body frames of two bodies.
LinearBushing & setDefaultDamping(const Vec6 &damping)
Set the damping coefficients c that will be used by default for this Bushing; these must be nonnegati...
LinearBushing & setDefaultFrameOnBody2(const Transform &X_B2M)
Set the frame M on body B2 that will be used by default as one of the frames connected by the bushing...
const Vec6 & getStiffness(const State &state) const
Return the stiffnesses (spring constants) k currently being used for this Bushing by this State.
const Transform & getX_FM(const State &state) const
Obtain the spatial transform X_FM giving the location and orientation of body 2's frame M in body 1's...
const Transform & getDefaultFrameOnBody2() const
Return the frame M on body B2 that will be used by default as one of the frames connected by the bush...
LinearBushing()
Default constructor creates an empty handle.
Definition: Force_LinearBushing.h:152
const SpatialVec & getF_GM(const State &state) const
Return the spatial force F_GM being applied by this Bushing to body 2 at its M frame,...
void setDissipatedEnergy(State &state, Real energy) const
Set the accumulated dissipated energy to an arbitrary value.
This is the base class from which all Force element handle classes derive.
Definition: Force.h:50
This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem.
Definition: GeneralForceSubsystem.h:47
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:169
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
This is a fixed-length column vector designed for no-overhead inline computation.
Definition: Vec.h:184
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607