MCPcopy Create free account
hub / github.com/NanoComp/meep / rootfun

Function rootfun

python/examples/mpb_tutorial.py:140–145  ·  view source on GitHub ↗
(eps)

Source from the content-addressed store, hash-verified

138
139
140def rootfun(eps):
141 # add the cylinder of epsilon = eps to the old geometry:
142 ms.geometry = old_geometry + [mp.Cylinder(0.2, material=mp.Medium(epsilon=eps))]
143 ms.run_tm() # solve for the mode (using the targeted solver)
144 print(f"epsilon = {eps} gives freq. = {ms.get_freqs()[0]}")
145 return ms.get_freqs()[0] - 0.314159 # return 1st band freq. - 0.314159
146
147
148rooteps = ridder(rootfun, 1, 12)

Callers 3

find_kMethod · 0.85
mpb_tutorial.pyFile · 0.85

Calls 1

get_freqsMethod · 0.45

Tested by 1