Skip to content

Latest commit

 

History

History
170 lines (106 loc) · 6.61 KB

ObjectConnectorDistance.rst

File metadata and controls

170 lines (106 loc) · 6.61 KB

ObjectConnectorDistance

Connector which enforces constant or prescribed distance between two bodies/nodes.

Additional information for ObjectConnectorDistance:

  • This Object has/provides the following types = Connector, Constraint
  • Requested Marker type = Position
  • Short name for Python = DistanceConstraint
  • Short name for Python visualization object = VDistanceConstraint

The item ObjectConnectorDistance with type = 'ConnectorDistance' has the following parameters:

  • name [type = String, default = '']:
    constraints's unique name
  • markerNumbers [[m0,m1]\tp, type = ArrayMarkerIndex, default = [ invalid [-1], invalid [-1] ]]:
    list of markers used in connector
  • distance [d_0, type = PReal, default = 0.]:
    prescribed distance [SI:m] of the used markers; must by greater than zero
  • activeConnector [type = Bool, default = True]:
    flag, which determines, if the connector is active; used to deactivate (temporarily) a connector or constraint
  • visualization [type = VObjectConnectorDistance]:
    parameters for visualization of item

The item VObjectConnectorDistance has the following parameters:

  • show [type = Bool, default = True]:
    set true, if item is shown in visualization and false if it is not shown
  • drawSize [type = float, default = -1.]:
    drawing size = link size; size == -1.f means that default connector size is used
  • color [type = Float4, default = [-1.,-1.,-1.,-1.]]:
    RGBA connector color; if R==-1, use default color

DESCRIPTION of ObjectConnectorDistance

The following output variables are available as OutputVariableType in sensors, Get...Output() and other functions:

  • Displacement: \LU{0}{\Delta{\mathbf{p}}}
    relative displacement in global coordinates
  • Velocity: \LU{0}{\Delta{\mathbf{v}}}
    relative translational velocity in global coordinates
  • Distance: |\LU{0}{\Delta{\mathbf{p}}}|
    distance between markers (should stay constant; shows constraint deviation)
  • Force: \lambda_0
    joint force (=scalar Lagrange multiplier)

Definition of quantities

intermediate variables
symbol
description
marker m0 position
\LU{0}{{\mathbf{p}}}_{m0}
current global position which is provided by marker m0
marker m1 position
\LU{0}{{\mathbf{p}}}_{m1}
accordingly
marker m0 velocity
\LU{0}{{\mathbf{v}}}_{m0}
current global velocity which is provided by marker m0
marker m1 velocity
\LU{0}{{\mathbf{v}}}_{m1}
accordingly
relative displacement
\LU{0}{\Delta{\mathbf{p}}}
\LU{0}{{\mathbf{p}}}_{m1} - \LU{0}{{\mathbf{p}}}_{m0}
relative velocity
\LU{0}{\Delta{\mathbf{v}}}
\LU{0}{{\mathbf{v}}}_{m1} - \LU{0}{{\mathbf{v}}}_{m0}
algebraicVariable
\lambda_0
Lagrange multiplier = force in constraint

Connector forces constraint equations

If activeConnector = True, the index 3 algebraic equation reads

\left|\LU{0}{\Delta{\mathbf{p}}}\right| - d_0 = 0

Due to the fact that the force direction is given by

\frac{1}{|\LU{0}{\Delta{\mathbf{p}}}|}\LU{0}{\Delta{\mathbf{p}}} ,

the prescribed distance d_0 may not be zero. This would, otherwise, result in a change of the number of constraints. The index 2 (velocity level) algebraic equation reads

\left(\frac{\LU{0}{\Delta{\mathbf{p}}}}{\left|\LU{0}{\Delta{\mathbf{p}}}\right|}\right)\tp \Delta{\mathbf{v}} = 0

if activeConnector = False, the algebraic equation reads

\lambda_0 = 0

MINI EXAMPLE for ObjectConnectorDistance

#example with 1m pendulum, 50kg under gravity
nMass = mbs.AddNode(NodePoint2D(referenceCoordinates=[1,0]))
oMass = mbs.AddObject(MassPoint2D(physicsMass = 50, nodeNumber = nMass))

mMass = mbs.AddMarker(MarkerNodePosition(nodeNumber=nMass))
mGround = mbs.AddMarker(MarkerBodyPosition(bodyNumber=oGround, localPosition = [0,0,0]))
oDistance = mbs.AddObject(DistanceConstraint(markerNumbers = [mGround, mMass], distance = 1))

mbs.AddLoad(Force(markerNumber = mMass, loadVector = [0, -50*9.81, 0]))

#assemble and solve system for default parameters
mbs.Assemble()

sims=exu.SimulationSettings()
sims.timeIntegration.generalizedAlpha.spectralRadius=0.7
mbs.SolveDynamic(sims)

#check result at default integration time
exudynTestGlobals.testResult = mbs.GetNodeOutput(nMass, exu.OutputVariableType.Position)[0]

Relevant Examples and TestModels with weblink:

HydraulicActuatorStaticInitialization.py (Examples/), pendulum2Dconstraint.py (Examples/), pendulumIftommBenchmark.py (Examples/), fourBarMechanismTest.py (TestModels/), coordinateVectorConstraint.py (TestModels/), coordinateVectorConstraintGenericODE2.py (TestModels/), modelUnitTests.py (TestModels/), PARTS_ATEs_moving.py (TestModels/)

The web version may not be complete. For details, consider also the Exudyn PDF documentation : theDoc.pdf