flexcompute / tidy3d

Fast electromagnetic solver (FDTD) at scale.
https://docs.flexcompute.com/projects/tidy3d/en/latest/
GNU Lesser General Public License v2.1
176 stars 40 forks source link

Add source equations to API references #1243

Open tomflexcompute opened 10 months ago

tomflexcompute commented 10 months ago

New users are wondering if we can add equations to our API references regarding different sources? For example GaussianBeam would be something like

image
tomflexcompute commented 10 months ago

Maybe @momchil-flex has some thoughts? Is there any complication here?

tylerflex commented 10 months ago

Technically it is done by just adding the following equation block to the class docstring.

https://github.com/flexcompute/tidy3d/blob/develop/tidy3d/components/medium.py#L114-L118

I just don't know the equations for the sources (or the syntax) so maybe I will assign to momchil to reassign to whoever is most familiar with this.

tomflexcompute commented 10 months ago

The complication I'm thinking about is more related to the time-domain nature of the sources. But maybe we can only list the frequency domain source profiles.

momchil-flex commented 9 months ago

The time-domain is basically the field profile at the central-frequency times the time dependence of the source_time. So the field profile is only correct at the central frequency, but it can be close to correct for some bandwidth. This gets more complicated for broadband sources that are sampled at multiple frequencies though, which allow better broadband injection. Then, the (target) field dependence E(r, t) is something like the inverse Fourier transform of a convolution of E(r, f) and s(f), where s(f) is the source_time spectrum.