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)
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)
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)
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))
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) ############################################################################### # For the FMAS_S :math:`z`-propagation model we consider a conserved quantity # that is related to the classical analog of the photon number, see Eq. (24) of # [AD2010] and the appendix of [BW1989]. In particular we here implement #
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)) ############################################################################### # Next, we prepare the corresponding initial condition, which is well described # in Ref. [3]. It consists of a fundamental soliton with duration # :math:`t_{\rm{S}}=25.2\,\mathrm{fs}` and center frequency # :math:`\omega_{\rm{S}}=0.4709\,\mathrm{rad/fs}`, and a dispersive wave with # duration :math:`t_{\rm{DW}}=100\,\mathrm{fs}` and angular frequency # :math:`\omega_{\rm{DW}}=2.6177\,\mathrm{rad/fs}`. Both pulses exhibit an # amplitude ratio of :math:`A_{\rm{DW}}/A_{\rm{S}}=0.566`, and the soliton is # launched with deltay :math:`t_{\rm{off}}=450\,\mathrm{fs}`. wS, tS = 0.4709, 25.2 # (rad/fs), (fs) wDW, tDW = 2.6177, 100. # (rad/fs), (fs) t_off = -450. # (fs) rDW = 0.566 # (-)
# cooresponding instance of the `PropConst` convenience class, wrapping the # function `beta_fun`. beta_fun = define_beta_fun_NLPM750() pc = PropConst(beta_fun) ############################################################################### # We then visually assess the group-velocity (GV) and group-velocity dispersion # (GVD) of the propagation constant in the angular frequency range # :math:`\omega \in [1.2,3.2]~\mathrm{rad/fs}`. GV and GVD are implemented by # the class methods `vg`, and `beta2`, respectively. To generate a quick plot # of both, the GV and GVD, we use the function `plot_details_prop_const`, which # is defined in module `tools`. w = np.linspace(1.3, 3.2, 200) plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) ############################################################################### # Finding zero-dispersion points # ------------------------------ # # A quick visual assessment of the GVD in the bottom subfigure allows to # roughly locate the first zero-dispersion point within the angular frequency # interval :math:`[1.4,1.7]~\mathrm{rad/fs}`. The second zero-dispersion point # surely falls into the interval :math:`[2.2,2.5]~\mathrm{rad/fs}`. From these # rough estimates we can determine the exact roots of :math:`\beta_2` as shown # below: w_Z1 = pc.find_root_beta2(1.4, 1.7) w_Z2 = pc.find_root_beta2(2.2, 2.5)
# propagation constant and generate an instance of the `PropConst` convenience # class. beta_fun = define_beta_fun_ESM() pc = PropConst(beta_fun) ############################################################################### # The group-velocity (GV) and group-velocity dispersion (GVD) of the ESM # propagation constant in the angular frequency range :math:`\omega \in # [1.2,3.2]~\mathrm{rad/fs}` can then be visualized using build in `py-fmas` # functions. GV and GVD are implemented by the class methods `vg`, and # `beta2`, respectively. To generate a quick plot of both, we use the function # `plot_details_prop_const`, which is defined in module `tools`. w_tmp = np.linspace(1., 3.5, 400) plot_details_prop_const(w_tmp, pc.vg(w_tmp), pc.beta2(w_tmp)) ############################################################################### # We next define the simulation parameters that specify the computational # domain grid = Grid( t_max=5500., # (fs) t_num=2**14 # (-) ) ############################################################################### # After the computational domain is specified, we define the simulation # parameters that are needed to specify the :math:`z`-propagation model. # Below, we use the simplified forward model for the analytic signal including # the Raman effect [3]
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) chi = 8.0 * n2 * pc.beta(w0) * pc.c0 / w0 / 3.0 gam0 = 3 * w0 * w0 * chi / (8 * pc.c0 * pc.c0 * pc.beta(w0)) A0 = Ns * np.sqrt(abs(pc.beta2(w0)) / gam0) / 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 forward model for the analytic signal (FMAS) from fmas.models import FMAS model = FMAS(w=grid.w, beta_w=pc.beta(grid.w), chi=chi) ############################################################################### # For the FMAS :math:`z`-propagation model we consider a conserved quantity # that is related to the classical analog of the photon number, see Eq. (24) of # Ref. [AD2010] below. In particular we here implement # # .. math::