From b33dfbe5b3d496c668fe12a162034edede8db8e5 Mon Sep 17 00:00:00 2001
From: Gamelin Alexis <gamelin@synchrotron-soleil.fr>
Date: Thu, 15 Oct 2020 10:24:54 +0200
Subject: [PATCH] Change sign of LongitudinalMap dtau/dt equation

Compared to mbtrack, the head/tail convention is reversed which leads to this sign change.
In this python code, the head is for negative times, t<0.
The sign change allows successful tracking benchmark with mbtrack for pure inductive and resonator impedance
---
 tracking/element.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tracking/element.py b/tracking/element.py
index 9123e90..519190e 100644
--- a/tracking/element.py
+++ b/tracking/element.py
@@ -93,7 +93,7 @@ class LongitudinalMap(Element):
         bunch : Bunch or Beam object
         """
         bunch["delta"] -= self.ring.U0 / self.ring.E0
-        bunch["tau"] -= self.ring.ac * self.ring.T0 * bunch["delta"]
+        bunch["tau"] += self.ring.ac * self.ring.T0 * bunch["delta"]
 
 class SynchrotronRadiation(Element):
     """
-- 
GitLab