f_c = 2 * 10 ** 9
noise = -140 #森林噪声（dbm）
N0=-117 #视距链路噪声（dbm）
pmax=0.1
B_max=2.5
snr_thre=1
R_min=0.3  #0.1  1.2才能传视频
G_max=20
min_range=0
max_range=2000
min_height=50
max_height=150
speed=40
time_slot=10 #基本间隔
run_time=5
P0=580.65
P1=790
# P0=199.4
# P1=88.65
U=200
vr=7.2
A=0.79
v=1#用户速度
r_change_slot=60#60s


import numpy as np

# aircraft weight in Newton
W = 100
# air density
rho = 1.225
# blade radius in meter
R = 0.5
# blade angular velocity in rad/s
omega = 400
# Fuselage equivalent flat plate area in m^2
S_FP = 0.0151
# number of blades
b = 4
# blade or aerofoil chord length
c = 0.0157
# incremental correction factor to induced power
k = 0.1
# profile drag coefficient
delta = 0.012

# rotor disc area
A = np.pi * R**2
# tip speed of the rotor blade
U_tip = omega * R
# rotor solidity
sigma = b * c / (np.pi * R)
# fuselage drag ratio
d_0 = S_FP / sigma / A
# mean rotor induced velocity in hover
v_0 = np.sqrt(W / (2 * rho * A))

# hovering blade profile power
# P_0 = (delta / 8) * rho * sigma * A * omega**3 * R**2
P_0=580.65
# hovering induced power
P_i = (1 + k) * (W**(1.5)) / np.sqrt(2 * rho * A)

print(P_0,P_i)
# flight speed
# V_kmh = np.linspace(1, 100, 20)
# V = V_kmh / 3.6
# V=V_kmh
# propulsion power
# P_origin = P_0 * (1 + (3 * V**2) / (U_tip**2)) + P_i * (np.sqrt(1+(V**4/(4*(v_0**4))))-V**2/(2*(v_0**2)))**0.5 + (0.5 * d_0 * rho * sigma * A * V**3)
# print(P_origin)