```{raw} latex \clearpage ``` (sec-item-loadcoordinate)= # LoadCoordinate Load with scalar value, which is attached to a coordinate-based marker; the load can be used e.g. to apply a force to a single axis of a body, a nodal coordinate of a finite element or a torque to the rotatory DOF of a rigid body. ## Interface - Markers it acts on: those providing `Coordinate`: [](#sec-item-markernodecoordinate), [](#sec-item-markernodeode1coordinate), [](#sec-item-markernoderotationcoordinate), [](#sec-item-markerbodiesrelativetranslationcoordinate), [](#sec-item-markerbodiesrelativerotationcoordinate), [](#sec-item-markerbodycable2dshape), [](#sec-item-markerbodycable2dcoordinates) ## Parameters The parameters of the item; in a dictionary, its type is 'Coordinate': | name | type | size | default | description | |---|---|---|---|---| | **name** | String | | '' | load's unique name | | **markerNumber** | MarkerIndex | | invalid (-1) | marker's number to which load is applied | | **load** | Real | | 0. | (symbol: $f$) scalar load [SI:N]; in case of a user function, this value is ignored | | **loadUserFunction** | LoadCoordinateLoadUserFunction | | 0 | (symbol: $\mathrm{UF} \in \Rcal$) A Python function which defines the time-dependent load and replaces the load; see description below; see also notes on loadFactor and drawing in LoadForceVector! | | **visualization** | VLoadCoordinate | | | parameters for visualization of item | ## Visualization parameters `VLoadCoordinate` has no parameters. ## Drawing The item draws nothing. (description-loadcoordinate)= ## Detailed description ### Load and its frame The scalar $f$ = `load`, or the return value of `loadUserFunction`, acts on one coordinate: the one the coordinate marker selects, e.g. `MarkerNodeCoordinate`. It has no frame of its own: it is a generalized force in the direction of the coordinate, which is a force for a displacement coordinate and a torque-like quantity for a rotation parameter - for Euler parameters or a slope, not a torque in the physical sense, so take care what the coordinate means. ### Generalized forces $$ Q_i = f $$ for the marked coordinate $i$, and zero for all others. The load factor applies as for a force. **Userfunction**: `loadUserFunction(mbs, t, load)` A user function, which computes the scalar load depending on time and the object's `load` parameter. | arguments / return | type or size | description | |---|---|---| | `mbs` | MainSystem | provides MainSystem mbs to which load belongs | | `t` | Real | current time in mbs | | `load` | Real | $\bv$ copied from object; WARNING: this parameter does not work in combination with static computation, as it is changed by the solver over step time | | **return value** | Real | computed load | *Example*: ```python from math import sin, cos, pi #this example uses the object's stored parameter load to compute a time-dependent load def UFload(mbs, t, load): return load*sin(10*(2*pi)*t) n0=mbs.AddNode(Point()) nodeMarker = mbs.AddMarker(MarkerNodeCoordinate(nodeNumber=n0,coordinate=0)) mbs.AddLoad(LoadCoordinate(markerNumber = markerCoordinate, load = 10, loadUserFunction = UFload)) ``` (miniexample-loadcoordinate)= ## Mini example ```python #a load on one coordinate, growing in time through its user function node = mbs.AddNode(Node1D(referenceCoordinates=[0])) mbs.AddObject(ObjectMass1D(nodeNumber=node, mass=1)) mCoord = mbs.AddMarker(MarkerNodeCoordinate(nodeNumber=node, coordinate=0)) def UFload(mbs, t, load): return load*t mbs.AddLoad(LoadCoordinate(markerNumber=mCoord, load=1, loadUserFunction=UFload)) mbs.Assemble() mbs.SolveDynamic() #q = t^3/6 at t=1 exu.sys['testResult'] = mbs.GetNodeOutput(node, exu.OutputVariableType.Coordinates) #0.1667 ``` Examples (Ex) and TestModels (TM) that show this item, with weblink to github: [`tutorialSpringDamper.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/notebooks/tutorialSpringDamper.py) (Ex), [`coordinateSpringDamper.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/coordinateSpringDamper.py) (Ex), [`plotSensorExamples.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/plotSensorExamples.py) (Ex), [`slidercrankWithMassSpring.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/slidercrankWithMassSpring.py) (Ex), [`CoordinateSpringDamperTest.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/TestModels/CoordinateSpringDamperTest.py) (TM)