fdtdx.compute_energy

Contents

fdtdx.compute_energy#

fdtdx.compute_energy(E, H, inv_permittivity, inv_permeability, axis=0)[source]#

Computes the total electromagnetic energy density of the field.

Parameters:
  • E (jax.Array) – Electric field array with shape (3, nx, ny, nz)

  • H (jax.Array) – Magnetic field array with shape (3, nx, ny, nz)

  • inv_permittivity (jax.Array | float) – Inverse permittivity. Shape (3, nx, ny, nz) for anisotropic or scalar

  • inv_permeability (jax.Array | float) – Inverse permeability. Shape (3, nx, ny, nz) for anisotropic or scalar

  • axis (int, optional) – Axis index of the X,Y,Z component for the E and H field. Defaults to 0.

Returns:

Total energy density array with shape (nx, ny, nz)

Return type:

jax.Array