PyOFTK is a Python/Numpy library for helping the developement of numerical simulation of optical pulses in optical fiber. PyOFTK is a work-in-progress project and for now it’s more like a whole bunch of functions and class I made for my own use during my graduate research.
- Example 1: Soliton propagation in SMF-28 using the GPU
- Example 2: Soliton propagation on 5 km
- Example 3: Wave breaking in normal dispersion optical fiber
- Example 4: Similariton collision with SSF on GPU
- Download
Here is a simple example how we can use PyOFTK in iPython
In [1]: import PyOFTK In [2]: fiber1 = PyOFTK.FibreStepIndex(3.0, 62.5, 0.05, 0.0, 1.0) In [3]: fiber1.printLPModes(1.03) Mode LP01: u=1.71279090763 Mode LP02 unsupported Mode LP03 unsupported Mode LP04 unsupported Mode LP05 unsupported Mode LP11: u=2.58518963818 In [4]: fiber1.plotLPMode(1, 1, 1.03, 512 ,1) |
In [5]: t = linspace(-20,20,1024) In [6]: pulse = PyOFTK.gaussianPulse(t, 2.0, 0.0, 1000.0, 1, 0) In [7]: plot(t,pow(abs(pulse),2)) |
In [8]: beta = array([0,0,fiber1.beta2(1.03)*1e24,0]) In [9]: alpha = array([0]) In [10]: pulse2 = PyOFTK.ssf(pulse, dt, dz, 2000, alpha, beta, 0.0, 50, 1e-5) In [11]: plot(t,pow(abs(pulse),2), t, pow(abs(pulse_out),2)) |
In [12]: gamma = fiber1.nlGamma(1.03) In [13]: pulse2 = PyOFTK.ssf(pulse, dt, dz, 200, alpha, beta, 0.0, 50, 1e-5) In [14]: pulse3 = PyOFTK.ssf(pulse, dt, dz, 200, alpha, beta, gamma, 50, 1e-5) In [15]: plot(t,pow(abs(pulse),2),t,pow(abs(pulse2),2),t,pow(abs(pulse3),2)) |



