10/08/2024, 21:39 SpiralRadpattern
In [ ]:
Importing Necessary modules
In [ ]: import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
In [ ]: # Azimuth angles (in degrees)
angles = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360])
# Corresponding Nx values in dBm
nx_values = np.array([-22, -26, -24, -35, -25, -23, -23, -23, -25, -35, -24, -26
Convert angles to radians for polar plotting
In [ ]: angles_rad = np.deg2rad(angles)
# 2D Polar Plot
plt.figure(figsize=(8, 8))
ax = plt.subplot(111, projection='polar')
ax.plot(angles_rad, nx_values)
ax.set_title('2D Radiation Pattern of Spiral Antenna (H-Plane)')
plt.show()
file:///C:/Users/bonfa/Documents/Machine Learning/SpiralRadpattern.html 1/3
10/08/2024, 21:39 SpiralRadpattern
3D plot
In [ ]: X = nx_values * np.cos(angles_rad)
Y = nx_values * np.sin(angles_rad)
Z = nx_values # Using Nx values as the Z-axis for simplicity
# 3D Plot
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, projection='3d')
ax.plot(X, Y, Z, marker='o')
# Set labels and title
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
ax.set_zlabel('Nx (dBm)')
ax.set_title('3D Radiation Pattern of Spiral Antenna (H-Plane)')
plt.show()
file:///C:/Users/bonfa/Documents/Machine Learning/SpiralRadpattern.html 2/3
10/08/2024, 21:39 SpiralRadpattern
file:///C:/Users/bonfa/Documents/Machine Learning/SpiralRadpattern.html 3/3