pyNLO / PyNLO

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

Disabling Raman while leaving self-steepening breaks things #20

Closed DanHickstein closed 8 years ago

DanHickstein commented 8 years ago

So, in the Dudley example, either of these options work fine:

evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True)
evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True,  disable_Raman=True, disable_self_steepening=True)

However,

evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True,  disable_Raman=True)

has overflow warnings and the pulse energy drops to zero.

Any idea what is going on?

ycasg commented 8 years ago

What happens when you set disable_Raman=True and give no other Raman-related parameters? The disable Raman flag should supercede simple Raman (so if that's working, it the no Raman case is broken. Which is very possible.)

On Fri, Mar 18, 2016 at 2:49 PM, Danhickstein notifications@github.com wrote:

So, in the Dudley example, either of these options work fine:

evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True) evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True, disable_Raman=True, disable_self_steepening=True)

However,

evol = SSFM.SSFM(dz = dz, local_error = 0.001, USE_SIMPLE_RAMAN = True, disable_Raman=True)

has overflow warnings and the pulse energy drops to zero.

Any idea what is going on?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pyNLO/PyNLO/issues/20

Gabriel Ycas, PhD

DanHickstein commented 8 years ago

The USE_SIMPLE_RAMAN doesn't seem to change the behavior when Raman is disabled, as you suspected.

ycasg commented 8 years ago

OK, then the problem is around the nonlinear step. As inherited from LaserFOAM, the no-Raman case is completely different from the Raman-enabled case. This is not the best thing, and the solution might be setting the Raman gain to zero when the disable flag is passed.

On Fri, Mar 18, 2016 at 4:03 PM, Danhickstein notifications@github.com wrote:

The USE_SIMPLE_RAMAN doesn't seem to change the behavior when Raman is disabled, as you suspected.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pyNLO/PyNLO/issues/20#issuecomment-198561449

Gabriel Ycas, PhD

DanHickstein commented 8 years ago

Yeah, I like the idea of just setting the Raman gain to zero. Howe exactly does one do that? Does that mean that the tau values should be zero? or the f_R?

ycasg commented 8 years ago

I think you can just go one step upstream and in CalculateRamanResponseFT, add an initial

if self.disable_raman: self.R[:]=0 else: ...existing code...

On Fri, Mar 18, 2016 at 4:13 PM, Danhickstein notifications@github.com wrote:

Yeah, I like the idea of just setting the Raman gain to zero. Howe exactly does one do that? Does that mean that the tau values should be zero? or the f_R?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pyNLO/PyNLO/issues/20#issuecomment-198563335

Gabriel Ycas, PhD

DanHickstein commented 8 years ago

I like this idea.

self.R[:] = 0 stops all modification of the input pulse under any circumstances.

But, I think that self.R[:] = 1 does the trick.

Does that seem reasonable?

DanHickstein commented 8 years ago

21 seems to have addressed this to my satisfaction. Closing this issue.