/* * METRIC-Application: * A three layer TFLN slab waveguide, anisotropic core, dispersion curves */ #include #include #include #include"metric.h" double Wavel = 1.55; // vacuum wavelength double Wgpnc = 1.0; // cladding: air double Wgpno = 2.1837; // LN core, ordinary refractive index double Wgpne = 2.1220; // LN core, extraordinary refractive index double Wgpns = 1.4483; // SiO2 substrate (buffer), refractive index double Wgpd = 0.450; // core thickness /mum double Theta = 0.0; // propagation angle /deg, 0.0: along crystal Y-axis TflnCut Cut = Xcut; // TFLN configuration: Xcut, Zcut // scan range and stepsize #define Pmin 0.02 #define Pmax 1.00 #define Pstep 0.02 /* calculate parameter scans */ int main() { char neffnam[20] = "neff____"; char polcnam[20] = "polc____"; TflnModeArray ma; // loop over the parameter values for(double p=Pmin; p<=Pmax; p+=Pstep) { Wgpd = p; // scan over thickness, adjust for varying other quatities // define the TFLN slab TflnWaveguide wg(Cut, Wgpd, Wgpns, Wgpno, Wgpne, Wgpnc, Wavel); wg.turnto(Theta); // mode analysis, suppress log output modeanalysis(wg, ma, 1); fprintf(stderr, "d = %g mum\n", p); // adjust for varied quantitiy // counters for mode number per polarization int ite = 0; int itm = 0; // loop over all found modes for(int i=0; i<=ma.num-1; ++i) { // log effective index fprintf(stderr, " [%d] neff = %g, ", i, ma(i).neff); // depending on polarizatio ratio, log polarization, set target filename if(ma(i).polratio < 0.5) { fprintf(stderr, " TM (%.2g)\n", ma(i).polratio); neffnam[4] = 'T'; neffnam[5] = 'M'; neffnam[6] = dig10(itm); neffnam[7] = dig1(itm); polcnam[4] = 'T'; polcnam[5] = 'M'; polcnam[6] = dig10(itm); polcnam[7] = dig1(itm); ++itm; } else { fprintf(stderr, " TE (%.2g)\n", ma(i).polratio); neffnam[4] = 'T'; neffnam[5] = 'E'; neffnam[6] = dig10(ite); neffnam[7] = dig1(ite); polcnam[4] = 'T'; polcnam[5] = 'E'; polcnam[6] = dig10(ite); polcnam[7] = dig1(ite); ++ite; } // append results to data files apptoxyf(neffnam, p, ma(i).neff); apptoxyf(polcnam, p, ma(i).polratio); } } fprintf(stderr, "Ok.\n"); return 0; }