```{raw} latex \clearpage ``` (sec-item-objectconnectorgravity)= # ObjectConnectorGravity A connector for additing forces due to gravitational fields beween two bodies, which can be used for aerospace and small-scale astronomical problems. NOTE: DO NOT USE this connector for adding gravitational forces (loads), which should be using LoadMassProportional, which is acting global and always in the same direction. ## Interface - Python names: `ObjectConnectorGravity` or `ConnectorGravity`, and `VConnectorGravity` for its visualization - Markers it acts on: those providing `Position`: [](#sec-item-markerbodyposition), [](#sec-item-markerbodyrigid), [](#sec-item-markernodeposition), [](#sec-item-markernoderigid), [](#sec-item-markersuperelementposition), [](#sec-item-markersuperelementrigid), [](#sec-item-markerkinematictreerigid) ## Parameters The parameters of the item; in a dictionary, its type is 'ConnectorGravity': | name | type | size | default | description | |---|---|---|---|---| | **name** | String | | '' | connector's unique name | | **markerNumbers** | ArrayMarkerIndex | | [ invalid (-1), invalid (-1) ] | (symbol: $[m0,m1]\tp$) list of markers used in connector | | **gravitationalConstant** | Real | | 6.6743e-11 | (symbol: $G$) gravitational constant [SI:m$^3$kg$^{-1}$s$^{-2}$)]; while not recommended, a negative constant gan represent a repulsive force | | **mass0** | UReal | | 0. | (symbol: $mass_0$) mass [SI:kg] of object attached to marker $m0$ | | **mass1** | UReal | | 0. | (symbol: $mass_1$) mass [SI:kg] of object attached to marker $m1$ | | **minDistanceRegularization** | UReal | | 0. | (symbol: $d_{min}$) distance [SI:m] at which a regularization is added in order to avoid singularities, if objects come close | | **activeConnector** | Bool | | True | flag, which determines, if the connector is active; used to deactivate (temporarily) a connector or constraint | | **visualization** | VObjectConnectorGravity | | | parameters for visualization of item | ## Visualization parameters The parameters of `VObjectConnectorGravity`, given as `visualization`: | name | type | size | default | description | |---|---|---|---|---| | **show** | Bool | | False | set true to draw a line between the two markers, e.g. to see which bodies attract each other | | **color** | Float4 | 4 | [-1.,-1.,-1.,-1.] | RGBA connector color; if R==-1, use default color | ## Drawing Drawn as [all connectors](#sec-drawing-objectsconnector); if shown - `show` is False by default -, a line between the markers. ## Output variables Available as `OutputVariableType` in sensors, `Get...Output()` and other functions: ```{tabularcolumns} \Y{0.25}\Y{0.25}\Y{0.5} ``` | output variable | symbol | description | |---|---|---| | Distance | $L$ | distance between both points | | Displacement | $\Delta\! \LU{0}{\pv}$ | relative displacement between both points | | Force | $\fv$ | gravity force vector, pointing from marker $m0$ to marker $m1$ | | PotentialEnergy | $V = -\frac{G m_0 m_1}{L}$ | gravitational potential, zero at infinite distance; below minDistanceRegularization $r$ the potential of the regularized force, $V = -\frac{G m_0 m_1}{r}\left(1 + \frac{\pi}{4} - \arctan\frac{2L - r}{r}\right)$; zero if the connector is not active | (description-objectconnectorgravity)= ## Detailed description ### Definition of quantities | intermediate variables | symbol | description | |---|---|---| | marker m0 position | $\LU{0}{\pv}_{m0}$ | current global position which is provided by marker m0 | | marker m1 position | $\LU{0}{\pv}_{m1}$ | | | marker m0 velocity | $\LU{0}{\vv}_{m0}$ | current global velocity which is provided by marker m0 | | marker m1 velocity | $\LU{0}{\vv}_{m1}$ | | | output variables | symbol | formula | |---|---|---| | Displacement | $\Delta\! \LU{0}{\pv}$ | $\LU{0}{\pv}_{m1} - \LU{0}{\pv}_{m0}$ | | Velocity | $\Delta\! \LU{0}{\vv}$ | $\LU{0}{\vv}_{m1} - \LU{0}{\vv}_{m0}$ | | Distance | $L$ | $\vert\Delta\! \LU{0}{\pv}\vert$ | | Force | $\fv$ | see below | ### Connector forces The unit vector in force direction reads (if $L=0$, singularity can be avoided using regularization), $$ \vv_{f} = \frac{1}{L} \Delta\! \LU{0}{\pv} $$ If `activeConnector = True`, and $L>=d_{min}$ the gravitational force is computed as $$ f_G = - G \frac{mass_0 \cdot mass_1}{L^2} $$ If `activeConnector = True`, and $L