pterasoftware.movements.wing_cross_section_movement¶
Contains the WingCrossSectionMovement class.
Classes¶
A class used to contain a WingCrossSection’s movement. |
Module Contents¶
- class pterasoftware.movements.wing_cross_section_movement.WingCrossSectionMovement(base_wing_cross_section: pterasoftware.geometry.wing_cross_section.WingCrossSection, ampLp_Wcsp_Lpp: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), periodLp_Wcsp_Lpp: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), spacingLp_Wcsp_Lpp: numpy.ndarray | collections.abc.Sequence[str | collections.abc.Callable[[float], float]] = ('sine', 'sine', 'sine'), phaseLp_Wcsp_Lpp: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), ampAngles_Wcsp_to_Wcs_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), periodAngles_Wcsp_to_Wcs_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), spacingAngles_Wcsp_to_Wcs_ixyz: numpy.ndarray | collections.abc.Sequence[str | collections.abc.Callable[[float], float]] = ('sine', 'sine', 'sine'), phaseAngles_Wcsp_to_Wcs_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0))[source]¶
A class used to contain a WingCrossSection’s movement.
Contains the following methods:
__deepcopy__: Creates a deep copy of this WingCrossSectionMovement.
all_periods: All unique non zero periods from this WingCrossSectionMovement.
max_period: WingCrossSectionMovement’s longest period of motion.
generate_wing_cross_section_at_time_step: Creates the WingCrossSection at a single time step.
generate_wing_cross_sections: Creates the WingCrossSection at each time step, and returns them in a list.
- Parameters:
base_wing_cross_section – The base WingCrossSection from which the WingCrossSection at each time step will be created.
ampLp_Wcsp_Lpp – An array-like object of non negative numbers (int or float) with shape (3,) representing the amplitudes of the WingCrossSectionMovement’s changes in its WingCrossSections’ Lp_Wcsp_Lpp parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each amplitude must be low enough that it doesn’t drive its base value out of the range of valid values. Otherwise, this WingCrossSectionMovement will try to create WingCrossSections with invalid parameter values. The units are in meters. The default is (0.0, 0.0, 0.0).
periodLp_Wcsp_Lpp – An array-like object of non negative numbers (int or float) with shape (3,) representing the periods of the WingCrossSectionMovement’s changes in its WingCrossSections’ Lp_Wcsp_Lpp parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each element must be 0.0 if the corresponding element in ampLp_Wcsp_Lpp is 0.0 and non zero if not. The units are in seconds. The default is (0.0, 0.0, 0.0).
spacingLp_Wcsp_Lpp – An array-like object of strs or callables with shape (3,) representing the spacing of the WingCrossSectionMovement’s changes in its WingCrossSections’ Lp_Wcsp_Lpp parameters. Can be a tuple, list, or ndarray. Each element can be the str “sine”, the str “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. Custom functions are scaled by ampLp_Wcsp_Lpp, shifted horizontally and vertically by phaseLp_Wcsp_Lpp and the base value, and have a period set by periodLp_Wcsp_Lpp. The default is (“sine”, “sine”, “sine”).
phaseLp_Wcsp_Lpp – An array-like object of numbers (int or float) with shape (3,) representing the phase offsets of the elements in the first time step’s WingCrossSection’s Lp_Wcsp_Lpp parameter relative to the base WingCrossSection’s Lp_Wcsp_Lpp parameter. Can be a tuple, list, or ndarray. Elements must lie in the range (-180.0, 180.0]. Each element must be 0.0 if the corresponding element in ampLp_Wcsp_Lpp is 0.0 and non zero if not. Values are converted to floats internally. The units are in degrees. The default is (0.0, 0.0, 0.0).
ampAngles_Wcsp_to_Wcs_ixyz – An array-like object of non negative numbers (int or float) with shape (3,) representing the amplitudes of the WingCrossSectionMovement’s changes in its WingCrossSections’ angles_Wcsp_to_Wcs_ixyz parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each amplitude must be low enough that it doesn’t drive its base value out of the range of valid values. Otherwise, this WingCrossSectionMovement will try to create WingCrossSections with invalid parameter values. The units are in degrees. The default is (0.0, 0.0, 0.0).
periodAngles_Wcsp_to_Wcs_ixyz – An array-like object of non negative numbers (int or float) with shape (3,) representing the periods of the WingCrossSectionMovement’s changes in its WingCrossSections’ angles_Wcsp_to_Wcs_ixyz parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each element must be 0.0 if the corresponding element in ampAngles_Wcsp_to_Wcs_ixyz is 0.0 and non zero if not. The units are in seconds. The default is (0.0, 0.0, 0.0).
spacingAngles_Wcsp_to_Wcs_ixyz – An array-like object of strs or callables with shape (3,) representing the spacing of the WingCrossSectionMovement’s changes in its WingCrossSections’ angles_Wcsp_to_Wcs_ixyz parameters. Can be a tuple, list, or ndarray. Each element can be the str “sine”, the str “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. Custom functions are scaled by ampAngles_Wcsp_to_Wcs_ixyz, shifted horizontally and vertically by phaseAngles_Wcsp_to_Wcs_ixyz and the base value, and have a period set by periodAngles_Wcsp_to_Wcs_ixyz. The default is (“sine”, “sine”, “sine”).
phaseAngles_Wcsp_to_Wcs_ixyz – An array-like object of numbers (int or float) with shape (3,) representing the phase offsets of the elements in the first time step’s WingCrossSection’s angles_Wcsp_to_Wcs_ixyz parameter relative to the base WingCrossSection’s angles_Wcsp_to_Wcs_ixyz parameter. Can be a tuple, list, or ndarray. Elements must lie in the range (-180.0, 180.0]. Each element must be 0.0 if the corresponding element in ampAngles_Wcsp_to_Wcs_ixyz is 0.0 and non zero if not. Values are converted to floats internally. The units are in degrees. The default is (0.0, 0.0, 0.0).
- Returns:
None
- property all_periods: tuple[float, Ellipsis]¶
All unique non zero periods of this WingCrossSection’s motion.
- Returns:
A tuple of all unique non zero periods in seconds. If the motion is static, this will be an empty tuple.
- property max_period: float¶
The longest period of this WingCrossSection’s motion.
- Returns:
The longest period in seconds. If the motion is static, this will be 0.0.
- generate_wing_cross_section_at_time_step(step: int, delta_time: float | int) pterasoftware.geometry.wing_cross_section.WingCrossSection¶
Creates the WingCrossSection 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 WingCrossSection at this time step.
- generate_wing_cross_sections(num_steps: int, delta_time: float | int) list[pterasoftware.geometry.wing_cross_section.WingCrossSection]¶
Creates the WingCrossSection 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 WingCrossSections associated with this CoreWingCrossSectionMovement.