Exemplo n.º 1
0
def main():

    # -- INITIALIZATION STAGE
    # ... DEFINE SIMULATION PARAMETERS
    t_max = 3000.       # (fs)
    t_num = 2**14       # (-)
    z_max = 8.0e3       # (micron)
    z_num = 10000       # (-)
    z_skip = 10         # (-)
    n2 = 3.0e-8         # (micron^2/W)
    wS = 1.884          # (rad/fs)
    tS = 10.0           # (fs)
    NS = 10.            # (-)
    # ... PROPAGGATION CONSTANT
    beta_fun = define_beta_fun_NLPM750()
    pc = PropConst(beta_fun)
    # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 
    grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)
    model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2)
    solver = IFM_RK4IP( model.Lw, model.Nw)

    # -- SET UP INITIAL CONDITION
    A0 = NS*np.sqrt(np.abs(pc.beta2(wS))*model.c0/wS/n2)/tS
    Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep
    solver.set_initial_condition( grid.w, Eps_0w)

    # -- PERFORM Z-PROPAGATION
    solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)

    # -- SHOW RESULTS
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS))
    plot_evolution( solver.z, grid.t, utz,
        t_lim = (-100,100), w_lim = (0.5,8.), DO_T_LOG = True)
Exemplo n.º 2
0
def main():

    t_max = 2000.  # (fs)
    t_num = 2**14  # (-)
    z_max = 0.06e6  # (micron)
    z_num = 25000  # (-)
    z_skip = 50  # (-)
    chi = 1.0  # (micron^2/W)
    c0 = 0.29979  # (micron/fs)

    # -- PROPAGATION CONSTANT
    beta_fun = define_beta_fun()
    pc = PropConst(beta_fun)

    # -- INITIALIZE DATA-STRUCTURES AND ALGORITHMS
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    model = FMAS(w=grid.w, beta_w=beta_fun(grid.w), chi=chi)
    solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)

    # -- PREPARE INITIAL CONDITION AND RUN SIMULATION
    w01, t01, A01 = 1.178, 30.0, 0.0248892  # (rad/fs), (fs), (sqrt(W))
    w02, t02, A02 = 2.909, 30.0, 0.0136676  # (rad/fs), (fs), (sqrt(W))
    A_0t_fun = lambda t, A0, t0, w0: np.real(A0 / np.cosh(t / t0) * np.exp(
        1j * w0 * t))
    E_0t = A_0t_fun(grid.t, A01, t01, w01) + A_0t_fun(grid.t, A02, t02, w02)
    solver.set_initial_condition(grid.w, AS(E_0t).w_rep)
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    # -- SHOW RESULTS IN MOVING FRAME OF REFERENCE
    v0 = 0.0749641870819  # (micron/fs)
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0)
    plot_evolution(solver.z, grid.t, utz, t_lim=(-100, 150), w_lim=(0.3, 3.8))
Exemplo n.º 3
0
def main():
    # -- DEFINE SIMULATION PARAMETERS
    # ... COMPUTATIONAL DOMAIN
    t_max = 3500.  # (fs)
    t_num = 2**14  # (-)
    z_max = 0.10 * 1e6  # (micron)
    z_num = 8000  # (-)
    z_skip = 10  # (-)
    # ... INITIAL CONDITION
    P0 = 1e4  # (W)
    t0 = 28.4  # (fs)
    w0 = 2.2559  # (rad/fs)
    E_0t_fun = lambda t: np.real(
        np.sqrt(P0) / np.cosh(t / t0) * np.exp(-1j * w0 * t))

    # -- INITIALIZATION STAGE
    # ... COMPUTATIONAL DOMAIN
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    # ... CUSTOM PROPAGATION MODEL
    model = CustomModelPCF(w=grid.w)
    # ... PROPAGATION ALGORITHM
    solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)
    solver.set_initial_condition(grid.w, AS(E_0t_fun(grid.t)).w_rep)

    # -- RUN SIMULATION
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    # -- SHOW RESULTS
    plot_evolution(solver.z,
                   grid.t,
                   solver.utz,
                   t_lim=(-500, 2200),
                   w_lim=(1., 4.))
Exemplo n.º 4
0
def determine_error(mode):

    # -- SET AXES
    grid = Grid(t_max=50., t_num=2**12)
    t, w = grid.t, grid.w

    # -- INITIALIZATION STAGE
    # ... SET MODEL
    b2 = -1.
    gamma = 1.
    model = NSE(w, b2, gamma)
    # ... SET SOLVER TYPE
    switcher = {
        'SiSSM': SiSSM(model.Lw, model.Nw),
        'SySSM': SySSM(model.Lw, model.Nw),
        'IFM': IFM_RK4IP(model.Lw, model.Nw),
        'LEM': LEM_SySSM(model.Lw, model.Nw),
        'CQE': CQE(model.Lw, model.Nw, del_G=1e-6)
    }
    try:
        my_solver = switcher[mode]
    except KeyError:
        print('NOTE: MODE MUST BE ONE OF', list(switcher.keys()))
        raise
        exit()

    # -- AVERAGE RELATIVE INTENSITY ERROR
    _RI_error = lambda x, y: np.sum(
        np.abs(np.abs(x)**2 - np.abs(y)**2) / x.size / np.max(np.abs(y)**2))

    # -- SET TEST PULSE PROPERTIES (FUNDAMENTAL SOLITON)
    t0 = 1.  # duration
    P0 = np.abs(b2) / t0 / t0 / gamma  # peak-intensity
    LD = t0 * t0 / np.abs(b2)  # dispersion length
    # ... EXACT SOLUTION
    u_exact = lambda z, t: np.sqrt(P0) * np.exp(0.5j * gamma * P0 * z
                                                ) / np.cosh(t / t0)
    # ... INITIAL CONDITION FOR PROPAGATION
    u0_t = u_exact(0.0, t)

    res_dz = []
    res_err = []
    for z_num in [2**n for n in range(5, 12)]:
        # ...  PROPAGATE INITIAL CONITION
        my_solver.set_initial_condition(w, FT(u0_t))
        my_solver.propagate(z_range=0.5 * np.pi * LD, n_steps=z_num, n_skip=8)

        # ... KEEP RESULTS
        z_fin = my_solver.z[-1]
        dz = z_fin / (z_num + 1)
        u_t_fin = my_solver.utz[-1]
        u_t_fin_exact = u_exact(z_fin, t)
        res_dz.append(dz)
        res_err.append(_RI_error(u_t_fin, u_t_fin_exact))

        # ... CLEAR DATA FIELDS
        my_solver.clear()

    return np.asarray(res_dz), np.asarray(res_err)
Exemplo n.º 5
0
def main():

    t_max = 2000.           # (fs)
    t_num = 2**14           # (-)
    chi = 1.0               # (micron^2/W)  
    c0 = 0.29979            # (micron/fs)

    # -- PROPAGATION CONSTANT
    beta_fun = define_beta_fun()
    pc = PropConst(beta_fun)

    grid = Grid( t_max = t_max, t_num = t_num)
    model = FMAS(w=grid.w, beta_w = beta_fun(grid.w), chi = chi )
    solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw)

    # -- FUNDAMENTAL SOLITON INTITIAL CONDITION
    A_0t_fun = lambda t, A0, t0, w0: np.real(A0/np.cosh(t/t0)*np.exp(1j*w0*t))
    # ... FIRST SOLITON: PROPAGATE AND CLEAN-UP PRIOR TO COLLISION
    w01, t01, A01 = 1.2, 20.0,  0.0351187       # (rad/fs), (fs), (sqrt(W))
    z_max, z_num, z_skip = 0.06e6, 6000, 200    # (micron), (-), (-)
    A_0t_1 = A_0t_fun(grid.t, A01, t01, w01)
    solver.set_initial_condition( grid.w, AS(A_0t_1).w_rep)
    solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)
    A_0t_1_f = np.real(
                 np.where(
                    np.logical_and(grid.t>-15., grid.t<273.0),
                    solver.utz[-1],
                    0j
                 )
               )
    solver.clear()

    # ... SECOND SOLITON: PROPAGATE AND CLEAN-UP PRIOR TO COLLISION
    w02, t02, A02 = 2.96750, 15.0, 0.0289073    # (rad/fs), (fs), (sqrt(W))
    z_max, z_num, z_skip = 0.06e6, 6000, 200    # (micron), (-), (-)
    A_0t_2 = A_0t_fun(grid.t-800., A02, t02, w02)
    solver.set_initial_condition( grid.w, AS(A_0t_2).w_rep)
    solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)
    A_0t_2_f = np.real(
                 np.where(
                    np.logical_and(grid.t>435.0, grid.t<727.0),
                    solver.utz[-1],
                    0j
                 )
               )
    solver.clear()

    # -- LET CLEANED-UP SOLITONS COLLIDE
    z_max, z_num, z_skip = 0.22e6, 50000, 100   # (micron), (-), (-)
    solver.set_initial_condition( grid.w, AS( A_0t_1_f + A_0t_2 ).w_rep)
    solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)

    # -- SHOW RESULTS IN MOVING FRAME OF REFERENCE
    v0 = 0.0749879876745 # (micron/fs)
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0)
    plot_evolution( solver.z, grid.t, utz,
        t_lim = (-1400,1400), w_lim = (0.3,3.8), DO_T_LOG=False)
Exemplo n.º 6
0
def main():

    # -- DEFINE SIMULATION PARAMETERS
    # ... COMPUTATIONAL DOMAIN
    t_max = 4000.       # (fs)
    t_num = 2**14       # (-)
    z_max = 6.0e6       # (micron)
    z_num = 75000       # (-)
    z_skip=   100       # (-)
    n2 = 3.0e-8         # (micron^2/W)

    beta_fun = define_beta_fun_ESM()
    pc = PropConst(beta_fun)

    # -- INITIALIZATION STAGE
    grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)

    #print(grid.dz)
    #exit()
    model = FMAS_S_Raman(w=grid.w, beta_w=pc.beta(grid.w), n2=n2)
    solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw)

    # -- SET UP INITIAL CONDITION
    t = grid.t
    # ... FUNDAMENTAL NSE SOLITON
    w0_S, t0_S = 1.5, 20.   # (rad/fs), (fs)
    A0 = np.sqrt(abs(pc.beta2(w0_S))*model.c0/w0_S/n2)/t0_S
    A0_S = A0/np.cosh(t/t0_S)*np.exp(1j*w0_S*t)
    # ... 1ST DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-)
    w0_DW1, t0_DW1, t_off1, s1 = 2.06, 60., -600., 0.35
    A0_DW1 = s1*A0/np.cosh((t-t_off1)/t0_DW1)*np.exp(1j*w0_DW1*t)
    # ... 2ND DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-)
    w0_DW2, t0_DW2, t_off2, s2 = 2.05, 60., -1200., 0.35
    A0_DW2 = s2*A0/np.cosh((t-t_off2)/t0_DW2)*np.exp(1j*w0_DW2*t)
    # ... 3RD DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-)
    w0_DW3, t0_DW3, t_off3, s3 = 2.04, 60., -1800., 0.35
    A0_DW3 = s3*A0/np.cosh((t-t_off3)/t0_DW3)*np.exp(1j*w0_DW3*t)
    # ... ANALYTIC SIGNAL OF FULL ININITIAL CONDITION
    Eps_0w = AS(np.real(A0_S + A0_DW1 + A0_DW2 + A0_DW3)).w_rep

    solver.set_initial_condition( grid.w, Eps_0w)
    solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)

    # -- SHOW RESULTS
    v0 = pc.vg(w0_S)
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0)

    res = {
        't': grid.t,
        'w': grid.w,
        'z': solver.z,
        'v0': pc.vg(w0_S),
        'utz': utz,
        'Cp': solver.ua_vals
    }

    save_h5('out_file_HR.h5', **res)
Exemplo n.º 7
0
def main():

    # -- SET MODEL PARAMETERS
    t_max = -50.0
    Nt = 2**12
    # ... PROPAGATION CONSTANT (POLYNOMIAL MODEL)
    beta = np.poly1d([-0.5, 0.0, 0.0])
    beta1 = np.polyder(beta, m=1)
    beta2 = np.polyder(beta, m=2)
    # ... NONLINEAR PARAMETER
    gamma = 1.0
    # ... SOLITON PARAMTERS
    t0 = 1.0  # duration
    t_off = 20.0  # temporal offset
    w0 = 25.0  # detuning
    P0 = np.abs(beta2(0)) / t0 / t0 / gamma  # peak-intensity
    LD = t0 * t0 / np.abs(beta2(0))  # dispersion length
    # ... EXACT SOLUTION
    u_exact = lambda z, t: np.sqrt(P0) * np.exp(0.5j * gamma * P0 * z
                                                ) / np.cosh(t / t0)

    # -- INITIALIZATION STAGE
    # ... COMPUTATIONAL DOMAIN
    grid = Grid(t_max=t_max, t_num=Nt)
    t, w = grid.t, grid.w
    # ... NONLINEAR SCHROEDINGER EQUATION
    model = NSE(w, beta(w), gamma)
    # ... PROPAGATION ALGORITHM
    solver = LEM(model.Lw, model.N, del_G=1e-7)
    # ... INITIAL CONDITION
    u0_t = u_exact(0.0, t + t_off) * np.exp(1j * w0 * t)
    u0_t += u_exact(0.0, t - t_off) * np.exp(-1j * w0 * t)
    solver.set_initial_condition(w, FT(u0_t))

    # -- RUN SOLVER
    solver.propagate(
        z_range=0.5 * np.pi * LD,
        n_steps=2**9,
        n_skip=2  # propagation range
    )

    # -- STORE RESULTS
    # ... PREPARE DATA DICTIONARY FOR OUTPUT FILE
    results = {
        "t": t,
        "z": solver.z,
        "w": solver.w,
        "u": solver.utz,
        "dz_integration": solver.dz_,
        "dz_a": np.asarray(solver._dz_a),
        "del_rle": np.asarray(solver._del_rle),
    }
    # ... STORE DATA
    save_h5("./res_LEM_SolSolCollision.h5", **results)
def main():
    # -- DEFINE SIMULATION PARAMETERS
    # ... COMPUTATIONAL DOMAIN
    t_max = 3500.  # (fs)
    t_num = 2**14  # (-)
    z_max = 0.16 * 1e6  # (micron)
    z_num = 4000  # (-)
    z_skip = 10  # (-)
    # ... INITIAL CONDITION
    P0 = 1e4  # (W)
    t0 = 28.4  # (fs)
    w0 = 2.2559  # (rad/fs)
    E_0t_fun = lambda t: np.real(
        np.sqrt(P0) / np.cosh(t / t0) * np.exp(-1j * w0 * t))

    # -- INITIALIZATION STAGE
    # ... COMPUTATIONAL DOMAIN
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    z = grid.z
    print(z[1] - z[0])
    exit()
    # ... CUSTOM PROPAGATION MODEL
    model = CustomModelPCF(w=grid.w)
    # ... PROPAGATION ALGORITHM
    solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)
    solver.set_initial_condition(grid.w, AS(E_0t_fun(grid.t)).w_rep)

    # -- RUN SIMULATION
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    res = {
        "dz_integration": solver.dz_,
        "t": grid.t,
        "z": solver.z,
        "w": solver.w,
        "utz": solver.utz,
        "Cp": solver.ua_vals
    }

    save_h5('res_IFM_SC_Nz%d.h5' % (z_num), **res)

    # -- SHOW RESULTS
    plot_evolution(solver.z,
                   grid.t,
                   solver.utz,
                   t_lim=(-500, 2200),
                   w_lim=(1., 4.),
                   DO_T_LOG=False)
Exemplo n.º 9
0
def main():
    # -- DEFINE SIMULATION PARAMETERS
    # ... COMPUTATIONAL DOMAIN
    t_max = 3500.  # (fs)
    t_num = 2**14  # (-)
    z_max = 0.10 * 1e6  # (micron)
    z_num = 8000  # (-)
    z_skip = 10  # (-)
    # ... INITIAL CONDITION
    P0 = 1e4  # (W)
    t0 = 28.4  # (fs)
    w0 = 2.2559  # (rad/fs)
    E_0t_fun = lambda t: np.real(
        np.sqrt(P0) / np.cosh(t / t0) * np.exp(-1j * w0 * t))

    # -- INITIALIZATION STAGE
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    model = CustomModelPCF(w=grid.w)
    solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)
    solver.set_initial_condition(grid.w, AS(E_0t_fun(grid.t)).w_rep)
    # -- RUN SIMULATION
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    # -- POSTPRICESSING: COMPUTE SPECTROGRAM USING OPTFROG
    # ... Z-DISTANCE, Z-INDEX AND FIELD FOR WHICH TO COMPUTE TRACE
    z0 = 0.08e6  # (micron)
    z0_idx = np.argmin(np.abs(solver.z - z0))
    Et = solver.utz[z0_idx]

    # ... WINDOW FUNCTION FOR SIGNAL LOCALIZATION
    def window_fun(s0):
        return lambda t: np.exp(-t**2 / 2 / s0 / s0) / np.sqrt(2. * np.pi) / s0

    # ... OPTFROG TRACE
    res = optFrog(
        grid.t,  # TEMPORAL GRID
        Et,  # ANALYTIC SIGNAL 
        window_fun,  # WINDOW FUNCTION
        tLim=(-500.0, 3200.0, 10),  # (tmin, fs) (tmax, fs) (nskip)
        wLim=(0.9, 4.1, 3)  # (wmin, fs) (wmax, fs) (nskip)
    )
    # ... SHOW SPECTROGRAM
    plot_spectrogram(res.tau, res.w, res.P)
Exemplo n.º 10
0
def main():

    # -- INITIALIZATION STAGE
    # ... DEFINE SIMULATION PARAMETERS
    t_max = 3500. / 2  # (fs)
    t_num = 2**14  # (-)
    z_max = 50.0e3  # (micron)
    z_num = 100000  # (-)
    z_skip = 100  # (-)
    c0 = 0.29979  # (micron/fs)
    n2 = 1.  # (micron^2/W) FICTITIOUS VALUE ONLY
    wS = 2.32548  # (rad/fs)
    tS = 50.0  # (fs)
    NS = 3.54  # (-)
    # ... PROPAGGATION CONSTANT
    beta_fun = define_beta_fun_fluoride_glass_AD2010()
    pc = PropConst(beta_fun)
    chi = (8. / 3) * pc.beta(wS) * c0 / wS * n2

    # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    model = BMCF(w=grid.w, beta_w=pc.beta(grid.w), chi=chi)
    solver = IFM_RK4IP(model.Lw, model.Nw)

    # -- SET UP INITIAL CONDITION
    LD = tS * tS / np.abs(pc.beta2(wS))
    A0 = NS * np.sqrt(8 * c0 / wS / n2 / LD)
    Eps_0w = AS(np.real(A0 / np.cosh(grid.t / tS) *
                        np.exp(1j * wS * grid.t))).w_rep
    solver.set_initial_condition(grid.w, Eps_0w)

    # -- PERFORM Z-PROPAGATION
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    # -- SHOW RESULTS
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS))
    plot_evolution(solver.z,
                   grid.t,
                   utz,
                   t_lim=(-500, 500),
                   w_lim=(-10., 10.),
                   DO_T_LOG=True,
                   ratio_Iw=1e-15)
Exemplo n.º 11
0
def main():

    # -- DEFINE SIMULATION PARAMETERS
    # ... COMPUTATIONAL DOMAIN
    t_max = 2000.  # (fs)
    t_num = 2**13  # (-)
    z_max = 1.0e6  # (micron)
    z_num = 10000  # (-)
    z_skip = 10  # (-)
    n2 = 3.0e-8  # (micron^2/W)
    c0 = 0.29979  # (fs/micron)
    lam0 = 0.860  # (micron)
    w0_S = 2 * np.pi * c0 / lam0  # (rad/fs)
    t0_S = 20.0  # (fs)
    w0_DW = 2.95  # (rad/fs)
    t0_DW = 70.0  # (fs)
    t_off = -250.0  # (fs)
    sFac = 0.75  # (-)

    beta_fun = define_beta_fun_poly_NLPM750()
    pc = PropConst(beta_fun)

    # -- INITIALIZATION STAGE
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2=n2)
    solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)

    # -- SET UP INITIAL CONDITION
    t = grid.t
    A0 = np.sqrt(abs(pc.beta2(w0_S)) * c0 / w0_S / n2) / t0_S
    A0_S = A0 / np.cosh(t / t0_S) * np.exp(1j * w0_S * t)
    A0_DW = sFac * A0 / np.cosh((t - t_off) / t0_DW) * np.exp(1j * w0_DW * t)
    Eps_0w = AS(np.real(A0_S + A0_DW)).w_rep
    solver.set_initial_condition(grid.w, Eps_0w)
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    # -- SHOW RESULTS
    utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(w0_S))
    plot_evolution(solver.z,
                   grid.t,
                   utz,
                   t_lim=(-1200, 1200),
                   w_lim=(1.8, 3.2))
Exemplo n.º 12
0
def main():
    # -- DEFINE SIMULATION PARAMETERS
    # ... WAVEGUIDE PROPERTIES
    b2 = -1.0
    gamma = 1.
    # ... TEST PULSE PROPERTIES
    t0 = 1.  # soliton duration
    P0 = np.abs(b2) / t0 / t0 / gamma  # peak-intensity
    LD = t0 * t0 / np.abs(b2)  # dispersion length
    N_sol = 3  # soliton order
    # ... COMPUTATIONAL DOMAIN
    t_max = 30.
    t_num = 2**12
    z_max = 0.5 * np.pi * LD
    z_num = 1000
    z_skip = 2

    # -- INITIALIZATION STAGE
    # ... COMPUTATIONAL DOMAIN
    grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
    # ... NSE MODEL
    model = NSE(grid.w, b2, gamma)
    # ... Z-PROPAGATION USING SYMMETRIC SPLIT-STEP FOURIER METHOD
    solver = SySSM(model.Lw, model.Nw)
    # ... INITIAL CONDITION
    u_0t = N_sol * np.sqrt(P0) / np.cosh(grid.t / t0)
    solver.set_initial_condition(grid.w, FT(u_0t))

    # -- RUN SIMULATION
    solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)

    plot_evolution(solver.z,
                   grid.t,
                   solver.utz,
                   t_lim=(-4, 4),
                   w_lim=(-50, 50),
                   DO_T_LOG=False)
Exemplo n.º 13
0
# -- COMPUTATIONAL DOMAIN
t_max = 3500.  # (fs)
t_num = 2**14  # (-)
z_max = 0.10 * 1e6  # (micron)
z_num = 8000  # (-)
z_skip = 10  # (-)

# -- INITIAL CONDITION
P0 = 1e4  # (W)
t0 = 28.4  # (fs)
w0 = 2.2559  # (rad/fs)
E_0t_fun = lambda t: np.real(
    np.sqrt(P0) / np.cosh(t / t0) * np.exp(-1j * w0 * t))

# -- COMPUTATIONAL DOMAIN
grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)
# -- PROPAGATION MODEL
model = CustomModelPCF(w=grid.w)
# -- ANALYTIC SIGNAL INITIAL CONDITION
ic = AS(E_0t_fun(grid.t))

###############################################################################
# We first perfom a simulation run using the default Raman response model
# implemented with `CustomModelPCF`. This is also implemented in terms of the
# Blow-Wood type response  model `h_BW` in module `raman_response`. From the
# simulation results we will only keep the final :math:`z`-slice.

# -- INITIALIZE MODEL
solver = IFM_RK4IP(model.Lw, model.Nw, user_action=model.claw)
# -- SET INITIAL CONDITION
solver.set_initial_condition(grid.w, AS(E_0t_fun(grid.t)).w_rep)
Exemplo n.º 14
0
is used.

.. codeauthor:: Oliver Melchert <*****@*****.**>
"""
import fmas
import numpy as np
from fmas.solver import IFM_RK4IP
from fmas.analytic_signal import AS
from fmas.grid import Grid
from fmas.propagation_constant import PropConst, define_beta_fun_ESM
from fmas.tools import sech, change_reference_frame, plot_claw

beta_fun = define_beta_fun_ESM()
pc = PropConst(beta_fun)

grid = Grid(t_max=5500.0, t_num=2**14)  # (fs)  # (-)

Ns = 8.0  # (-)
t0 = 7.0  # (fs)
w0 = 1.7  # (rad/fs)
n2 = 3.0e-8  # (micron^2/W)
A0 = Ns * np.sqrt(abs(pc.beta2(w0)) * pc.c0 / w0 / n2) / t0
E_0t_fun = lambda t: np.real(A0 * sech(t / t0) * np.exp(1j * w0 * t))
Eps_0w = AS(E_0t_fun(grid.t)).w_rep

###############################################################################
# As model we here consider the simplified forward model for the analytic
# signal (FMAS_S)

from fmas.models import FMAS_S
model = FMAS_S(w=grid.w, beta_w=pc.beta(grid.w), n2=n2)
Exemplo n.º 15
0
        # -- EQUIP THE SUPERCLASS
        super().__init__(w, self.beta_fun(w), n2, fR, tau1, tau2)


###############################################################################
#
# Next, we use the implemente class to reproduce the interaction between a
# soliton and a dispersive wave in absence of the Raman effect.  In particular,
# we here reproduce the collision scenario underlying Fig. 2 of Ref. [3].
#
# Therefore, we initialize an adequate computational domain and an instance of
# the `ZBLAN` model, for which the fractional contribution of the Raman effect
# is set to zero

grid = Grid(
    t_max=4500.,  # (fs)
    t_num=2**14  # (-)
)

model = ZBLAN(grid.w, fR=0.0)

###############################################################################
# To visually assess the group-velocity (GV) and group-velocity dispersion
# (GVD) of the propagation constant in the relevant angular frequency range we
# use the convenience class `PropConst` and pre-implemented plotting functions
# that are implemented in module `tools`

w = grid.w[np.logical_and(grid.w > 0.5, grid.w < 5.)]
pc = PropConst(model.beta_fun)
plot_details_prop_const(w, pc.vg(w), pc.beta2(w))

###############################################################################
Exemplo n.º 16
0
    def Lw(self):
        return 1j*self.beta_w

    def Nw(self, uw):
        ut = IFT(uw)
        return 1j*self.gamma*FT(np.abs(ut)**2*ut)


###############################################################################
# Next, we initialize the computational domain and use a simple split-step 
# Fourier method to propagate a single fundamental soliton for ten soliton 
# periods.

# -- INITIALIZATION STAGE
# ... COMPUTATIONAL DOMAIN
grid = Grid( t_max = 30., t_num = 2**10)
t, w = grid.t, grid.w
# ... NSE MODEL 
model = NSE(w, b2=-1., gamma=1.)
# ... INITIAL CONDITION
u_0t = 1./np.cosh(t)

###############################################################################
# In a first numerical experiment, the stepsize is intentionally kept very
# large in order to allow the numerical istabilities to build up.

solver = SySSM(model.Lw, model.Nw)
solver.set_initial_condition(w, FT(u_0t))
solver.propagate(z_range = 10*np.pi, n_steps = 511, n_skip = 1)
z, utz = solver.z_, solver.utz
Exemplo n.º 17
0
        return 1j*self.gamma*FT(np.abs(ut)**2*ut)


###############################################################################
# Next, we initialize the computational domain and use a simple split-step
# Fourier method to propagate a single third-order soliton for six soliton
# periods.
# In this first numerical experiment, the extend of the frequency domain is so
# small that, when the solitons spectrum broadens, it exceeds the bounds of the
# frequency domain. Errors stemming from truncation of the spectrum accumulate
# over subsequent soliton periods, giving an erroneous account of the true
# dynamics (see the subsequent figure).

# -- INITIALIZATION STAGE
# ... COMPUTATIONAL DOMAIN
grid = Grid( t_max = 34., t_num = 2**9)
t, w = grid.t, grid.w

# ... NSE MODEL 
model = NSE(w, b2=-1., gamma=1.)
# ... INITIAL CONDITION
u_0t = 3./np.cosh(t)


solver = SiSSM(model.Lw, model.Nw)
solver.set_initial_condition(w, FT(u_0t))
solver.propagate(z_range = 6*np.pi/2, n_steps = 10000, n_skip = 50)
z, utz = solver.z_, solver.utz

plot_evolution( solver.z, grid.t, solver.utz,
    t_lim = (-5,5), w_lim = (-60,60), DO_T_LOG=False)
Exemplo n.º 18
0
beta2 = np.polyder(beta, m=2)
# ... NONLINEAR PARAMETER
gamma = 1.
# ... SOLITON PARAMTERS
t0 = 1.  # duration
t_off = 20.  # temporal offset
w0 = 25.  # detuning
P0 = np.abs(beta2(0)) / t0 / t0 / gamma  # peak-intensity
LD = t0 * t0 / np.abs(beta2(0))  # dispersion length
# ... EXACT SOLUTION
u_exact = lambda z, t: np.sqrt(P0) * np.exp(0.5j * gamma * P0 * z) / np.cosh(
    t / t0)

# -- INITIALIZATION STAGE
# ... COMPUTATIONAL DOMAIN
grid = Grid(t_max=t_max, t_num=Nt)
t, w = grid.t, grid.w
# ... NONLINEAR SCHROEDINGER EQUATION
model = NSE(w, beta(w), gamma)
# ... PROPAGATION ALGORITHM
solver = LEM(model.Lw, model.N, del_G=1e-7)
# ... INITIAL CONDITION
u0_t = u_exact(0.0, t + t_off) * np.exp(1j * w0 * t)
u0_t += u_exact(0.0, t - t_off) * np.exp(-1j * w0 * t)
solver.set_initial_condition(w, FT(u0_t))

# -- RUN SOLVER
solver.propagate(
    z_range=0.5 * np.pi * LD,  # propagation range
    n_steps=512,
    n_skip=2)
Exemplo n.º 19
0
        return 1j * self.beta_w

    def Nw(self, uw):
        ut = IFT(uw)
        return self._de_alias(1j * self.gamma * FT(np.abs(ut)**2 * ut))


###############################################################################
# Next, we initialize the computational domain and use a symmetric split-step
# Fourier method to propagate a single third-order soliton for six soliton
# periods.
# For this numerical experiment, the extend of the time domain and the number
# of sample points is chosen large enough to allow for a zero padding
# anti-aliasing technique without cropping important parts of the spectrum.

grid = Grid(t_max=34., t_num=2**12)
t, w = grid.t, grid.w
model = NSE(w, b2=-1., gamma=1.)
u_0t = 4. / np.cosh(t)

solver = SySSM(model.Lw, model.Nw)
solver.set_initial_condition(w, FT(u_0t))
solver.propagate(z_range=3 * np.pi / 2, n_steps=10000, n_skip=50)
z, utz = solver.z_, solver.utz

plot_evolution(solver.z,
               grid.t,
               solver.utz,
               t_lim=(-5, 5),
               w_lim=(-60, 60),
               DO_T_LOG=False)