Ansys Learning Forum › Forums › Discuss Simulation › Photonics › The wavelength values are different › Reply To: The wavelength values are different
Hello Minu,
I wouldn't suggest to change the script because in this case you would need to create a new workflow if you want to avoid the polynomial fit.
Since you have the data for both modes you can interpolate them.
If for example you have the following data for mode 1 (assuming in the brackets you have the values from the table you shared):
wavelength_mode1 = [... , ... , ... , ... , ... , ...]
neff_mode1 = [... , ... , ... , ... , ... , ...]
and for mode 2:
wavelength_mode2 = [... , ... , ... , ... , ... , ...]
neff_mode2 = [... , ... , ... , ... , ... , ...]
you can write the following commands:
neff_mode2_new=interp(neff_mode2,wavelength_mode2,wavelength_mode1);
plotxy(wavelength_mode2,neff_mode2,wavelength_mode1,neff_mode2_new,"wavelength","neff","");
legend("old data", "interp");
This will interpolate the data of mode 2 to the wavelengths of mode 1 so that the effective indices of both modes correspond to the same wavelength points. The plot is suggested to check if the interpolated values are ok compared to the calculated ones.
Best Regards,
Afroditi