Exemplo n.º 1
0
    setup.impulse_model = gnlse.SechEnvelope(power, tfwhm)

    # Simulation
    ###########################################################################
    # Type of dyspersion operator: build from Taylor expansion
    setup.dispersion = gnlse.DispersionFiberFromTaylor(loss, betas)
    solver = gnlse.GNLSE(setup)
    solution = solver.run()

    # Visualization
    ###########################################################################
    plt.figure(figsize=(10, 8))

    plt.subplot(2, 2, 1)
    plt.title("Results for Taylor expansion")
    gnlse.plot_wavelength_vs_distance(solution, WL_range=[400, 1400])
    plt.subplot(2, 2, 3)
    gnlse.plot_delay_vs_distance(solution, time_range=[-.5, 5])

    # read mat file for neffs
    mat = gnlse.read_mat('../data/neff_pcf.mat')
    # neffs
    neff = mat['neff'][:, 1]
    # wavelengths in nm
    lambdas = mat['neff'][:, 0] * 1e9

    # Type of dyspersion operator: build from interpolation of given neffs
    setup.dispersion = gnlse.DispersionFiberFromInterpolation(
        loss, neff, lambdas, setup.wavelength)
    solver = gnlse.GNLSE(setup)
    solution = solver.run()
Exemplo n.º 2
0
    # Input pulse: peak power [W]
    power = 1 / (LNL * setup.nonlinearity)
    # Fiber length [m]
    setup.fiber_length = 10 * LD
    # Type of pulse:  gaussian
    setup.pulse_model = gnlse.GaussianEnvelope(power, tFWHM)
    # Loss coefficient [dB/m]
    loss = 0
    # Type of dyspersion operator: build from Taylor expansion
    setup.dispersion_model = gnlse.DispersionFiberFromTaylor(loss, betas)

    # Type of Ramman scattering function: None (default)
    # Selftepening: not accounted
    setup.self_steepening = False

    # Simulation
    ###########################################################################
    solver = gnlse.gnlse.GNLSE(setup)
    solution = solver.run()

    # Visualization
    ###########################################################################
    plt.figure(figsize=(15, 7))

    plt.subplot(1, 2, 1)
    gnlse.plot_wavelength_vs_distance(solution, WL_range=[780, 900])
    plt.subplot(1, 2, 2)
    gnlse.plot_delay_vs_distance(solution, time_range=[-.5, .5])

    plt.show()