trep
- param system
An instance of
System
to add the variable to.- param name
A string that uniquely identifies the input variable.
An Input
instance represents a single variable in the input vector, u, of a mechanical system. Inputs are used by Force
to apply non-conservative forcing to the system (e.g, a torque or body wrench)
Input variables are created automatically by implementations of Force
when needed, so you do not need to create them directly unless defining a new force type. In that case, they should be created using Force._create_input()
.
If a name is provided, it can be used to identify and retrieve input variables.
The current value of a single input variable can be accessed directly (u
) or through System
to access all input variables at once (System.u
).
Warning
Currently trep
does not enforce unique names for input variables. It is recommended to provide a unique name for every Input
so they can be unambiguously retrieved by System.get_input
.
Input.u
The current value of the input.
Input.system
The system that owns this input variable.
(read only)
Input.force
The force that uses this input variable.
(read only)
Input.name
The name of this input variable or None
.
Input.index
The index of the input in System.inputs
.