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 \phi(\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 is currently implemented only for electric sources and receivers; only for isotropic models; and not for electric permittivity nor magnetic permeability.
Parameters: - simulation :
emg3d.simulations.Simulation
The simulation.
Returns: - grad : ndarray
Adjoint-state gradient (same shape as simulation.model).
- simulation :