-
Notifications
You must be signed in to change notification settings - Fork 51
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
Suggest a better f_width for TerminalComponentModeler #2086
Conversation
How about the case where |
@QimingFlex Can you also try the old way for choosing bandwidth, but use a smaller |
e7df19f
to
8f99b29
Compare
Good point! I guess just averaging and minimum and maximum by |
Yes, it has indeed improved. These two figures show the original f_width and the updated f_width, both with a smaller shutoff factor. |
Sounds good. No edge cases come to my mind so far. |
Great, so using the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should update the changelog
# This ensures the amplitude at the maximum frequency is around 0.1 of the amplitude at the central frequency | ||
fwidth = freq0 * np.sqrt(2) / np.pi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be better in most cases in RF applications. However, what if the user wants a simulation, which truly has a lower bound on the minimum frequency? This fwidth
is based only on the central frequency.
It seems like the ripple issue was because the bandwidth was larger than needed and lower frequencies had higher amplitudes. Why not use the fdiff
calculation from the previous commit, but scale it appropriately so that the amplitude of the min and max frequency is set to some desired value, such as 0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, could you clarify what you mean by lower bound on the minimum frequency? I think fwidth can be determined by freq0
alone to ensure a symmetrical spectrum and the desired levels at both min and max. It seems like fdiff
might not be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say the minimum frequency the user chooses is much larger than 0. There might be good reason for this, e.g., less padding needed for PML or maybe avoiding a resonance at lower frequencies. With this approach, changing the min frequency does not affect the bandwidth that much. As the min frequency approaches the max frequency, the signal bandwidth should drop, probably up to some minimum value ideally.
Basically using this new approach, the user cannot specify the frequency bandwidth of the input signal independent of the central frequency.
I also realized that your comment does not seem correct for the amplitude of the maximum frequency. If you keep the max frequency the same but change the min frequency, the power spectral density of the signal at the max frequency will change, right?
I think a better approach is to calculate freq0
as you proposed, but modify the fwidth
calculation, so that it uses the min and max frequency to ensure some desired power spectral density at those frequencies, perhaps the value of 0.1 in your comment or 0.01 if it represents power.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main issue causing ripples in the S parameters was that the bandwidth was simply too large for the central frequency. But the original general idea of calculating fdiff
using the min and max frequency was ok, maybe just needs to be scaled differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you are right! We need a smaller scale for fdiff
then.
8f99b29
to
dc907e1
Compare
What's the status here, can we move it forward? |
Will complete by today. |
dc907e1
to
f976863
Compare
@dmarek-flex @momchil-flex After a thorough investigation, I found that the main reason for the discrepancy in S-parameters is the voltage integral path. The current Gaussian source works properly, so for now, we don't need to make any changes. I will close this PR :). |
You showed several figures in this PR, which seems to be related to fwidth? |
Yeah, but it seems that several factors, including the integral path, PMLs, mesh, and pulse, collectively contribute to the ripples in the S-parameters. Previously, I wasn't able to ensure the integral path, PMLs, and mesh were idealy set up. Now, with those optimized, the current pulse produces nice S-parameters as shown. |
That's good to know! Has the optimized integral path/PMLs/mesh been wrapped in a PR? |
I'm still a bit curious about this, wondering what causes it. The only cases I can think of so far where increasing the number of pml layers helps is simulations with periodic or Bloch boundaries in 2 dimensions and PML on the other, where oblique waves would not be well absorbed. This shouldn't be the case here though because there's PML in all 3 directions. But maybe somehow if one does a Fourier transform of the propagating mode in the plane parallel to the PML, there would be strong components close to oblique incidence? I really want to understand what exactly is causing this problem to require more PML layers, so we can make a more general recommendation for the users. |
That is an interesting observation, so in the inaccurate version of the results there was only a single cell to cover the metal thickness? As a result, the path would be snapped to the top or bottom boundary of that cell? |
Yes, it seems there are edge effects around the PEC edges, which result in an inaccurate integral. |
After conducting more tests, I conclude that the voltage integral path largely suppresses all other factors affecting the accuracy of S-parameters. Now, if the voltage integral path is chosen correctly, using a PML with 12 layers produces excellent results. But there is one issue with the PML: since it does not absorb the DC component, we use |
Sorry, are the results bad if you do not remove the DC component? When I tested your notebook a little, what I noticed was that the fields never fully decay because of the DC part, but apart from that results looked the same? In your plot, is the error / sharp jump due to the fact that there's very very little power at such low frequencies when DC component is removed? Or how should I understand it? |
Previous parameters result a central frequency out of the frequency range as shown, which uses f_min=0 and f_max = 50GHz. I took f_width=0.5*freq_0, which might not be optimal but helps centre the frequency at around 25GHz and improved S-parameters a bit.

