-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve_eigfreq tutorial #1162
Comments
In the following example of a ring resonator for a mode with Q of ~106 (computed using From these results, it seems that the eigensolver is impractical for these applications. harminv result
eigensolver result
import meep as mp
n = 3.4 # index of waveguide
w = 1 # width of waveguide
r = 1 # inner radius of ring
pad = 4 # padding between waveguide and edge of PML
dpml = 2 # thickness of PML
sxy = 2*(r+w+pad+dpml) # cell size
c1 = mp.Cylinder(radius=r+w, material=mp.Medium(index=n))
c2 = mp.Cylinder(radius=r)
fcen = 0.257 # source center frequency
src = mp.Source(mp.ContinuousSource(fcen),
component=mp.Ez,
center=mp.Vector3(r+0.1))
sim = mp.Simulation(cell_size=mp.Vector3(sxy, sxy),
geometry=[c1, c2],
sources=[src],
resolution=40,
force_complex_fields=True,
symmetries=[mp.Mirror(mp.Y)],
boundary_layers=[mp.PML(dpml)])
sim.init_sim()
eigfreq = sim.solve_eigfreq(tol=1e-7, maxiters=30, guessfreq=fcen, cwtol=1e-6, cwmaxiters=80, L=10)
if mp.am_master():
print("eigfreq:, {}, {}".format(eigfreq.real,eigfreq.real/(-2*eigfreq.imag))) By comparison, for a mode with smaller Q of ~104 the eigensolver produces results with slightly better accuracy but still far from adequate. harminv result
eigensolver result
|
Now that #1158 is merged, it might be nice to use
solve_eigfreq
in a tutorial.Typically, to find resonances we do multiple simulations: first we use
harminv
with a broadband pulse, to identify the resonant frequencies. Then we do additional calculations with narrow-band pulses around each resonant frequency in order to see individual modes and also to get more accurateharminv
data.Instead, you can now replace the second step by calling
solve_eigfreq
with aguessfreq
given by the broadbandharminv
result. This might be faster than a very narrowband calculation, I'm not sure yet (will probably depend on the problem). But it can probably give a more accurate result, especially for the Q of the mode (since high-Q calculations correspond to finding the complex ω to many decimal places).(For example, suppose you have a resonator with a Q=10⁵, then if you want 3 digits of accuracy in Q you need to compute the complex ω to about 8 digits. This might require a very long simulation for Harminv, if it is possible at all.)
The text was updated successfully, but these errors were encountered: