Skip to content

add tutorial about source normalization #301

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

FilipeFcp
Copy link
Contributor

Hi all,
This is the example of source normalization related to issue #900.
Let me know if you think we should add, remove, or modify anything.

It was run using version 2.9-rc.1, with the fixes to the diffraction monitor included.

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Spell check passed successfully for 1 notebook(s).
Generated by GitHub Action run: https://github.com/flexcompute/tidy3d-notebooks/actions/runs/15495491398

Copy link
Contributor

@alec-flexcompute alec-flexcompute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @Filipe, this will be a super useful resource - this answers a number of my questions as well!

A couple comments:

  1. Above cell 5, it might help to plot a couple of these simulations, so the user can quickly visualize what you're measuring

  2. For the plot in cell 21, maybe connect the data points with a line to better illustrate the behavior

  3. Above cell 22, a bit more explanation of what the simulation will do will be helpful

Other than that, I think this is great - super clear, illustrative, and useful!

Copy link
Contributor

@tomflexcompute tomflexcompute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @FilipeFcp . Very helpful content, especially the error on the monitor position, which I didn't realize before.

  1. Consider adding doc string to the get_sim function since it's relatively long with many arguments.

  2. For plane wave, "|E_0| is proportional to the source plane area" is incorrect right? |E_0| should be proportional to the area**(-1/2) as the figure below shows?

  3. Since we are on this topic, shall we spend some time on custom field source and current source normalization just to make the tutorial complete?

@momchil-flex
Copy link
Collaborator

Thanks @FilipeFcp, great stuff! A few comments from my side too:

  • I am a bit surprised by the diffraction monitor result at 20 degrees. It seems to have jumped quite a lot compared to the trend from the previous degrees. Since you're focusing on that data point exactly, I want to be sure that it's actually correct (I mean, it seems that the error goes down with resolution, but still it looks a bit fishy if there's a sudden jump). Maybe, at least for internal consideration, could you run this with more angles and we can see if there's some discontinuity we need to look at? If there's a discontinuity, I wonder if it may be related to a second diffraction order appearing in the simulation? In which case it would be affected by the simulation domain size.

  • For the point dipole, instead of saying for a classical radiating dipole, let's either explicitly say classical radiating current dipole (as opposed to electric dipole, which will be normalized differently), or infinitesimal antenna with a fixed current density as in our FAQ. Also, mention that the formula you give is specific to an electric current dipole in 3D (and maybe link to our FAQ again).

  • Just wondering why you use nu for the frequency instead of f as in the rest of our documentation (I believe?), or even just omega directly.

@FilipeFcp
Copy link
Contributor Author

Hi all.
Thanks for the comments. I've fixed the issue and am now adding the current and custom source components.

@momchil-flex, I did some tests with more angles, and it seems odd. Using 2.9rc, for a plane size of 1 µm:

image

Changing the plane size to 1.5 µm:
image

That doesn't happen in 2.8.3:
image

Is it some issue with the monitor, or should I adapt something in the simulation?

The $\nu$ name was just old habits. I will change to omega to be more consistent with our documentation.

@FilipeFcp
Copy link
Contributor Author

It gets much better with increased resolution. The previous results used 10 steps per wavelength.

Using 20:

image
image

Using 30:
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants