original_docstring: 
      Calculate the electric field at the aperture of the horn.
      Assuming that the fields of the feeding waveguide are those of the dominant TE10 mode.
      And that the horn length is large compared to the dimensions of the waveguide.
      :param x: The x coordinate to calculate the field in the aperture (m).
      :param y: The y coordinate to calculate the field in the aperture (m).
      :param horn_width: The width of the horn (m).
      :param horn_effective_length: The effective length of the horn (m).
      :param frequency: The operating frequency (Hz).
      :return: The electric and magnetic fields in the aperture (V/m), (A/m).
      
docstring: Calculate the electric field at the aperture of the horn.
  Assuming that the fields of the feeding waveguide are those of the dominant TE10 mode.
  And that the horn length is large compared to the dimensions of the waveguide.
docstring_tokens: Calculate the electric field at the aperture of the horn . Assuming that the fields of the feeding waveguide are those of the dominant TE10 mode . And that the horn length is large compared to the dimensions of the waveguide .
code: def aperture_fields(horn_width, horn_effective_length, frequency, x, y):
      """
      Calculate the electric field at the aperture of the horn.
      Assuming that the fields of the feeding waveguide are those of the dominant TE10 mode.
      And that the horn length is large compared to the dimensions of the waveguide.
      :param x: The x coordinate to calculate the field in the aperture (m).
      :param y: The y coordinate to calculate the field in the aperture (m).
      :param horn_width: The width of the horn (m).
      :param horn_effective_length: The effective length of the horn (m).
      :param frequency: The operating frequency (Hz).
      :return: The electric and magnetic fields in the aperture (V/m), (A/m).
      """
      # Calculate the wavenumber
      k = 2.0 * pi * frequency / c
  
      # Calculate the wave impedance
      eta = sqrt(mu_0 / epsilon_0)
  
      # Define the x-component of the electric field
      e_x = 0.0
  
      # Define the y-component of the electric field
      e_y = cos(pi * x / horn_width) * exp(-1j * k * 0.5 * (x ** 2 / horn_effective_length))
  
      # Define the z-component of the electric field
      e_z = 0.0
  
      # Define the x-component of the magnetic field
      h_x = -cos(pi * x / horn_width) / eta * exp(-1j * k * 0.5 * (x ** 2 / horn_effective_length))
  
      # Define the y-component of the magnetic field
      h_y = 0.0
  
      # Define the z-component of the magnetic field
      h_z = 0.0
  
      # Return all six components of the aperture field
      return e_x, e_y, e_z, h_x, h_y, h_z
code_tokens: def aperture_fields ( horn_width , horn_effective_length , frequency , x , y ) : k = 2.0 * pi * frequency / c eta = sqrt ( mu_0 / epsilon_0 ) e_x = 0.0 e_y = cos ( pi * x / horn_width ) * exp ( - 1j * k * 0.5 * ( x ** 2 / horn_effective_length ) ) e_z = 0.0 h_x = - cos ( pi * x / horn_width ) / eta * exp ( - 1j * k * 0.5 * ( x ** 2 / horn_effective_length ) ) h_y = 0.0 h_z = 0.0 return e_x , e_y , e_z , h_x , h_y , h_z
short_docstring: Calculate the electric field at the aperture of the horn.
short_docstring_tokens: Calculate the electric field at the aperture of the horn .
comment: """
      Calculate the electric field at the aperture of the horn.
      Assuming that the fields of the feeding waveguide are those of the dominant TE10 mode.
      And that the horn length is large compared to the dimensions of the waveguide.
      :param x: The x coordinate to calculate the field in the aperture (m).
      :param y: The y coordinate to calculate the field in the aperture (m).
      :param horn_width: The width of the horn (m).
      :param horn_effective_length: The effective length of the horn (m).
      :param frequency: The operating frequency (Hz).
      :return: The electric and magnetic fields in the aperture (V/m), (A/m).
      """$SEP$# Calculate the wavenumber$SEP$# Calculate the wave impedance$SEP$# Define the x-component of the electric field$SEP$# Define the y-component of the electric field$SEP$# Define the z-component of the electric field$SEP$# Define the x-component of the magnetic field$SEP$# Define the y-component of the magnetic field$SEP$# Define the z-component of the magnetic field$SEP$# Return all six components of the aperture field