def mean_sweep_angle(self, x_nondim=0.25) -> float: """ Returns the mean sweep angle (in degrees) of the wing, relative to the x-axis. Positive sweep is backwards, negative sweep is forward. By changing `x_nondim`, you can change whether it's leading-edge sweep (0), quarter-chord sweep (0.25), trailing-edge sweep (1), or anything else. :return: The mean sweep angle, in degrees. """ root_quarter_chord = self._compute_xyz_of_WingXSec(0, x_nondim=x_nondim, y_nondim=0) tip_quarter_chord = self._compute_xyz_of_WingXSec(-1, x_nondim=x_nondim, y_nondim=0) vec = tip_quarter_chord - root_quarter_chord vec_norm = vec / np.linalg.norm(vec) sin_sweep = vec_norm[0] # from dot product with x_hat sweep_deg = np.arcsind(sin_sweep) return sweep_deg
def mean_sweep_angle(self) -> float: """ Returns the mean quarter-chord sweep angle (in degrees) of the wing, relative to the x-axis. Positive sweep is backwards, negative sweep is forward. :return: """ root_quarter_chord = self._compute_xyz_of_WingXSec( 0, x_nondim=0.25, y_nondim=0 ) tip_quarter_chord = self._compute_xyz_of_WingXSec( -1, x_nondim=0.25, y_nondim=0 ) vec = tip_quarter_chord - root_quarter_chord vec_norm = vec / np.linalg.norm(vec) sin_sweep = vec_norm[0] # from dot product with x_hat sweep_deg = np.arcsind(sin_sweep) return sweep_deg
def mean_sweep_angle(self) -> float: """ Returns the mean quarter-chord sweep angle (in degrees) of the wing, relative to the x-axis. Positive sweep is backwards, negative sweep is forward. :return: """ root_quarter_chord = self.xsecs[0].quarter_chord() tip_quarter_chord = self.xsecs[-1].quarter_chord() vec = tip_quarter_chord - root_quarter_chord vec_norm = vec / np.linalg.norm(vec) sin_sweep = vec_norm[0] # from dot product with x_hat sweep_deg = np.arcsind(sin_sweep) return sweep_deg
def solar_elevation_angle(latitude, day_of_year, time): """ Elevation angle of the sun [degrees] for a local observer. :param latitude: Latitude [degrees] :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time after local solar noon [seconds] :return: Solar elevation angle [degrees] (angle between horizon and sun). Returns 0 if the sun is below the horizon. """ # Solar elevation angle (including seasonality, latitude, and time of day) # Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/elevation-angle declination = declination_angle(day_of_year) solar_elevation_angle = np.arcsind( np.sind(declination) * np.sind(latitude) + np.cosd(declination) * np.cosd(latitude) * np.cosd(time / 86400 * 360) ) # in degrees solar_elevation_angle = np.fmax(solar_elevation_angle, 0) return solar_elevation_angle