pterasoftware.movements.operating_point_movement¶
Contains the OperatingPointMovement class.
Classes¶
A class used to contain an OperatingPoint’s movements. |
Module Contents¶
- class pterasoftware.movements.operating_point_movement.OperatingPointMovement(base_operating_point: pterasoftware.operating_point.OperatingPoint, ampVCg__E: float | int = 0.0, periodVCg__E: float | int = 0.0, spacingVCg__E: str | collections.abc.Callable[[float], float] = 'sine', phaseVCg__E: float | int = 0.0)[source]¶
A class used to contain an OperatingPoint’s movements.
Contains the following methods:
max_period: OperatingPointMovement’s longest period of motion.
generate_operating_point_at_time_step: Creates the OperatingPoint at a single time step.
generate_operating_points: Creates the OperatingPoint at each time step, and returns them in a list.
- Parameters:
base_operating_point – The base OperatingPoint from which the OperatingPoint at each time step will be created.
ampVCg__E – The amplitude of the OperatingPointMovement’s changes in its OperatingPoints’ vCg__E parameters. Must be a non negative number (int or float), and is converted to a float internally. The amplitude must be low enough that it doesn’t drive its base value out of the range of valid values. Otherwise, this OperatingPointMovement will try to create OperatingPoints with invalid parameter values. The units are in meters per second. The default is 0.0.
periodVCg__E – The period of the OperatingPointMovement’s changes in its OperatingPoints’ vCg__E parameter. Must be a non negative number (int or float), and is converted to a float internally. It must be 0.0 if ampVCg__E is 0.0 and non zero if not. The units are in seconds. The default is 0.0.
spacingVCg__E – Determines the spacing of the OperatingPointMovement’s change in its OperatingPoints’ vCg__E parameters. Can be “sine”, “uniform”, or a callable custom spacing function. Custom spacing functions are for advanced users and must start at 0.0, return to 0.0 after one period of 2.0 * pi radians, have amplitude of 1.0, be periodic, return finite values only, and accept a float as input and return a float. The custom function is scaled by ampVCg__E, shifted horizontally and vertically by phaseVCg__E and the base value, and have a period set by periodVCg__E. The default is “sine”.
phaseVCg__E – The phase offset of the first time step’s OperatingPoint’s vCg__E parameter relative to the base OperatingPoint’s vCg__E parameter. Must be a number (int or float) in the range (-180.0, 180.0], and will be converted to a float internally. It must be 0.0 if ampVCg__E is 0.0 and non zero if not. The units are in degrees. The default is 0.0.
- Returns:
None
- property max_period: float¶
The longest period of this OperatingPoint’s motion.
- Returns:
The longest period in seconds. If the motion is static, this will be 0.0.
- generate_operating_point_at_time_step(step: int, delta_time: float | int) pterasoftware.operating_point.OperatingPoint¶
Creates the OperatingPoint at a single time step.
- Parameters:
step – The time step index. Must be a non negative int.
delta_time – The time between each time step in seconds. Must be a positive number (int or float).
- Returns:
The OperatingPoint at this time step.
- generate_operating_points(num_steps: int, delta_time: float | int) list[pterasoftware.operating_point.OperatingPoint]¶
Creates the OperatingPoint at each time step, and returns them in a list.
- Parameters:
num_steps – The number of time steps in this movement. It must be a positive int.
delta_time – The time between each time step. It must be a positive number (int or float), and will be converted internally to a float. The units are in seconds.
- Returns:
The list of OperatingPoints associated with this CoreOperatingPointMovement.