Steady state simulation

class SteadyStateSimulation(fiber)

SteadyStateSimulation is the main class used for running steady state Giles model simulations without 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_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

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_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_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.

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_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_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_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.