# Pyofss

Pyofss is a Python-based optical fibre system simulator. Optical system components such as pulse generators, optical fibre, and filters are connected to form an optical system. Each system component modifies an optical field in sequence, with the result visualised using plots and animations.

## Availability

Pyofss is free (libre) software, using version 3 of the GNU general public license (GPLv3). It can be installed using the pip command:

pip install pyofss


Alternatively, download the latest pyofss version from the Python Package Index (PyPI).

Code development continues at the pyofss repository on github.

## Documentation

The latest documentation for pyofss is uploaded to the Python Package Index, and can be found at the pyofss directory.

## Pyofss-gui

pip install pyofss-gui


Alternatively, download the latest pyofss-gui version from the Python Package Index (PyPI).

Code development continues at the pyofss-gui repository on github.

## Simulations

Note

Ogg container videos may be played using the (cross-platform) VLC media player.

Pyofss is supported by multiple example simulations. Images and videos generated by the examples can be browsed using the links in the following subsections.

### Agrawal

The following images and videos, generated using pyofss, are based on figures from the book "Nonlinear Fiber Optics" (Fourth Edition) by G. P. Agrawal.

## Overview

Pyofss can simulate the field evolution (representing optical pulses) within a length of optical fibre. There are a range of methods which may be used for this propagation simulation, including the symmetric split-step (Fourier) method and the 4th-order Runge-Kutta in the interaction picture (RK4IP) method. The evolution of the field is governed by the generalised nonlinear SchrÃ¶dinger equation

\begin{equation*} \frac{\partial A}{\partial z} = \left[ \hat{L} + \hat{N}\{A\} \right] A \end{equation*}

where $$A$$ is the complex field envelope of the pulse and $$z$$ is the dimension along the fibre length.

The linear operator $$\hat{L}$$ and non-linear operator $$\hat{N}$$ can be written in the form

\begin{align*} \hat{L} &= -\frac{\alpha}{2} - \frac{i \beta_2}{2} \frac{\partial^2}{\partial t^2} + \frac{\beta_3}{6} \frac{\partial^3}{\partial t^3} + \cdots \\ \hat{N} &= i \gamma \left( |A|^2 + \frac{i}{\omega_0} \frac{1}{A} \frac{\partial |A|^2 A}{\partial t} - t_R \frac{\partial |A|^2}{\partial t} \right) \end{align*}

The linear operator contains terms for attenuation and (second order and higher) dispersion. The nonlinear operator contains terms for self-phase modulation (SPM), self-steepening, and Raman scattering. Pyofss can also use an improved approximation for the Raman response function.

Apart from the simulation of the previously listed effects, pyofss can also be used to study cross-phase modulation (XPM) between two separate channels, supercontinuum generation, and soliton propagation.

## History

Pyofss is a complete rewrite of a previous simulator named pulseprop. While pulseprop was coded in C++ and was highly optimised, it was lacking a certain flexibility. Pyofss is an attempt to add interactivity to pulseprop and, by using Python for the programming language, it indeed seems to fulfill this endeavour.