0% found this document useful (0 votes)
40 views2 pages

Spiral 2

Uploaded by

Bonnie Mundia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

Spiral 2

Uploaded by

Bonnie Mundia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

10/08/2024, 22:05 Spiral2

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([-20, -22, -28, -38, -26, -18, -17, -18, -25, -38, -27, -22

In [ ]: # Convert angles to radians for plotting


angles_rad = np.deg2rad(angles)

# Convert Nx values from dBm to linear scale (for better visualization)


nx_linear = 10**(nx_values/10)

# Create meshgrid for 3D surface plot


angles_grid, nx_grid = np.meshgrid(angles_rad, nx_linear)

# Calculate X, Y, Z coordinates for surface plot


X = nx_grid * np.cos(angles_grid)
Y = nx_grid * np.sin(angles_grid)
Z = nx_grid # Using Nx values as the Z-axis

# Create the 3D surface plot


fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, projection='3d')

# Plotting the surface


ax.plot_surface(X, Y, Z, cmap='viridis', edgecolor='none')

# Add 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)')

# Adjust viewing angle for better visualization


ax.view_init(elev=30, azim=60)

plt.show()

file:///C:/Users/bonfa/Documents/Machine Learning/Machine Learning/Spiral2.html 1/2


10/08/2024, 22:05 Spiral2

file:///C:/Users/bonfa/Documents/Machine Learning/Machine Learning/Spiral2.html 2/2

You might also like