Skip to content
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

Fitting creates active material #1878

Closed
alec-flexcompute opened this issue Aug 2, 2024 · 2 comments · Fixed by #1894
Closed

Fitting creates active material #1878

alec-flexcompute opened this issue Aug 2, 2024 · 2 comments · Fixed by #1894
Assignees

Comments

@alec-flexcompute
Copy link
Contributor

Describe the bug
When fitting 3 refractive index values, I get a material that has a negative k value, and diverges.

To Reproduce
To reproduce, see the attached example notebook:
image

@momchil-flex
Copy link
Collaborator

Thanks @alec-flexcompute . Could you post code snippets rather than images so it's easy to just copy paste.

@alec-flexcompute
Copy link
Contributor Author

alec-flexcompute commented Aug 5, 2024

import numpy as np
import tidy3d as td

wvls = np.array([275e-3, 260e-3, 255e-3])
n_nAlGaN = np.array([2.72, 2.68, 2.53])

from tidy3d.plugins.dispersion import FastDispersionFitter, AdvancedFastFitterParam

nAlGaN_fitter = FastDispersionFitter(wvl_um=wvls, n_data=n_nAlGaN)
nAlGaN_mat, _ = nAlGaN_fitter.fit()

freq_list = nAlGaN_mat.angular_freq_to_Hz(nAlGaN_mat._imag_ep_extrema_with_samples())
ep = nAlGaN_mat.eps_model(freq_list)
for e in ep:
    print(e.imag)

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 a pull request may close this issue.

3 participants