How Does MEEP Represent CustomSource? #2809
-
Hello, I am working on creating a dipole emitter in MEEP, but would just like to point to some lines of code in the project that correlate the CustomSource function in python (and its src_func) to an electric field in the simulation. In my project, I have an array of how a dipole moment changes over time, and would like to produce an electric field from its changes using CustomSource. Can anyone help me? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
With a source, you are (by default) specifying the current density J in Maxwell's equations. There is no simple relationship (in general) between the current source and the resulting electric field, because it depends on the surrounding materials. This is a Meep FAQ. If you have a dipole moment (polarization) density P, the current density J=dP/dt is the time derivative of this. However, if you set the flag |
Beta Was this translation helpful? Give feedback.
-
Hello, circling back to this Q&A @stevengj. Can you help me understand the physics of flipping mp.Source(
mp.CustomSource(src_func=self.chirpx, is_integrated=True),
center=self.positionMolecule,
component=mp.Ex
)
...
def chirpx(self, t):
return self.dipoleResponse['x'].get(str(round(t, self.decimalPlaces)), 0) When printing the time for chirpx, here is an example:
However, if
Can you explain why the (You can see more about my project here in case you need more context.) |
Beta Was this translation helpful? Give feedback.
With a source, you are (by default) specifying the current density J in Maxwell's equations. There is no simple relationship (in general) between the current source and the resulting electric field, because it depends on the surrounding materials.
This is a Meep FAQ.
If you have a dipole moment (polarization) density P, the current density J=dP/dt is the time derivative of this. However, if you set the flag
is_integrated=True
inCustomSource
, then your custom source is precisely the dipole moment density P.