public class JointLimitForce extends ModelComponentBase implements ForceComponent
The applied force is nominally linear. If x
and v
are the
coordinate value and speed, then for an upper limit ul
the force is
nominally given by
f = - Ku (x - ul) - Du vwhere
Ku
and Du
are the stiffness and damping coefficients
associated with the upper limit, while for a lower limit ll
it is
f = - Kl (ll - x) - Dl vwhere
Kl
and Dl
are the coefficients for the lower
limit. However, each limit can also be associated with a transition region
tau
. If tau > 0
, then the restoring force is applied more
gradually in the intervals [ul, ul+tau]
(for the upper limit) and
[ll-tau, ll]
(for the lower limit).ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DAMPING |
static double |
DEFAULT_LIMIT |
static double |
DEFAULT_STIFFNESS |
static double |
DEFAULT_TRANSITION |
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
JointLimitForce() |
JointLimitForce(JointCoordinateHandle ch) |
JointLimitForce(java.lang.String name,
JointCoordinateHandle ch) |
Modifier and Type | Method and Description |
---|---|
void |
addPosJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the position Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
addSolveBlocks(SparseNumberedBlockMatrix M)
Adds any needed blocks to a solve matrix in order to accomodate the
Jacobian terms associated with this force effector.
|
void |
addVelJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the velocity Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
applyForces(double t)
Adds forces to the components affected by this force effector at a
particular time.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
int |
getJacobianType()
Returns a code indicating the matrix type that results when the Jacobian
terms of this force effector are added to the solve matrix.
|
double |
getLowerDamping()
Queries the damping parameter for the lower limit restoring force.
|
double |
getLowerLimit()
Queries the lower limit for the joint coordinate.
|
double |
getLowerStiffness()
Queries the stiffness for the lower limit restoring force.
|
double |
getLowerTransition()
Queries the transition region size for the lower limit restoring force.
|
double |
getUpperDamping()
Queries the damping parameter for the upper limit restoring force.
|
double |
getUpperLimit()
Queries the upper limit for the joint coordinate.
|
double |
getUpperStiffness()
Queries the stiffness for the upper limit restoring force.
|
double |
getUpperTransition()
Queries the transition region size for the upper limit restoring force.
|
void |
setLower(double ll,
double k,
double d,
double tau)
Set all the lower limit parameters.
|
void |
setLowerDamping(double d)
Sets the damping parameter for the lower limit restoring force.
|
void |
setLowerLimit(double ll)
Sets the lower limit for the joint coordinate, beyond which a restoring
force will be applied.
|
void |
setLowerStiffness(double k)
Sets the stiffness for the lower limit restoring force.
|
void |
setLowerTransition(double tau)
Sets the transition region size for the lower limit restoring force.
|
void |
setUpper(double ul,
double k,
double d,
double tau)
Set all the upper limit parameters.
|
void |
setUpperDamping(double d)
Sets the damping parameter for the upper limit restoring force.
|
void |
setUpperLimit(double ul)
Sets the upper limit for the joint coordinate, beyond which a restoring
force will be applied.
|
void |
setUpperStiffness(double k)
Sets the stiffness for the upper limit restoring force.
|
void |
setUpperTransition(double tau)
Sets the transition region size for the upper limit restoring force.
|
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
public static final double DEFAULT_LIMIT
public static final double DEFAULT_STIFFNESS
public static final double DEFAULT_DAMPING
public static final double DEFAULT_TRANSITION
public static PropertyList myProps
public JointLimitForce()
public JointLimitForce(JointCoordinateHandle ch)
public JointLimitForce(java.lang.String name, JointCoordinateHandle ch)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public void setUpperLimit(double ul)
infinity
(no upper
limit).ul
- new upper coordinate limit,public double getUpperLimit()
public void setUpperStiffness(double k)
k
- new upper limit stiffness,public double getUpperStiffness()
public void setUpperDamping(double d)
d
- new upper limit dampingpublic double getUpperDamping()
public void setUpperTransition(double tau)
tau
- new upper limit transition regionpublic double getUpperTransition()
public void setLowerLimit(double ll)
-infinity
(no lower
limit).ll
- new lower coordinate limit,public double getLowerLimit()
public void setLowerStiffness(double k)
k
- new lower limit stiffness,public double getLowerStiffness()
public void setLowerDamping(double d)
d
- new lower limit dampingpublic double getLowerDamping()
public void setLowerTransition(double tau)
tau
- new lower limit transition regionpublic double getLowerTransition()
public void setUpper(double ul, double k, double d, double tau)
ul
- upper limitk
- stiffnessd
- damping factortau
- transition region sizepublic void setLower(double ll, double k, double d, double tau)
ll
- upper limitk
- stiffnessd
- damping factortau
- transition region sizepublic void applyForces(double t)
applyForces
in interface ForceEffector
t
- time (seconds)public void addSolveBlocks(SparseNumberedBlockMatrix M)
getSolveIndex
) for all dynamic or attached components affected by this
force effector.addSolveBlocks
in interface ForceEffector
M
- solve matrix to which blocks should be addedpublic void addPosJacobian(SparseNumberedBlockMatrix M, double s)
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addPosJacobian
in interface ForceEffector
M
- solve matrix to which scaled position Jacobian is to be addeds
- scaling factor for position Jacobianpublic void addVelJacobian(SparseNumberedBlockMatrix M, double s)
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addVelJacobian
in interface ForceEffector
M
- solve matrix to which scaled velocity Jacobian is to be addeds
- scaling factor for velocity Jacobianpublic int getJacobianType()
Matrix.SYMMETRIC
or Matrix.POSITIVE_DEFINITE
. The former should be set if adding the Jacobian
terms preserves symmetry, and the latter should be set if positive
definiteness if preserved. Both should be set if there is no Jacobian for
this effector (i.e., the Jacobian methods are not implemented). Matrix
types from all the force effectors are logically and-ed together to
determine the type for the entire solve matrix.getJacobianType
in interface ForceEffector