fixed energy conservation

This commit is contained in:
Benoît Sierro
2021-08-26 15:00:49 +02:00
parent 9375968125
commit f8d2f53083

View File

@@ -114,12 +114,12 @@ class RK4IP:
elif self.alpha is not None: elif self.alpha is not None:
self.logger.debug("Conserved quantity : energy with loss") self.logger.debug("Conserved quantity : energy with loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy_with_loss( self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy_with_loss(
spectrum, self.dw, self.alpha, h self.C_to_A_factor * spectrum, self.dw, self.alpha, h
) )
else: else:
self.logger.debug("Conserved quantity : energy without loss") self.logger.debug("Conserved quantity : energy without loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy( self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy(
spectrum, self.dw self.C_to_A_factor * spectrum, self.dw
) )
else: else:
self.conserved_quantity_func = lambda spectrum, h: 0.0 self.conserved_quantity_func = lambda spectrum, h: 0.0