Rowan-Classes/8th-Semester-Spring-2025/weapon-systems/homework/pdms.py
2025-03-10 15:24:54 -04:00

36 lines
919 B
Python

import numpy as np
import matplotlib.pyplot as plt
P_TX = 7E3
LOSS_TX = 10**(5/10)
GAIN_TX = 10**(35/10)
MAX_RANGE = 60E3
TARGET_AREA = 1
def PDMS(tx_power, tx_gain, radar_cross_section, tx_loss, dist_source_target, dist_target_missile):
tx_p_gain = (tx_power*tx_gain) / (4*np.pi*tx_loss)
p_ref = radar_cross_section / (dist_source_target**2)
p_rx = 1 / (4*np.pi*dist_target_missile**2)
return tx_p_gain * p_ref * p_rx
def main():
pd_min = PDMS(P_TX, GAIN_TX, TARGET_AREA, LOSS_TX, MAX_RANGE, MAX_RANGE)
pd_min_db = 10*np.log10(pd_min)
print(pd_min_db)
illumination_percent = np.arange(0.1, 1.1, 0.1)
max_range = MAX_RANGE/illumination_percent
plt.plot(100*illumination_percent, max_range)
plt.xlabel("Illumination Percent")
plt.ylabel("Max Range [km]")
plt.savefig("illumination-percent-range.png")
plt.show()
if __name__ == "__main__":
main()