I am trying to insert on my material both dispersion and birefrigence using the script in ansys lumerical FDTD and a text file. Then when I check the materials explorer, it doesnt read correctly my data. The values of the refractive index are higher than the ones inside the folder and also I get high imaginary part of refractive index that normaly should be zero.
On the text file (test.txt) I am using, I have on the first column the wavelength, 2nd column is the ordinary refractive index and 3rd column is the extraordinary refractive index. In order to insert this in FDTD I am using a script as seen below:
#Creating LN material with dispersion
LNoFile = readdata("test.txt");
LNoData=[c/(LNoFile(:,1)*1e-6),(LNoFile(:,2)^2),(LNoFile(:,3)^2),(LNoFile(:,2)^2)]; #4 columns cause of anisotropy,column 2 is ordinary, 3 is extraordinary
#?LNoData;
matName = "LNdispersive";
temp = addmaterial("Sampled data");
setmaterial(temp,"name",matName); # rename material
setmaterial(matName,"max coefficients",3); # set the number of coefficient
setmaterial(matName,"sampled data",LNoData); # load the sampled data matrix
setmaterial("LNdispersive", "color", [1, 0, 0, 1]); # Red color
The text file has a form like this:
0.3000 2.812014 2.664667 0.3152 2.699977 2.556602 0.3303 2.622031 2.486288 0.3455 2.564335 2.436014 0.3606 2.519764 2.397900 0.3758 2.484242 2.367838 0.3909 2.455249 2.343441 0.4061 2.431139 2.323211 0.4212 2.410779 2.306150 0.4364 2.393370 2.291565 0.4515 2.378323 2.278956 0.4667 2.365199 2.267950 0.4818 2.353660 2.258266 0.4970 2.343444 2.249683 0.5121 2.334342 2.242029 0.5273 2.326188 2.235164 0.5424 2.318847 2.228977 0.5576 2.312206 2.223375 0.5727 2.306174 2.218282 0.5879 2.300674 2.213634 0.6030 2.295641 2.209376