1 #ifndef SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_ 2 #define SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_ 49 mobodIndex(mbx), qIndex(qx), value(value) {}
64 error[0] = mobod.
getOneQ(state, qIndex) - value;
81 if (thisFreeIx.isValid())
108 if (thisFreeIx.isValid())
109 grad[thisFreeIx] = mobod.
getOneQ(state, qIndex) - value;
122 #endif // SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_
Real getOneQ(const State &state, int which) const
Return one of the generalized coordinates q from this mobilizer's partition of the matter subsystem's...
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
QIndex getFirstQIndex(const State &state) const
Return the global QIndex of the first q for this mobilizer; all the q's range from getFirstQIndex() t...
int getNumEquations(const State &) const
Definition: AssemblyCondition_QValue.h:59
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
Every Simbody header and source file should include this header before any other Simbody header...
const MobilizedBody & getMobilizedBody(MobilizedBodyIndex) const
Given a MobilizedBodyIndex, return a read-only (const) reference to the corresponding MobilizedBody w...
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:593
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:276
unsigned char square(unsigned char u)
Definition: Scalar.h:351
const SimbodyMatterSubsystem & getMatterSubsystem() const
Ask the assembler for the MultibodySystem with which it is associated and extract the SimbodyMatterSu...
Definition: AssemblyCondition.h:183
QValue(MobilizedBodyIndex mbx, MobilizerQIndex qx, Real value)
Construct an assembly condition that requests that the specified generalized coordinate be brought to...
Definition: AssemblyCondition_QValue.h:46
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
#define OVERRIDE_11
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:267
void setValue(Real newValue)
Change the value to be used for this generalized coordinate; this can be done repeatedly during track...
Definition: AssemblyCondition_QValue.h:56
Unique integer type for Subsystem-local q indexing.
int calcGoal(const State &state, Real &goal) const override
Calculate the current contribution (>= 0) of this assembly condition to the goal value that is being ...
Definition: AssemblyCondition_QValue.h:88
int calcErrorJacobian(const State &state, Matrix &J) const override
Override to supply an analytic Jacobian for the assembly errors returned by calcErrors().
Definition: AssemblyCondition_QValue.h:69
int getNumFreeQs() const
Ask the assembler how many free q's there are; only valid after initialization but does not invoke in...
Definition: AssemblyCondition.h:167
The Mobilizer associated with each MobilizedBody, once modeled, has a specific number of generalized ...
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:167
Define an assembly condition consisting of a scalar goal and/or a related set of assembly error equat...
Definition: AssemblyCondition.h:44
int calcErrors(const State &state, Vector &error) const override
Calculate the amount by which this assembly condition is violated by the q values in the given state...
Definition: AssemblyCondition_QValue.h:60
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:133
int calcGoalGradient(const State &state, Vector &grad) const override
Override to supply an analytic gradient for this assembly condition's goal.
Definition: AssemblyCondition_QValue.h:96
This AssemblyCondition requests that a particular generalized coordinate end up with a specified valu...
Definition: AssemblyCondition_QValue.h:41
Assembler::FreeQIndex getFreeQIndexOfQ(QIndex qx) const
Ask the assembler where to find the free q (if any) that corresponds to a given q in the State; only ...
Definition: AssemblyCondition.h:176
Real getValue() const
Return the currently set value to be used for this generalized coordinate.
Definition: AssemblyCondition_QValue.h:53