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

mistake on exp_D #48

Open TomFD opened 5 years ago

TomFD commented 5 years ago

Hi, for the symmetric split-step, the linear step is currently set as: A[:] = self.LinearStep(A,dz,direction) However, is uses self.Calculate_expD(h,direction) and there: self.exp_D[:] = np.exp(directionh0.5(1jself.betas-self.alpha/2.0)) In my opinion, the 0.5 is a mistake. It actually works for the RK4IP implementation, because there, the first step is only dz/2. Currently it is done by self.A_I[:] = self.LinearStep(A,h,direction) but should be something like: self.A_I[:] = self.LinearStep(A,h/2.0 ,direction) if the LinearStep is corrected.

You can check that there are different results when replacing the method for simple problems evol.method=SSFM.SSFM.METHOD_SSFM

evol.method=SSFM.SSFM.METHOD_RK4IP

as well as the dispersion parameter D tells you by its value for linear propagation, how the pulse should spread, but it does only half its value.

cheers, Tom

pyNLO commented 5 years ago

Thanks for reading through the code so carefully. You are entirely correct.