本文整理汇总了Python中SUAVE.Structure.Data.roll_tau方法的典型用法代码示例。如果您正苦于以下问题:Python Data.roll_tau方法的具体用法?Python Data.roll_tau怎么用?Python Data.roll_tau使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Structure.Data
的用法示例。
在下文中一共展示了Data.roll_tau方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: lateral_directional
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import roll_tau [as 别名]
def lateral_directional(velocity, Cn_Beta, S_gross_w, density, span, I_z, Cn_r, I_x, Cl_p, J_xz, Cl_r, Cl_Beta, Cn_p, Cy_phi, Cy_psi, Cy_Beta, mass):
""" output = SUAVE.Methods.Flight_Dynamics.Dynamic_Stablity.Full_Linearized_Equations.lateral_directional(velocity, Cn_Beta, S_gross_w, density, span, I_z, Cn_r, I_x, Cl_p, J_xz, Cl_r, Cl_Beta, Cn_p, Cy_phi, Cy_psi, Cy_Beta)
Calculate the natural frequency and damping ratio for the full linearized dutch roll mode along with the time constants for the roll and spiral modes
Inputs:
velocity - flight velocity at the condition being considered [meters/seconds]
Cn_Beta - coefficient for change in yawing moment due to sideslip [dimensionless] (no simple relation)
S_gross_w - area of the wing [meters**2]
density - flight density at condition being considered [kg/meters**3]
span - wing span of the aircraft [meters]
I_z - moment of interia about the body z axis [kg * meters**2]
Cn_r - coefficient for change in yawing moment due to yawing velocity [dimensionless] ( - C_D(wing)/4 - 2 * Sv/S * (l_v/b)**2 * (dC_L/dalpha)(vert) * eta(vert))
I_x - moment of interia about the body x axis [kg * meters**2]
Cl_p - change in rolling moment due to the rolling velocity [dimensionless] (no simple relation for calculation)
J_xz - products of inertia in the x-z direction [kg * meters**2] (if X and Z lie in a plane of symmetry then equal to zero)
Cl_r - coefficient for change in rolling moment due to yawing velocity [dimensionless] (Usually equals C_L(wing)/4)
Cl_Beta - coefficient for change in rolling moment due to sideslip [dimensionless]
Cn_p - coefficient for the change in yawing moment due to rolling velocity [dimensionless] (-C_L(wing)/8*(1 - depsilon/dalpha)) (depsilon/dalpha = 2/pi/e/AspectRatio dC_L(wing)/dalpha)
Cy_phi - coefficient for change in sideforce due to aircraft roll [dimensionless] (Usually equals C_L)
Cy_psi - coefficient to account for gravity [dimensionless] (C_L * tan(Theta))
Cy_Beta - coefficient for change in Y force due to sideslip [dimensionless] (no simple relation)
mass - mass of the aircraft [kilograms]
Outputs:
output - a data dictionary with fields:
dutch_w_n - natural frequency of the dutch roll mode [radian/second]
dutch_zeta - damping ratio of the dutch roll mode [dimensionless]
roll_tau - approximation of the time constant of the roll mode of an aircraft [seconds] (positive values are bad)
spiral_tau - time constant for the spiral mode [seconds] (positive values are bad)
Assumptions:
X-Z axis is plane of symmetry
Constant mass of aircraft
Origin of axis system at c.g. of aircraft
Aircraft is a rigid body
Earth is inertial reference frame
Perturbations from equilibrium are small
Flow is Quasisteady
Zero initial conditions
Neglect Cy_p and Cy_r
Source:
J.H. Blakelock, "Automatic Control of Aircraft and Missiles" Wiley & Sons, Inc. New York, 1991, p 118-124.
"""
#process
# constructing matrix of coefficients
A = (0, -span * 0.5 / velocity * Cl_p, I_x/S_gross_w/(0.5*density*velocity**2)/span ) # L moment phi term
B = (0, -span * 0.5 / velocity * Cl_r, -J_xz / S_gross_w / (0.5 * density * velocity ** 2.) / span) # L moment psi term
C = (-Cl_Beta) # L moment Beta term
D = (0, - span * 0.5 / velocity * Cn_p, -J_xz / S_gross_w / (0.5 * density * velocity ** 2.) / span ) # N moment phi term
E = (0, - span * 0.5 / velocity * Cn_r, I_z / S_gross_w / (0.5 * density * velocity ** 2.) / span ) # N moment psi term
F = (-Cn_Beta) # N moment Beta term
G = (-Cy_phi) # Y force phi term
H = (-Cy_psi, mass * velocity / S_gross_w / (0.5 * density * velocity ** 2.))
I = (-Cy_Beta, mass * velocity / S_gross_w / (0.5 * density * velocity ** 2.))
# Taking the determinant of the matrix ([A, B, C],[D, E, F],[G, H, I])
EI = P.polymul(E,I)
FH = P.polymul(F,H)
part1 = P.polymul(A,P.polysub(EI,FH))
DI = P.polymul(D,I)
FG = P.polymul(F,G)
part2 = P.polymul(B,P.polysub(FG,DI))
DH = P.polymul(D,H)
GE = P.polymul(G,E)
part3 = P.polymul(C,P.polysub(DH,GE))
total = P.polyadd(part1,P.polyadd(part2,part3))
poly = total / total[5]
# Generate the time constant for the spiral and roll modes along with the damping and natural frequency for the dutch roll mode
root = np.roots(poly)
root = sorted(root,reverse=True)
spiral_tau = 1 * root[0].real
w_n = (root[1].imag**2 + root[1].real**2)**(-0.5)
zeta = -2*root[1].real/w_n
roll_tau = 1 * root [3].real
output = Data()
output.dutch_natural_frequency = w_n
output.dutch_damping_ratio = zeta
output.spiral_tau = spiral_tau
output.roll_tau = roll_tau
return output
示例2: main
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import roll_tau [as 别名]
def main():
# Taken from Blakelock
#Lateral/Directional Inputs
velocity = 440 * (Units['ft/sec']) # Flight Velocity
Cn_Beta = 0.096 # Yawing moment coefficient due to sideslip
S_gross_w = 2400 * (Units['ft**2']) # Wing reference area
density = 0.002378 * (Units['slugs/ft**3']) # Sea level density
span = 130 * Units.ft # Span of the aircraft
mass = 5900 * Units.slugs # mass of the aircraft
I_x = 1.995 * 10**6 * (Units['slugs*ft**2']) # Moment of Inertia in x-axis
I_z = 4.2 * 10**6 * (Units['slugs*ft**2']) # Moment of Inertia in z-axis
Cn_r = -0.107 # Yawing moment coefficient due to yawing velocity
Cl_p = -0.38 # Rolling moment coefficient due to the rolling velocity
Cy_phi = 0.344 # Side force coefficient due to aircraft roll
Cl_Beta = -0.057 # Rolling moment coefficient due to to sideslip
Cl_r = 0.086 # Rolling moment coefficient due to the yawing velocity (usually evaluated analytically)
J_xz = 0 # Assumed
Cn_p = -0.0228
Cy_psi = 0
Cy_Beta = -0.6
mass = 5900 * Units.slugs # mass of the aircraft
dutch_roll=Approximations.dutch_roll(velocity, Cn_Beta, S_gross_w, density, span, I_z, Cn_r)
roll_tau = Approximations.roll(I_x, S_gross_w, density, velocity, span, Cl_p)
spiral_tau = Approximations.spiral(mass, velocity, density, S_gross_w, Cl_p, Cn_Beta, Cy_phi, Cl_Beta, Cn_r, Cl_r)
lateral_directional = Full_Linearized_Equations.lateral_directional(velocity, Cn_Beta, S_gross_w, density, span, I_z, Cn_r, I_x, Cl_p, J_xz, Cl_r, Cl_Beta, Cn_p, Cy_phi, Cy_psi, Cy_Beta, mass)
# Longitudinal Inputs
mass= 5800 * Units.slugs # mass of the aircraft
velocity = 600 * (Units['ft/sec']) # Flight Velocity
mac = 20.2 * Units.ft # mean aerodynamic chord
Cm_q = -11.4 # Change in pitching moment coefficient due to pitching velocity
CL = 0.74 # Coefficient of Lift
CD = 0.044 # Coefficient of Drag
CL_alpha = 4.42 # Change in aircraft lift due to change in angle of attack
Cz_alpha = -4.46
SM = -0.14 # static margin
Cm_alpha = SM * CL_alpha
Cm_alpha_dot = -3.27
Iy = 2.62 * 10**6 * (Units['slugs*ft**2']) # Moment of Inertia in y-axis
density = 0.000585 * (Units['slugs/ft**3']) # 40,000 ft density
g = 9.8 # gravitational constant
Cz_u = -2*CL # change in Z force with respect to change in forward velocity
Cm_alpha_dot = -3.27
Cz_q = -3.94
Cw = -CL
Theta = 0
Cx_u = -2*CD
Cx_alpha = 0.392
Cz_alpha_dot = -1.13
short_period = Approximations.short_period(velocity, density, S_gross_w, mac, Cm_q, Cz_alpha, mass, Cm_alpha, Iy, Cm_alpha_dot)
phugoid = Approximations.phugoid(g, velocity, CD, CL)
longitudinal = Full_Linearized_Equations.longitudinal(velocity, density, S_gross_w, mac, Cm_q, Cz_alpha, mass, Cm_alpha, Iy, Cm_alpha_dot, Cz_u, Cz_alpha_dot, Cz_q, Cw, Theta, Cx_u, Cx_alpha)
# Expected Values
Blakelock = Data()
Blakelock.longitudinal_short_zeta = 0.352
Blakelock.longitudinal_short_w_n = 1.145
Blakelock.longitudinal_phugoid_zeta = 0.032
Blakelock.longitudinal_phugoid_w_n = 0.073
Blakelock.short_period_short_w_n = 1.15
Blakelock.short_period_short_zeta = 0.35
Blakelock.phugoid_phugoid_w_n = 0.0765
Blakelock.phugoid_phugoid_zeta = 0.042
Blakelock.lateral_directional_dutch_w_n = 1.345
Blakelock.lateral_directional_dutch_zeta = 0.14
Blakelock.lateral_directional_spiral_tau = 1/0.004
Blakelock.lateral_directional_roll_tau = -1/2.09
Blakelock.dutch_roll_dutch_w_n = 1.28
Blakelock.dutch_roll_dutch_zeta = 0.114
Blakelock.spiral_tau = 1./0.0042
Blakelock.roll_tau = -0.493
# Calculating error percentage
error = Data()
error.longitudinal_short_zeta = (Blakelock.longitudinal_short_zeta - longitudinal.short_damping_ratio) / Blakelock.longitudinal_short_zeta
error.longitudinal_short_w_n = (Blakelock.longitudinal_short_w_n - longitudinal.short_natural_frequency) / Blakelock.longitudinal_short_w_n
error.longitudinal_phugoid_zeta = (Blakelock.longitudinal_phugoid_zeta - longitudinal.phugoid_damping_ratio) / Blakelock.longitudinal_phugoid_zeta
error.longitudinal_phugoid_w_n = (Blakelock.longitudinal_phugoid_w_n - longitudinal.phugoid_natural_frequency) / Blakelock.longitudinal_phugoid_w_n
error.short_period_w_n = (Blakelock.short_period_short_w_n - short_period.natural_frequency) / Blakelock.short_period_short_w_n
error.short_period_short_zeta = (Blakelock.short_period_short_zeta - short_period.damping_ratio) / Blakelock.short_period_short_zeta
error.phugoid_phugoid_w_n = (Blakelock.phugoid_phugoid_w_n - phugoid.natural_frequency) / Blakelock.phugoid_phugoid_w_n
error.phugoid_phugoid_zeta = (Blakelock.phugoid_phugoid_zeta - phugoid.damping_ratio) / Blakelock.phugoid_phugoid_zeta
error.lateral_directional_dutch_w_n = (Blakelock.lateral_directional_dutch_w_n - lateral_directional.dutch_natural_frequency) / Blakelock.lateral_directional_dutch_w_n
error.lateral_directional_dutch_zeta = (Blakelock.lateral_directional_dutch_zeta - lateral_directional.dutch_damping_ratio) / Blakelock.lateral_directional_dutch_zeta
error.lateral_directional_spiral_tau = (Blakelock.lateral_directional_spiral_tau - lateral_directional.spiral_tau) / Blakelock.lateral_directional_spiral_tau
error.lateral_directional_roll_tau = (Blakelock.lateral_directional_roll_tau - lateral_directional.roll_tau) / Blakelock.lateral_directional_roll_tau
error.dutch_roll_dutch_w_n = (Blakelock.dutch_roll_dutch_w_n - dutch_roll.natural_frequency) / Blakelock.dutch_roll_dutch_w_n
error.dutch_roll_dutch_zeta = (Blakelock.dutch_roll_dutch_zeta - dutch_roll.damping_ratio) / Blakelock.dutch_roll_dutch_zeta
error.spiral_tau = (Blakelock.spiral_tau - spiral_tau) / Blakelock.spiral_tau
error.roll_tau = (Blakelock.roll_tau - roll_tau) / Blakelock.roll_tau
print error
for k,v in error.items():
assert(np.abs(v)<0.08)
#.........这里部分代码省略.........