Uploaded by Nica Godja

cbse class waveguide design tirupur

advertisement
The International School Bangalore NAFL Valley Whitefield - Sarjapur Road
Near Dommasandra Circle
Bangalore - 562125
Karnataka India
+91 80 6723 5900
Creating b vs. V Curves for Asymmetrical Waveguide
Design Introduction:
Waveguide designs play a crucial role in various engineering applications, particularly
in signal processing and optics. In this module, we will explore how to use Python to
calculate and visualize b vs. V curves for an asymmetrical waveguide design. The key
points associated with the waveguide design will be identified and plotted.
Prerequisites:
● Basic understanding of Python programming.
● Familiarity with the Matplotlib library for plotting.
Step 1: Import Libraries
Import necessary Python libraries for scientific computing and visualization, including
Matplotlib and NumPy.
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import numpy as np
Step 2: Define Normalized Values
Calculate normalized values for a waveguide, essential for subsequent plotting and analysis.
# Calculate Normalized values
V_norm = k * h * (nf**2 - ns**2)**(1/2)
a_norm = (ns**2 - nc**2) / (nf**2 - ns**2)
Step 3: Create b vs. V Curves
Generate a series of b vs. V curves representing different modes and asymmetry levels
in the waveguide design.
fig, ax_ = plt.subplots(figsize=(8, 6))
ax_.axvline(x=V_norm, color='grey', linestyle='--')
Step 4: Plot b vs. V Curves:
Graphically represent the b vs. V curves, incorporating distinct colors and markers for
various modes and highlighting the intersection point associated with the specified
waveguide parameters.
# Plot the b vs V curves
for v in v_vals:
mode_color = list(mcolors.TABLEAU_COLORS.keys())[v]
The International School Bangalore NAFL Valley Whitefield - Sarjapur Road
Near Dommasandra Circle
Bangalore - 562125
Karnataka India
+91 80 6723 5900
for a in a_vals:
mode_label = r'$\nu=${}'.format(v) if a == 0 else None
V = (v * np.pi + np.arctan(np.sqrt(b / (1 - b))) +
np.arctan(np.sqrt(b + a) / (1 - b))) / (np.sqrt(1 - b))
ax_b_vs_V.plot(V, b, color=mode_color, label=mode_label)
if a == a_norm:
intersection_label = 'intersection' if v == 4 else None
b_index = np.argmin(np.abs(V - V_norm))
ax_b_vs_V.plot(V[b_index], b[b_index], zorder=10,
color='black',
ls='none', marker='o',
label=intersection_label)
Step 5: Plot Labels and Display the Plot
Add axis labels, a legend, and display the finalized b vs. V plot, providing a comprehensive
visualization of the waveguide characteristics.
# Plot labels
ax.set_xlabel(r'Normalized Frequency $V$')
ax.set_ylabel(r'Normalized index $b$')
ax.set_ylim(0, 1)
ax.set_xlim(0, 15)
ax.grid(ls='--')
ax.legend(framealpha=1)
Download