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;
Includes internal headers providing declarations for the basic SimTK Core classes,...
Every Simbody header and source file should include this header before any other Simbody header.
Define an assembly condition consisting of a scalar goal and/or a related set of assembly error equat...
Definition AssemblyCondition.h:44
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
const SimbodyMatterSubsystem & getMatterSubsystem() const
Ask the assembler for the MultibodySystem with which it is associated and extract the SimbodyMatterSu...
Definition AssemblyCondition.h:183
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
MatrixBase & resize(int m, int n)
Change the size of this matrix.
Definition MatrixBase.h:773
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition MobilizedBody.h:169
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...
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...
The Mobilizer associated with each MobilizedBody, once modeled, has a specific number of generalized ...
Unique integer type for Subsystem-local q indexing.
This AssemblyCondition requests that a particular generalized coordinate end up with a specified valu...
Definition AssemblyCondition_QValue.h:41
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 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
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
Real getValue() const
Return the currently set value to be used for this generalized coordinate.
Definition AssemblyCondition_QValue.h:53
int getNumEquations(const State &) const
Definition AssemblyCondition_QValue.h:59
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
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
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
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition SimbodyMatterSubsystem.h:133
const MobilizedBody & getMobilizedBody(MobilizedBodyIndex) const
Given a MobilizedBodyIndex, return a read-only (const) reference to the corresponding MobilizedBody w...
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition State.h:280
VectorBase & resize(int m)
Definition VectorBase.h:451
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition Assembler.h:37
unsigned char square(unsigned char u)
Definition Scalar.h:349
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:606