# Dipole Sources - Far Field¶ Jupyter Notebook

The previous entry in this series on modelling dipole sources in **JCMsuite** introduced the importance of dipoles for many scientific and industrial applications. There, the electric and magnetic fields of an electric dipole were evaluated close to the dipole source itself. Close in this case meaning only a few wavelengths distance from the source. In this entry, we will take a look at how to evaluate the electromagnetic fields far away from the source. This is useful when modelling the spatial or angular distribution of light on a detector that is far away from the source. For typical nanooptical simulations that involve visible or near infrared light, any detector that is a macroscopic distance from the source will be in the far field.

## Far Field Approximation¶

When evaluating the electric and magnetic fields of an oscillating dipole far away from the source, i.e. when $r\omega \gg c$ the only non-negligible term in the electric and magnetic field expressions are those that scale as $1/r$. We can simplify the total field expressions (see previous entry in this series) to obtain the electric and magnetic far fields,

\begin{equation} \mathrm{\mathbf{E}} = \frac{1}{4\pi\epsilon_{\mathrm{0}}} \left[\frac{\omega^{2}}{c^{2}r}\left(\mathbf{n}\times\mathbf{p}\right)\times\mathbf{n}\right]e^{i\omega{r}/c}e^{-i\omega{t}}, \\ \mathrm{\mathbf{B}} = \frac{1}{4\pi\epsilon_{\mathrm{0}}} \frac{\omega^{2}}{c^{3}r}\left(\mathbf{n}\times\mathbf{p}\right) e^{i\omega{r}/c}e^{-i\omega{t}}. \end{equation}Where $\omega$ is the angular frequency of the oscillation, $\mathbf{p}$ is the polarization vector of the dipole, $r$ is the distance to the dipole position, $\mathbf{n}$ is the normalised position vector, $t$ is time and $\epsilon_{0}$ and $c$ are the permitivitty of free space and the speed of light in vacuum, respectively.

In order to model the distribution of emitted power, the time averaged Poynting vector $\langle\mathrm{\mathbf{S}}\rangle$ needs to be evaluated,

\begin{equation} \langle\mathrm{\mathbf{S}}\rangle = \frac{1}{2}\Re(\mathrm{\mathbf{E}}\times\mathrm{\mathbf{H^{*}}}). \\ \end{equation}Which, for the dipole far field expressions, and using the fact that in a non-magnetic medium $ \mathrm{\mathbf{H}} = \mathrm{\mathbf{B}}/\mu_{0}$ gives the following expression,

\begin{equation} \langle\mathrm{\mathbf{S}}\rangle = \frac{\mu_{0}|\mathbf{p}|^{2}\omega^{4}}{32\pi^{2}cr^{2}}\sin^{2}(\theta)\mathbf{n}. \end{equation}The Poynting vector points radially outwards representing a field carrying power outwards. The angular distribution is not isotropic, and depends on the angle $\theta$ between the normalised position vector $\mathbf{n}$ and the polarization vector $\mathbf{p}$. The angular far field power distribution evaluated over a spherical shell at a given distance from the dipole source can be plotted as a surface,

```
from scripts.dipole_far_field_visualization_3d import DipoleFarFieldVisualization3D
dp_ff_vis_3D = DipoleFarFieldVisualization3D(case='analytical')
```

The donut like shape of the power distribution is dependent on the dipole polarization. The power emitted to the far field along the polarization axis itself is zero, despite the fact that the electric near field is strongest along this direction. The maximum emission is in a plane perpendicular to the polarization of the dipole. When changing the polarization the orientation of the donut shape changes and if the average of all three polarisations is taken, a spherical wave with equal power emitted in all directions is obtained.

## Polar Plots¶

The three dimensional distribution of emitted power is often plotted in certain planes to simplify the analysis. Such polar plots represent slices through the three dimensional distribution shown in the previous figure.

```
from scripts.dipole_far_field_visualization_polar import DipoleFarFieldVisualizationPolar
dp_ff_vis_polar = DipoleFarFieldVisualizationPolar(case='analytical')
```

The angle represented in the polar plot depends on the plane that is being described. For the $xz$ and $yz$ planes, the angle is that subtended from the $z$ axis, often called the polar angle in a spherical coordinate system and given the symbol $\theta$. In the $xy$ plane, the angle referred to the azimuthal angle, which in a spherical coordinate system is often given the symbol $\phi$.

## Far Field in JCMsuite¶

In order to obtain the far field generated from our near field computations in **JCMsuite**, the `FarField`

post process can be used,

```
PostProcess {
FarField {
FieldBagPath = "project_results/fieldbag.jcm"
OutputFileName = "project_results/ff.jcm"
Polar {
GridPointsPhi = [0.]
GridPointsTheta = [-180:2:180]
Radius = 1.
}
}
}
```

This will result in evaluating the electric far field for $\theta$ values from $-180^{\circ}$ to $180^{\circ}$ for $\phi = 0$ which defines the $xz$ plane. Taking the numerical examples from the previous post in this series, we evaluate the far field for a dipole in a homogeneous medium and for a dipole close to a cylindrical scatterer.

```
from scripts.dipole_far_field_visualization_polar_comparison import DipoleFarFieldVisualizationPolarComparison
dp_ff_vis_polar_comparison = DipoleFarFieldVisualizationPolarComparison()
```

The far field emission for the dipole source in a homogeneous medium for the analytical and numerical (i.e. with **JCMsuite**) results are in perfect agreement. The dipole source with the structured surrounding, namely a cylindrical high dielectric nanorod placed at a $45^{\circ}$ angle to the $z$ axis shows a pronounced emission into the same quadrant of space. The nanorod is able to provide a preferred direction of the emission by acting as an antenna.

## Dipole Emission in JCMsuite¶

If the system is lossless, meaning there are no absorbing materials present, then the total power emission of an electric dipole can be obtained by integrating the angular power distribution over all angles. For the case of a dipole in a homogeneous medium, we can analytically integrate the expression for the angular distribution to obtain the total power emitted,

\begin{equation} P = \frac{\mu_{0}|\mathbf{p}|^{2}\omega^{4}}{12\pi^{2}c}. \end{equation}Using **JCMsuite**, we can calculate the total power emitted by an electric dipole for both a homogeneous and structured environment. The `DipoleEmission`

post process has a simple format,

```
PostProcess {
DipoleEmission {
FieldBagPath = "project_results/fieldbag.jcm"
OutputFileName = "project_results/de.jcm"
}
}
```

Here we verify that the dipole emission calculated numerically from the dipole in homogenous medium corresponds to the analytical expression to within the precision of the numerical computation.

```
import os
import jcmwave as jcm
from scipy import constants
from scripts.dipole import electric_dipole_emission
omega = 1e15 #angular frequency
pol = constants.e/omega
de_analytical = electric_dipole_emission(omega, pol)
de_numerical = jcm.loadtable(os.path.join("sources", "dipole_project", "project_results", "de.jcm"))
print(f"Dipole Emission Analytical: {de_analytical:.5e}")
print(f"Dipole Emission Numerical: {de_numerical['DipoleEmission'][0]:.5e}")
```

## Conclusion¶

Electric dipole sources are an important class of sources for applications in nanooptics. Often the emission into the far field is of interest. In this post, we looked at the following examples:

- The analytical expression for the far field emission in a homogeneous medium.
- Examples for plotting the far field emission as both a 3D surface and also polar plots.
- How a nanoscale scattering object in the near field can dramatically change the far field emission.
- How to calculate the total dipole emission without needing to evaluate the far field directly.

## Additional Resources¶

- Download a free trial version of JCMsuite.
- Documentation for
**dipole sources**in JCMsuite can be found here. - Documentation for the
**far field post process**in JCMsuite can be found here - Documentation for the
**dipole emission post process**in JCMsuite can be found here