I’m trying to import the refractive index into my model but I’m getting an error.
I wnat to calculate the modes of a metal diffused lithium niobate waveguide
I’ve created a script in matlab to generate my 2D spatial refractive index distribution, by generating 2D meshgrid with the values of the refractive index n(x,y).
By following what reported here:
I’ve generated a vector in matlab and then save it into a txt file. After that I’ve edited the header of my txt file.
Since I’ve a 2D spatial refractive index n(x,y), which is invariant in z-direction (propagation direction) my header would be:
n X1 Xn
m Y1 Ym
but when I try to import the files it says that it isn’t valid.
I’ve also tried to define a 3rd dimension z. and repeating the cross section distribution of the refractive index p-times, so to have:
p Z1 Zp
For example, I’ve defined:
x=linspace (-10, 10, 100)
y=linspace (-10, 0 ,100)
z= linspace (0, 100, 100)
so, the header of my txt file will be
100 -10 10
100 -10 0
100 0 100
followed by a vector of n(x1,y1,z1)…(xn,ym,zp)
But it doesn’t work.
Anyone has any clue?