NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.21k stars 618 forks source link

Fix typo in expression for total fields from Fourier-series summation #2816

Closed oskooi closed 5 months ago

oskooi commented 5 months ago

Fixes a typo in Tutorial/Cylindrical Coordinates/Nonaxisymmetric Dipole Sources involving the expression for the total fields based on the Fourier-series summation which incorrectly included taking the real part of the $m > 0$ terms.

original

image

modified

image

stevengj commented 5 months ago

The original looks correct to me — you take twice the real part because you are only summing positive m. Summing a positive m and a negative m term is equivalent to taking twice the real part of the positive-m term, since they are complex conjugates: z + z̄ = 2ℜ[z]

oskooi commented 5 months ago

If I take the Fourier-series expansion for $\vec{E}_{tot}(\theta, \phi)$ and simplify it based on $\vec{E}_m(\theta)e^{im\phi}$ being a complex conjugate for $m$ and $-m$, the resulting expression is:

image

oskooi commented 5 months ago

I have updated the formulas to:

image

stevengj commented 5 months ago

Why is that simpler? The original complex-exponential formula seems simpler to me.

oskooi commented 5 months ago

Why is that simpler? The original complex-exponential formula seems simpler to me.

Note that the original and the updated expressions are not equivalent. The updated expression is derived from the fact that the complex conjugate of a product of complex numbers is the product of their complex conjugates: $(ab)^ = a^ b^*$ where $a = \vec{E}_{m}(\theta)$ and $b = e^{im\theta}$.

Previously, we had been using $(ab) + (ab)^* = 2 \Re\left[ab\right]$ which is incorrect.

mochen4 commented 5 months ago

Previously, we had been using (ab)+(ab)∗=2ℜ[ab] which is incorrect.

In fact, $(ab)+(ab)^∗=2ℜ[ab]$ looks correct to me.