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

 1#example with 1m pendulum, 50kg under gravity
 2nMass = mbs.AddNode(NodePoint2D(referenceCoordinates=[1,0]))
 3oMass = mbs.AddObject(MassPoint2D(physicsMass = 50, nodeNumber = nMass))
 4
 5mMass = mbs.AddMarker(MarkerNodePosition(nodeNumber=nMass))
 6mGround = mbs.AddMarker(MarkerBodyPosition(bodyNumber=oGround, localPosition = [0,0,0]))
 7oDistance = mbs.AddObject(DistanceConstraint(markerNumbers = [mGround, mMass], distance = 1))
 8
 9mbs.AddLoad(Force(markerNumber = mMass, loadVector = [0, -50*9.81, 0]))
10
11#assemble and solve system for default parameters
12mbs.Assemble()
13
14sims=exu.SimulationSettings()
15sims.timeIntegration.generalizedAlpha.spectralRadius=0.7
16mbs.SolveDynamic(sims)
17
18#check result at default integration time
19exudynTestGlobals.testResult = mbs.GetNodeOutput(nMass, exu.OutputVariableType.Position)[0]

Relevant Examples and TestModels with weblink:

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