ObjectConnectorGravity
A connector for additing forces due to gravitational fields beween two bodies, which can be used for aerospace and small-scale astronomical problems; 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.
Additional information for ObjectConnectorGravity:
- This
Object
has/provides the following types =Connector
- Requested
Marker
type =Position
- Short name for Python =
ConnectorGravity
- Short name for Python visualization object =
VConnectorGravity
The item ObjectConnectorGravity with type = ‘ConnectorGravity’ has the following parameters:
- name [type = String, default = ‘’]:connector’s unique name
- markerNumbers [\([m0,m1]\tp\), type = ArrayMarkerIndex, default = [ invalid [-1], invalid [-1] ]]:list of markers used in connector
- gravitationalConstant [\(G\), type = Real, default = 6.67430e-11]:gravitational constant [SI:m\(^3\)kg\(^{-1}\)s\(^{-2}\))]; while not recommended, a negative constant gan represent a repulsive force
- mass0 [\(mass_0\), type = UReal, default = 0.]:mass [SI:kg] of object attached to marker \(m0\)
- mass1 [\(mass_1\), type = UReal, default = 0.]:mass [SI:kg] of object attached to marker \(m1\)
- minDistanceRegularization [\(d_{min}\), type = UReal, default = 0.]:distance [SI:m] at which a regularization is added in order to avoid singularities, if objects come close
- activeConnector [type = Bool, default = True]:flag, which determines, if the connector is active; used to deactivate (temporarily) a connector or constraint
- visualization [type = VObjectConnectorGravity]:parameters for visualization of item
The item VObjectConnectorGravity has the following parameters:
- show [type = Bool, default = False]:set true, if item is shown in visualization and false if it is not shown
- drawSize [type = float, default = -1.]:drawing size = diameter of spring; 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 ObjectConnectorGravity
The following output variables are available as OutputVariableType in sensors, Get…Output() and other functions:
Distance
: \(L\)distance between both pointsDisplacement
: \(\Delta\! \LU{0}{{\mathbf{p}}}\)relative displacement between both pointsForce
: \({\mathbf{f}}\)gravity force vector, pointing from marker \(m0\) to marker \(m1\)
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}\)
|
|
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}\)
|
output variables
|
symbol
|
formula
|
---|---|---|
Displacement
|
\(\Delta\! \LU{0}{{\mathbf{p}}}\)
|
\(\LU{0}{{\mathbf{p}}}_{m1} - \LU{0}{{\mathbf{p}}}_{m0}\)
|
Velocity
|
\(\Delta\! \LU{0}{{\mathbf{v}}}\)
|
\(\LU{0}{{\mathbf{v}}}_{m1} - \LU{0}{{\mathbf{v}}}_{m0}\)
|
Distance
|
\(L\)
|
\(|\Delta\! \LU{0}{{\mathbf{p}}}|\)
|
Force
|
\({\mathbf{f}}\)
|
see below
|
Connector forces
The unit vector in force direction reads (if \(L=0\), singularity can be avoided using regularization),
If activeConnector = True
, and \(L>=d_{min}\) the gravitational force is computed as
If activeConnector = True
, and \(L<d_{min}\) the gravitational force is computed as
which results in a regularization for small distances, which is helpful if there are no restrictions in objects to keep apart. If \(d_{min}=0\) and \(L=0\), there a system error is raised.
The vector of the gravitational force applied at both markers, pointing from marker \(m0\) to marker \(m1\), finally reads
The virtual work of the connector force is computed from the virtual displacement
and the virtual work (not the transposed version here, because the resulting generalized forces shall be a column vector,
The generalized (elastic) forces thus result from
and read for the markers \(m0\) and \(m1\),
where \({\mathbf{J}}_{pos,m1}\) represents the derivative of marker \(m1\) w.r.t.its associated coordinates \({\mathbf{q}}_{m1}\), analogously \({\mathbf{J}}_{pos,m0}\).
MINI EXAMPLE for ObjectConnectorGravity
1mass0 = 1e25
2mass1 = 1e3
3r = 1e5
4G = 6.6743e-11
5vInit = np.sqrt(G*mass0/r)
6tEnd = (r*0.5*np.pi)/vInit #quarter period
7node0 = mbs.AddNode(NodePoint(referenceCoordinates = [0,0,0])) #star
8node1 = mbs.AddNode(NodePoint(referenceCoordinates = [r,0,0],
9 initialVelocities=[0,vInit,0])) #satellite
10oMassPoint0 = mbs.AddObject(MassPoint(nodeNumber = node0, physicsMass=mass0))
11oMassPoint1 = mbs.AddObject(MassPoint(nodeNumber = node1, physicsMass=mass1))
12
13m0 = mbs.AddMarker(MarkerNodePosition(nodeNumber=node0))
14m1 = mbs.AddMarker(MarkerNodePosition(nodeNumber=node1))
15
16mbs.AddObject(ObjectConnectorGravity(markerNumbers=[m0,m1],
17 mass0 = mass0, mass1=mass1))
18
19#assemble and solve system for default parameters
20mbs.Assemble()
21sims = exu.SimulationSettings()
22sims.timeIntegration.endTime = tEnd
23mbs.SolveDynamic(sims, solverType=exu.DynamicSolverType.RK67)
24
25#check result at default integration time
26#expect y=x after one period of orbiting (got: 100000.00000000479)
27exudynTestGlobals.testResult = mbs.GetNodeOutput(node1, exu.OutputVariableType.Position)[1]/100000
Relevant Examples and TestModels with weblink:
connectorGravityTest.py (TestModels/)
The web version may not be complete. For details, consider also the Exudyn PDF documentation : theDoc.pdf