pyNLO / PyNLO

Python package for nonlinear optics
https://pynlo.readthedocs.io/en/latest/
GNU General Public License v3.0
101 stars 55 forks source link

Behavior of media.fibers.get_betas() #12

Closed DanHickstein closed 8 years ago

DanHickstein commented 8 years ago

The behavior of media.fibers.get_betas() is different if self.fiberspecs["dispersion_format"] == "D" versus when self.fiberspecs["dispersion_format"] == "GVD". The difference is only apparent if fiber.central_wavelength is different from pulse.center_wavelength.

When self.fiberspecs["dispersion_format"] == "D", the tabulated dispersion data is expanded around the pulse center wavelength using DTabulationToBetas. This ensures that the returned beta is zero at the pulse central wavelength.

However, when self.fiberspecs["dispersion_format"] == "GVD", the betas are calculated by expanding the beta coefficients around the fiber central wavelength. This is physically correct, but it means that if the fiber and the pulse central wavelengths are different, then beta will not be zero at the pulse central wavelength, which is guaranteed in the case above.

During propagation, the fact that beta is not zero at the pump central wavelength means that the frame of reference shifts. Here is the fundamental_SSFM.py example with the fiber centerwl set to the same as the pulse (850 nm, left) or to 851 nm (right):

image

I think that the solution is probably just to shift the beta values such that the beta at the pulse center_wavelength is equal to zero.

DanHickstein commented 8 years ago

Hmmmm, nope, changing B to be zero at the pulse center frequency did not straighten out the propagation in time. I now how no idea how the fiber.center_frequency can affect the SSFM results in this way...

ycasg commented 8 years ago

I think that I know what's going on. The tilted time-domain picture indicates that the frame of reference in which T0 is measured is moving relative to the pulse (ie a group velocity mismatch. ) When the fiber only has GDD and is centered relative to the pulse, the time-axis and pulse propagate at the same speed, and the intensity is stationary in time. When they are not centered, they move at different velocities and you see the tilted time-domain. Note that the spectrum is the same in both cases, indicating that the code is correctly calculating the nonlinear interaction.

DanHickstein commented 8 years ago

That makes sense. So is it that the slope of beta also needs to be zero at the pulse center wavelength? It seems like it would be nice if the reference frame was always centered on the pulse instead of on the fiber.

ycasg commented 8 years ago

The slope of the dispersion is the cause ($\beta_1$). I think that if you calculate the fiber dispersion at the fiber center wavelength, then subtract off the linear part, this will solve the problem.

DanHickstein commented 8 years ago

I subtracted the slope and displacement of B at the center wavelength of the pulse and this seems to fix with the issue with the SSFM.

image

Here is the modified bit of the FiberInstance.get_betas() function. The last 3 lines before the return B are new:

        elif self.fiberspecs["dispersion_format"] == "GVD":
            # calculate beta[n]/n! * (w-w0)^n
            # w0 is the center of the Taylor expansion, and is defined by the
            # fiber. the w's are from the optical spectrum
            fiber_omega0 =  2*np.pi*self.c / self.center_wavelength # THz
            betas = self.betas
            for i in range(len(betas)):
                betas[i] = betas[i]
                B = B + betas[i] / factorial(i + 2) * (pulse.W_THz-fiber_omega0)**(i + 2)

            # now we have beta calculated in terms of distance from the fiber central frequency
            # what we want is to have beta referenced from the *pulse* central frequency

            center_index = np.argmin(np.abs(pulse.W_THz - 2*np.pi*pulse.center_frequency_THz))
            slope = np.gradient(B)/np.gradient(pulse.W_THz)
            B = B - slope[center_index] * (pulse.W_THz - 2*np.pi*pulse.center_frequency_THz) - B[center_index]

            return B

Is changing the B array like this going to affect any of the other things in PyNLO, or should I make a PR for this change? Alternatively, the SSFM code could take care of modifying beta...

DanHickstein commented 8 years ago

So, I think that this was addressed by PR #16, so I will close this issue.