You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been having trouble running optimizations when simulations contain PEC structures. The returned value for the gradient is much too large.
Simulation Setup
The attached notebook demonstrates the issue where the simulation is a planewave source incident on a thin rectangular PEC patch. The objective function is simply maximizing the total flux through a field monitor
The patch is parameterized by its width and should have some kind of effect on flux, but not as large as the gradient returned by autograd plugin, where at the second iteration it is ~1e16.
Other information
Here's the notebook that demonstrates the issue. pec_grad_issue.zip
def delta_eps(self, spatial_coords: np.ndarray) -> complex | np.ndarray:
"""Change in the permittivity across interface (for E field grads)."""
return 0.0
def delta_eps_inv(self, spatial_coords: np.ndarray) -> complex | np.ndarray:
"""Change in 1 / permittivity across interface (for D field grads)."""
return -1.0 / self._eps_out(spatial_coords)
However, still did not get reasonable results.
The text was updated successfully, but these errors were encountered:
I have been having trouble running optimizations when simulations contain PEC structures. The returned value for the gradient is much too large.
Simulation Setup
The attached notebook demonstrates the issue where the simulation is a planewave source incident on a thin rectangular PEC patch. The objective function is simply maximizing the total flux through a field monitor
The patch is parameterized by its width and should have some kind of effect on flux, but not as large as the gradient returned by
autograd
plugin, where at the second iteration it is ~1e16
.Other information
Here's the notebook that demonstrates the issue.
pec_grad_issue.zip
I tried modifying the functions in derivative_utils.py following advice from @tylerflex.
However, still did not get reasonable results.
The text was updated successfully, but these errors were encountered: