Steady state simulation with Raman scattering¶
- class SteadyStateSimulationWithRaman(fiber)¶
SteadyStateSimulationWithRaman is the main class for running Giles model simulations with Raman scattering. Only one ion population is supported. The class defines the fiber, boundary conditions and optical channels used in the simulation.
- __init__(fiber)¶
Constructor. The fiber must be supplied here and should not be changed. :param fiber: The fiber to be simulated. Subclass of FiberBase
- add_pulsed_forward_signal(wl, input_power, f_rep, fwhm_duration, wl_bandwidth=0.0, loss=None, mode=None, channel_id=None, reflection_target_id=None, reflectance=0.0)¶
Adds a new forward propagating single-frequency pulsed signal to the simulation. A pulsed signal has a higher peak input_power resulting in stronger nonlinear effects, in particular spontaneous and stimulated Raman scattering. The pulse shape is assumed to be Gaussian.
- Parameters
wl (float) – Wavelength of the signal
power (float) – Input input_power of the signal at the beginning of the fiber
f_rep (float) – Repetition frequency of the signal
fwhm_duration (float) – Full-width at half-maximum duration of the Gaussian pulses
wl_bandwidth (float) – Wavelength bandwidth of the channel. Finite bandwidth means including ASE.
mode_shape_parameters (dict) – Defines the mode field shape. Allowed key-value pairs: functional_form -> [‘bessel’, ‘gaussian’, ‘tophat’] mode_diameter -> float overlaps -> list of pre-calculated overlaps between the channel and the ion populations
label (str) – Optional label for the channel
- add_raman(input_power=1e-80, backward_raman_allowed=True, raman_gain=1e-13, loss=None, mode=None, channel_id=None)¶
Adds Raman channels to the simulation.
- Parameters
backward_raman_allowed (bool, default True) – Determines if only the forward propagating Raman beam is simulated.
input_power (float, default ~0 W) – Input input_power of the Raman beam(s)
raman_gain (float, default 1e-13 m/W) – Raman gain value to be used in the simulation.
- add_ase(wl_start, wl_end, n_bins)¶
Adds amplified spontaneous emission (ASE) channels. Using more channels improves accuracy, but incurs a heavier computational cost to the simulation.
- Parameters
wl_start (float) – The shorted wavelength of the ASE band
wl_end (float) – The longest wavelength of the ASE band
n_bins (positive int) – The number of simulated ASE channels.
- add_backward_pump(wl: float, input_power: float, wl_bandwidth=0.0, loss=None, mode=None, channel_id=None, reflection_target_id=None, reflectance=0.0)¶
Adds a new backward propagating single-frequency pump to the simulation.
- Parameters
wl (float) – Wavelength of the signal
input_power (float) – Input input_power of the signal at the beginning of the fiber
wl_bandwidth (float) – Wavelength bandwidth of the channel. Finite bandwidth means seeding by spontaneous emission.
loss (float) – Background loss of the channel. If None, the fiber’s default loss is used.
mode (Subclass of ModeBase (such as LPMode or TophatMode)) – Fiber mode class defining the channel’s mode shape.
channel_id (int or str) – Identifier for the channel, used for reflection definitions and plotting
reflection_target_id (int or str) – Identifier for the target channel that this channel reflects to
reflectance (float) – Reflectance at the end of the channel 0<=R<=1
- add_backward_signal(wl: float, input_power: float, wl_bandwidth=0.0, loss=None, mode=None, channel_id=None, reflection_target_id=None, reflectance=0.0)¶
Adds a new forward propagating single-frequency CW signal to the simulation.
- Parameters
wl (float) – Wavelength of the signal
input_power (float) – Input input_power of the signal at the beginning of the fiber
wl_bandwidth (float) – Wavelength bandwidth of the channel. Finite bandwidth means seeding by spontaneous emission.
loss (float) – Background loss of the channel. If None, the fiber’s default loss is used.
mode (Subclass of ModeBase (such as LPMode or TophatMode)) – Fiber mode class defining the channel’s mode shape.
channel_id (int or str) – Identifier for the channel, used for reflection definitions and plotting
reflection_target_id (int or str) – Identifier for the target channel that this channel reflects to
reflectance (float) – Reflectance at the end of the channel 0<=R<=1
- add_forward_pump(wl: float, input_power: float, wl_bandwidth=0.0, loss=None, mode=None, channel_id=None, reflection_target_id=None, reflectance=0.0)¶
Adds a new forward propagating single-frequency pump to the simulation.
- Parameters
wl (float) – Wavelength of the signal
input_power (float) – Input input_power of the signal at the beginning of the fiber
wl_bandwidth (float) – Wavelength bandwidth of the channel. Finite bandwidth means seeding by spontaneous emission.
loss (float) – Background loss of the channel. If None, the fiber’s default loss is used.
mode (Subclass of ModeBase (such as LPMode or TophatMode)) – Fiber mode class defining the channel’s mode shape.
channel_id (int or str) – Identifier for the channel, used for reflection definitions and plotting
reflection_target_id (int or str) – Identifier for the target channel that this channel reflects to
reflectance (float) – Reflectance at the end of the channel 0<=R<=1
- add_forward_signal(wl: float, input_power: float, wl_bandwidth=0.0, loss=None, mode=None, channel_id=None, reflection_target_id=None, reflectance=0.0)¶
Adds a new forward propagating single-frequency CW signal to the simulation.
- Parameters
wl (float) – Wavelength of the signal
input_power (float) – Input input_power of the signal at the beginning of the fiber
wl_bandwidth (float) – Wavelength bandwidth of the channel. Finite bandwidth means seeding by spontaneous emission.
loss (float) – Background loss of the channel. If None, the fiber’s default loss is used.
mode (Subclass of ModeBase (such as LPMode or TophatMode)) – Fiber mode class defining the channel’s mode shape.
channel_id (int or str) – Identifier for the channel, used for reflection definitions and plotting
reflection_target_id (int or str) – Identifier for the target channel that this channel reflects to
reflectance (float) – Reflectance at the end of the channel 0<=R<=1
- run(tol=0.001)¶
Runs the simulation, i.e. calculates the steady state of the defined fiber amplifier. ASE or raman simulations might require higher tolerance than the default value. It is best to decrease the tolerance until the result no longer changes.
- Parameters
tol (float) – Target error tolerance of the solver.
- set_guess_array(array, force_node_number=None)¶
Use an existing array as the initial guess. Typically this array is the result of a previous simulation with sligthly different parameters. Note that the number of simulated beams/channels must be the same.
- Parameters
array (numpy array) – The initial guess array
force_node_number (int, optional) – The new number of columns in the resized array.
- set_guess_parameters(guess_parameters)¶
Overrides the default initial guess parameters.
- Parameters
guess_parameters (Instance of GuessParameters class) – Parameters used to create the initial guess array
- Example
from pyfiberamp import GuessParameters, GainShapes params = GuessParameters() params.signal.set_gain_shape(GainShapes.LINEAR) params.pump.set_gain_db(-20) simulation.set_guess_parameters(params)
- set_number_of_nodes(N)¶
Override the default number of nodes used by the solver. The solver will increase the number of nodes if necessary.
- Parameters
N (int) – New starting number of nodes used by the solver.