Beispiel #1
0
def analyseFiber(f):
    print(f.name)
    # wl = numpy.linspace(2100e-9, 2400e-9, 1000)
    wl = numpy.linspace(1500e-9, 5000e-9, 100)
    # wl = numpy.linspace(7000e-9, 20000e-9, 50)
    sim = Simulator(delta=f.delta)
    sim.setWavelength(wl)
    sim.setMaterials(*[Fixed] * len(f.n))
    sim.setRadii(*f.rho)
    for i, idx in enumerate(f.n):
        sim.setMaterialParam(i, 0, idx)

    V0 = sim.getV0()
    # print(V0[0], V0[-1])
    # return

    # modes = sim.findLPModes()
    modes = sim.findVModes()
    # modes = [Mode("TM", 0, 1), Mode("TM", 0, 2)]
    fiber = next(iter(sim))

    for m in modes:
        cutoff = sim.getCutoffV0(fiber, m)
        if cutoff < V0[-1]:
            continue

        # pyplot.plot(V0, sim.getNeff(m), label=str(m))
        pl, = pyplot.plot(V0, sim.getBnorm(m), label=str(m))
        c = pl.get_color()

        if str(m) in ("HE(1,1)", "LP(0,1)"):
            continue

        print(str(m), cutoff)
        pyplot.axvline(cutoff, ls=':', color=c)
        # if m.nu > 1:
        #     cutoffs = findCutoffs(f, m.nu, V0)
        #     for c in cutoffs:
        #         pyplot.axvline(c, ls=':', color='k')

    # pyplot.legend(loc="best")
    pyplot.xlim((2.5, 7))
    # pyplot.ylim((0, 1))
    pyplot.ylim((0, 0.3))
    # pyplot.xlabel("Normalized frequency ($V_0$)")
    # pyplot.ylabel("Normalized propagation constant ($b$)")
    pyplot.title(f.name)
Beispiel #2
0
def analyseFiber(f):
    print(f.name)
    # wl = numpy.linspace(2100e-9, 2400e-9, 1000)
    wl = numpy.linspace(1500e-9, 5000e-9, 100)
    # wl = numpy.linspace(7000e-9, 20000e-9, 50)
    sim = Simulator(delta=f.delta)
    sim.setWavelength(wl)
    sim.setMaterials(*[Fixed] * len(f.n))
    sim.setRadii(*f.rho)
    for i, idx in enumerate(f.n):
        sim.setMaterialParam(i, 0, idx)

    V0 = sim.getV0()
    # print(V0[0], V0[-1])
    # return

    # modes = sim.findLPModes()
    modes = sim.findVModes()
    # modes = [Mode("TM", 0, 1), Mode("TM", 0, 2)]
    fiber = next(iter(sim))

    for m in modes:
        cutoff = sim.getCutoffV0(fiber, m)
        if cutoff < V0[-1]:
            continue

        # pyplot.plot(V0, sim.getNeff(m), label=str(m))
        pl, = pyplot.plot(V0, sim.getBnorm(m), label=str(m))
        c = pl.get_color()

        if str(m) in ("HE(1,1)", "LP(0,1)"):
            continue

        print(str(m), cutoff)
        pyplot.axvline(cutoff, ls=':', color=c)
        # if m.nu > 1:
        #     cutoffs = findCutoffs(f, m.nu, V0)
        #     for c in cutoffs:
        #         pyplot.axvline(c, ls=':', color='k')

    # pyplot.legend(loc="best")
    pyplot.xlim((2.5, 7))
    # pyplot.ylim((0, 1))
    pyplot.ylim((0, 0.3))
    # pyplot.xlabel("Normalized frequency ($V_0$)")
    # pyplot.ylabel("Normalized propagation constant ($b$)")
    pyplot.title(f.name)
Beispiel #3
0
def plotDneffvsb():
    global n1, n2

    pyplot.figure()

    B = numpy.linspace(2, 4.5, 200)

    sim = Simulator(delta=1e-4)
    sim.setWavelength(1550e-9)
    sim.setMaterials(Silica, SiO2GeO2, Silica)
    sim.setRadius(1, B * 1e-6)
    sim.setRadiusFct(0, mul, ('value', rho), ('radius', 1))
    sim.setMaterialParam(1, 0, X)

    # modes = sim.findLPModes()
    # for m in modes:
    #     b = (numpy.fromiter(sim.getNeff(m),
    #                         dtype=numpy.float) - n1a) / (n2a - n1a)
    #     pyplot.plot(V0a, b, label=str(m))

    modes = sim.findVModes()
    neff = {}
    for m in modes:
        neff[m] = sim.getNeff(m)

    for (m1, m2) in [(modes[1], modes[2]),
                     (modes[2], modes[3]),
                     (modes[4], modes[5])]:
        dneff = numpy.abs(neff[m1] - neff[m2]) * 1e4
        pyplot.plot(B, dneff, label="{} - {}".format(str(m1), str(m2)))

    for i, bb in enumerate(b, 1):
        pyplot.axvline(bb, ls='--')
        pyplot.annotate('fiber {}'.format(i),
                        xy=(bb, 2),
                        xytext=(0, 5),
                        textcoords='offset points',
                        horizontalalignment='center')

    pyplot.axhline(1, ls=":")

    pyplot.xlabel("Outer core radius (um)")
    pyplot.ylabel("Mode separation ($\\Delta n_{eff} \\cdot 10^{-4}$)")
    pyplot.legend(loc="bottom right")
Beispiel #4
0
def plotBvsV0():
    global n1, n2

    pyplot.figure()

    b = 4e-6
    V0a = numpy.linspace(2, 5, 200)
    NA = sqrt(n1*n1 - n2*n2)

    sim = Simulator(delta=1e-4)
    sim.setWavelength(Wavelength(k0=(v0 / b / NA)) for v0 in V0a)
    sim.setMaterials(Silica, SiO2GeO2, Silica)
    sim.setRadius(1, b)
    sim.setRadiusFct(0, mul, ('value', rho), ('radius', 1))
    sim.setMaterialParam(1, 0, X)

    n1a = numpy.fromiter((f['index', 0] for f in iter(sim)),
                         dtype=numpy.float)
    n2a = numpy.fromiter((f['index', 1] for f in iter(sim)),
                         dtype=numpy.float)

    # modes = sim.findLPModes()
    # for m in modes:
    #     b = (numpy.fromiter(sim.getNeff(m),
    #                         dtype=numpy.float) - n1a) / (n2a - n1a)
    #     pyplot.plot(V0a, b, label=str(m))

    modes = sim.findVModes()
    for m in modes:
        b = (numpy.fromiter(sim.getNeff(m),
                            dtype=numpy.float) - n1a) / (n2a - n1a)
        pyplot.plot(V0a, b, label=str(m))

    for i, v0 in enumerate(V0, 1):
        pyplot.axvline(v0, ls='--')
        pyplot.annotate('fiber {}'.format(i),
                        xy=(v0, 0.7),
                        xytext=(0, 5),
                        textcoords='offset points',
                        horizontalalignment='center')

    pyplot.xlabel("Normalized frequency ($V_0$)")
    pyplot.ylabel("Normalized propagation constant ($\\widetilde{\\beta}$)")
    pyplot.legend(loc="upper left")
Beispiel #5
0
def plotNeff():
    b = 4e-6
    ncl = 1.444
    nco = ncl + 0.05
    wl = numpy.linspace(1500e-9, 5000e-9, 50)
    V = 2 * numpy.pi / wl * b * numpy.sqrt(nco*nco - ncl*ncl)

    sim = Simulator()
    sim.setWavelength(wl)
    sim.setMaterials(Fixed, Fixed)
    sim.setMaterialParam(0, 0, nco)
    sim.setMaterialParam(1, 0, ncl)
    sim.setRadius(0, b)

    modes = sim.findVModes()

    for m in modes:
        neff = sim.getBnorm(m)
        pyplot.plot(V, neff, label=str(m))

    pyplot.show()
Beispiel #6
0
def plotNeff():
    b = 4e-6
    ncl = 1.444
    nco = ncl + 0.05
    wl = numpy.linspace(1500e-9, 5000e-9, 50)
    V = 2 * numpy.pi / wl * b * numpy.sqrt(nco * nco - ncl * ncl)

    sim = Simulator()
    sim.setWavelength(wl)
    sim.setMaterials(Fixed, Fixed)
    sim.setMaterialParam(0, 0, nco)
    sim.setMaterialParam(1, 0, ncl)
    sim.setRadius(0, b)

    modes = sim.findVModes()

    for m in modes:
        neff = sim.getBnorm(m)
        pyplot.plot(V, neff, label=str(m))

    pyplot.show()
Beispiel #7
0
def plotDvsb():
    global n1, n2

    pyplot.figure()

    wl = Wavelength(1550e-9)
    V0a = numpy.linspace(2, 5, 100)
    NA = sqrt(n1*n1 - n2*n2)

    ba = V0a / wl.k0 / NA

    sim = Simulator(delta=1e-4)
    sim.setWavelength(wl)
    sim.setMaterials(Silica, SiO2GeO2, Silica)
    sim.setRadius(1, ba)
    sim.setRadiusFct(0, mul, ('value', rho), ('radius', 1))
    sim.setMaterialParam(1, 0, X)

    modes = sim.findVModes()

    for m in modes:
        D = sim.getD(m)
        pyplot.plot(ba*1e6, D, label=str(m))

    for i, bb in enumerate(b, 1):
        pyplot.axvline(bb, ls='--')
        pyplot.annotate('fiber {}'.format(i),
                        xy=(bb, 50),
                        xytext=(0, 5),
                        textcoords='offset points',
                        horizontalalignment='center')

    pyplot.ylim((-100, 50))
    pyplot.axhspan(-100, -40, color='k', alpha=0.3)
    pyplot.axhspan(40, 100, color='k', alpha=0.3)
    pyplot.xlabel("Ring-core outer radius (µm)")
    pyplot.ylabel("Dispersion (ps / (nm km) )")
    pyplot.legend(loc="lower left")
Beispiel #8
0
def plotRhoVsV0():
    global n1, n2

    pyplot.figure()

    wl = Wavelength(1550e-9)
    V0a = numpy.linspace(2, 5, 15)  # 75
    NA = sqrt(n1*n1 - n2*n2)

    b = V0a / wl.k0 / NA
    rho = numpy.linspace(0, 1, 15)  # 75

    sim = Simulator(delta=1e-4)
    sim.setWavelength(wl)
    sim.setMaterials(Silica, SiO2GeO2, Silica)
    sim.setMaterialParam(1, 0, X)

    # coupures
    sim.setRadius(1, b[-1])
    sim.setRadius(0, rho * b[-1])
    modes = sim.findVModes()
    for m in modes:
        coupure = numpy.zeros(rho.size)
        for i, fiber in enumerate(iter(sim)):
            coupure[i] = fiber.cutoffV0(m)
            if coupure[i] > 5:
                break
        coupure = numpy.ma.masked_equal(coupure, 0)
        pyplot.plot(coupure, rho, label=str(m), color='k')

    # dneff
    sim.setRadius(1, b)
    neff = numpy.empty((len(modes), len(rho), len(b)))
    for j, r in enumerate(rho):
        sim.setRadiusFct(0, mul, ('value', r), ('radius', 1))

        for i, m in enumerate(modes):
            neff[i, j] = sim.getNeff(m).filled(0)
            if numpy.sum(neff[i, j]) == 0:
                break

        if i == 1:
            break

    dneff = numpy.ones((len(rho), len(b)))
    for i in range(len(rho)):
        for j in range(len(b)):
            for k in range(2, len(modes)):
                if neff[k, i, j]:
                    if abs(neff[k, i, j] - neff[k-1, i, j]) < dneff[i, j]:
                        dneff[i, j] = abs(neff[k, i, j] - neff[k-1, i, j])
    dneff = numpy.ma.masked_greater(dneff, 5e-4)
    pyplot.imshow(dneff, aspect='auto', extent=(V0a[0], V0a[-1], 1, 0))
    pyplot.colorbar()

    pyplot.axhline(0.35, ls='--', color='k')
    pyplot.plot(V0, [0.35] * V0.size, 'ok')

    pyplot.xlim((V0a[0], V0a[-1]))
    pyplot.ylim((0, 1))
    pyplot.xlabel("Normalized frequency ($V_0$)")
    pyplot.ylabel("Inner / outer radius ratio ($\\rho = a / b$)")
Beispiel #9
0
# n1 = SiO2GeO2.n(wl, X)
V0 = wl.k0 * b * 1e-6 * sqrt(n1*n1 - n2*n2)
# dn = n1 - n2
n02 = n1**2 / n2**2


sim = Simulator(delta=1e-4)
sim.setWavelength(wl)
sim.setMaterials(Silica, SiO2GeO2, Silica)
# sim.setMaterials(Fixed, Fixed, Fixed)
sim.setRadius(1, b * 1e-6)
sim.setRadiusFct(0, mul, ('value', rho), ('radius', 1))
sim.setMaterialParam(1, 0, X)
# sim.setMaterialsParams((1.444,), (1.474,), (1.444,))

modes = sim.findVModes()
# modes = [Mode('LP', 0, 1), Mode('LP', 1, 1), Mode('LP', 2, 1)]


def latexSI(value, unit=None):
    if unit:
        return "\\SI{{{}}}{{\\{}}}".format(value, unit)
    else:
        return "\\si{{\\{}}}".format(value)


def latexMode(mode):
    return "\\mode{{{}}}{{{}}}{{{}}}".format(
        mode.family.name, mode.nu, mode.m)