gradient

emg3d.optimize.gradient(simulation)[source]

Compute the discrete gradient using the adjoint-state method.

The discrete gradient for a single source at a single frequency is given by Equation (10) in [PlMu08],

\[\nabla_p J(\textbf{p}) = -\sum_{k,l,m}\mathbf{\bar{\lambda}}^E_x \frac{\partial S}{\partial \textbf{p}} \textbf{E}_x -\sum_{k,l,m}\mathbf{\bar{\lambda}}^E_y \frac{\partial S}{\partial \textbf{p}} \textbf{E}_y -\sum_{k,l,m}\mathbf{\bar{\lambda}}^E_z \frac{\partial S}{\partial \textbf{p}} \textbf{E}_z \ ,\]

where the grid notation (\(\{k, l, m\}\) and its \(\{+1/2\}\) equivalents) have been omitted for brevity (except for the sum symbols).

Note

The gradient has currently additional limitations to the one in the Simulation class:

  • Only x-directed, electric receivers (\(E_x\)).
  • Only isotropic models.
Parameters:
simulation : emg3d.simulations.Simulation

The simulation.

Returns:
grad : ndarray

Adjoint-state gradient (same shape as simulation.model).