Skip to content

Commit 40629f6

Browse files
joonashirbenoitlaurent96Joonas Hirvonen
authored
Fix tail length (#351)
* Fixed the tail lengths in grid3Scales * Changing input meanFreePathScales to half of the original * EOM minimum tails to scale with new code * One more place for scaling * Fixed a small error in the doc of grid3Scales --------- Co-authored-by: Benoit <benoit.laurent96@gmail.com> Co-authored-by: Joonas Hirvonen <joonas.hirvonen@nottingham.ac.uk>
1 parent 33bbff7 commit 40629f6

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

Models/InertDoubletModel/inertDoubletModel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def getBenchmarkPoints(self) -> list[ExampleInputPoint]:
861861
WallGo.WallSolverSettings(
862862
# we actually do both cases in the common example
863863
bIncludeOffEquilibrium=True,
864-
meanFreePathScale=100.0, # In units of 1/Tnucl
864+
meanFreePathScale=50.0, # In units of 1/Tnucl
865865
wallThicknessGuess=5.0, # In units of 1/Tnucl
866866
),
867867
)

Models/ManySinglets/manySinglets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def getBenchmarkPoints(self) -> list[ExampleInputPoint]:
742742
WallGo.WallSolverSettings(
743743
# we actually do both cases in the common example
744744
bIncludeOffEquilibrium=True,
745-
meanFreePathScale=100.0, # In units of 1/Tnucl
745+
meanFreePathScale=50.0, # In units of 1/Tnucl
746746
wallThicknessGuess=5.0, # In units of 1/Tnucl
747747
),
748748
)

Models/SingletStandardModel_Z2/singletStandardModelZ2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ def getBenchmarkPoints(self) -> list[ExampleInputPoint]:
711711
WallGo.WallSolverSettings(
712712
# we actually do both cases in the common example
713713
bIncludeOffEquilibrium=True,
714-
meanFreePathScale=100.0, # In units of 1/Tnucl
714+
meanFreePathScale=50.0, # In units of 1/Tnucl
715715
wallThicknessGuess=5.0, # In units of 1/Tnucl
716716
),
717717
)

Models/StandardModel/standardModel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def getBenchmarkPoints(self) -> list[ExampleInputPoint]:
564564
WallGo.WallSolverSettings(
565565
# we actually do both cases in the common example
566566
bIncludeOffEquilibrium=True,
567-
meanFreePathScale=200.0, # In units of 1/Tnucl
567+
meanFreePathScale=100.0, # In units of 1/Tnucl
568568
wallThicknessGuess=20.0, # In units of 1/Tnucl
569569
),
570570
)

Models/Yukawa/yukawa.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def main() -> None:
205205
# meanFreePathScale is determined here by the annihilation channels,
206206
# and scales inversely with y^4 or lam^2. This is why
207207
# meanFreePathScale has to be so large.
208-
meanFreePathScale=10000.0, # In units of 1/Tnucl
208+
meanFreePathScale=5000.0, # In units of 1/Tnucl
209209
wallThicknessGuess=10.0, # In units of 1/Tnucl
210210
)
211211

Models/Yukawa/yukawaWithCollisionGeneration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def getBenchmarkPoints(self) -> list[ExampleInputPoint]:
202202
# meanFreePathScale is determined here by the annihilation channels,
203203
# and scales inversely with y^4 or lam^2. This is why
204204
# meanFreePathScale has to be so large.
205-
meanFreePathScale=10000.0, # In units of 1/Tnucl
205+
meanFreePathScale=5000.0, # In units of 1/Tnucl
206206
wallThicknessGuess=10.0, # In units of 1/Tnucl
207207
),
208208
)

src/WallGo/equationOfMotion.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1251,17 +1251,17 @@ def _updateGrid(self, wallParams: WallParams, velocityMid: float) -> None:
12511251
gammaWall = 1 / np.sqrt(1 - velocityMid**2)
12521252
""" The length of the tail inside typically scales like gamma, while the one
12531253
outside like 1/gamma. We take the max because the tail lengths must be larger
1254-
than wallThicknessGrid*(1+2*smoothing)/ratioPointsWall """
1254+
than wallThicknessGrid*(1/2+smoothing)/ratioPointsWall """
12551255
tailInside = max(
12561256
self.meanFreePathScale * gammaWall * self.includeOffEq,
12571257
wallThicknessGrid
1258-
* (1 + 2.1 * self.grid.smoothing)
1258+
* (0.5 + 1.05 * self.grid.smoothing)
12591259
/ self.grid.ratioPointsWall,
12601260
)
12611261
tailOutside = max(
12621262
self.meanFreePathScale / gammaWall * self.includeOffEq,
12631263
wallThicknessGrid
1264-
* (1 + 2.1 * self.grid.smoothing)
1264+
* (0.5 + 1.05 * self.grid.smoothing)
12651265
/ self.grid.ratioPointsWall,
12661266
)
12671267
self.grid.changePositionFalloffScale(

src/WallGo/grid3Scales.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Grid3Scales(Grid):
2424
thickness, so that
2525
2626
.. math::
27-
z'(\chi) \approx \frac{L}{r}\chi, \quad \chi \in [-r, r].
27+
z'(\chi) \approx \frac{L}{r}, \quad \chi \in [-r, r].
2828
2929
It is easier to find the derivative of a function that has these properties,
3030
and then integrate it. We choose here
@@ -36,9 +36,9 @@ class Grid3Scales(Grid):
3636
3737
.. math::
3838
f(\chi) \approx \begin{cases}
39-
\lambda_-,& \chi<-r,\\
39+
2\lambda_-,& \chi<-r,\\
4040
L/r,& -r<\chi<r,\\
41-
\lambda_+,& \chi>r.
41+
2\lambda_+,& \chi>r.
4242
\end{cases}
4343
4444
We choose :math:`f(\chi)` to be a sum of functions like
@@ -78,11 +78,11 @@ def __init__(
7878
(and :math:`\rho_z` and :math:`\rho_\Vert`) directions.
7979
tailLengthInside : float
8080
Decay length of the solution's tail inside the wall. Should be larger
81-
than wallThickness*(1+2*smoothing)/ratioPointsWall. Should be
81+
than wallThickness*(1/2+smoothing)/ratioPointsWall. Should be
8282
expressed in physical units (the units used in EffectivePotential).
8383
tailLengthOutside : float
8484
Decay length of the solution's tail outside the wall. Should be larger
85-
than wallThickness*(1+2*smoothing)/ratioPointsWall. Should be
85+
than wallThickness*(1/2+smoothing)/ratioPointsWall. Should be
8686
expressed in physical units (the units used in EffectivePotential).
8787
wallThickness : float
8888
Thickness of the wall. Should be expressed in physical units
@@ -154,11 +154,11 @@ def _updateParameters(
154154
assert wallThickness > 0, "Grid3Scales error: wallThickness must be positive."
155155
assert smoothing > 0, "Grid3Scales error: smoothness must be positive."
156156
assert (
157-
tailLengthInside > wallThickness * (1 + 2 * smoothing) / ratioPointsWall
157+
tailLengthInside > wallThickness * (1 / 2 + smoothing) / ratioPointsWall
158158
), """Grid3Scales error: tailLengthInside must be greater than
159159
wallThickness*(1+2*smoothness)/ratioPointsWall."""
160160
assert (
161-
tailLengthOutside > wallThickness * (1 + 2 * smoothing) / ratioPointsWall
161+
tailLengthOutside > wallThickness * (1 / 2 + smoothing) / ratioPointsWall
162162
), """Grid3Scales error: tailLengthOutside must be greater than
163163
wallThickness*(1+2*smoothness)/ratioPointsWall."""
164164
assert (
@@ -181,18 +181,18 @@ def _updateParameters(
181181
* smoothing
182182
* wallThickness
183183
* ratioPointsWall**2
184-
* (ratioPointsWall * tailLengthInside - wallThickness * (1 + smoothing))
184+
* (2 * ratioPointsWall * tailLengthInside - wallThickness * (1 + smoothing))
185185
) / abs(
186-
ratioPointsWall * tailLengthInside - wallThickness * (1 + 2 * smoothing)
186+
2 * ratioPointsWall * tailLengthInside - wallThickness * (1 + 2 * smoothing)
187187
)
188188
self.aOut = np.sqrt(
189189
4
190190
* smoothing
191191
* wallThickness
192192
* ratioPointsWall**2
193-
* (ratioPointsWall * tailLengthOutside - wallThickness * (1 + smoothing))
193+
* (2 * ratioPointsWall * tailLengthOutside - wallThickness * (1 + smoothing))
194194
) / abs(
195-
ratioPointsWall * tailLengthOutside - wallThickness * (1 + 2 * smoothing)
195+
2 * ratioPointsWall * tailLengthOutside - wallThickness * (1 + 2 * smoothing)
196196
)
197197

198198
def decompactify(
@@ -213,7 +213,7 @@ def decompactify(
213213

214214
def term1(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
215215
return np.array((1 - r)
216-
* (r * tailOut - L)
216+
* (2 * r * tailOut - L)
217217
* np.arctanh(
218218
(1 - x + np.sqrt(aOut**2 + (x - r) ** 2))
219219
/ np.sqrt(aOut**2 + (1 - r) ** 2)
@@ -225,7 +225,7 @@ def term1(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
225225

226226
def term2(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
227227
return np.array(-(1 + r)
228-
* (r * tailOut - L)
228+
* (2 * r * tailOut - L)
229229
* np.arctanh(
230230
(1 + x - np.sqrt(aOut**2 + (x - r) ** 2))
231231
/ np.sqrt(aOut**2 + (1 + r) ** 2)
@@ -236,7 +236,7 @@ def term2(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
236236
)
237237
def term3(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
238238
return np.array((1 - r)
239-
* (r * tailIn - L)
239+
* (2 * r * tailIn - L)
240240
* np.arctanh(
241241
(1 + x - np.sqrt(aIn**2 + (x + r) ** 2))
242242
/ np.sqrt(aIn**2 + (1 - r) ** 2)
@@ -247,7 +247,7 @@ def term3(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
247247
)
248248
def term4(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
249249
return np.array(-(1 + r)
250-
* (r * tailIn - L)
250+
* (2 * r * tailIn - L)
251251
* np.arctanh(
252252
(1 - x + np.sqrt(aIn**2 + (x + r) ** 2))
253253
/ np.sqrt(aIn**2 + (1 + r) ** 2)
@@ -257,7 +257,7 @@ def term4(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
257257
/ r
258258
)
259259
def term5(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
260-
return np.array((tailIn + tailOut - 4 * self.smoothing * L / r)
260+
return np.array((2 * tailIn + 2 * tailOut - 4 * self.smoothing * L / r)
261261
* np.arctanh(x)
262262
)
263263
def totalMapping(x: np.ndarray) -> np.ndarray: # pylint: disable=invalid-name
@@ -289,12 +289,12 @@ def compactificationDerivatives(
289289
aOut = self.aOut
290290

291291
dzdzCompact = (
292-
(tailIn - L / r)
292+
(2 * tailIn - L / r)
293293
* (1 - (zCompact + r) / np.sqrt(aIn**2 + (zCompact + r) ** 2))
294294
/ 2
295295
)
296296
dzdzCompact += (
297-
(tailOut - L / r)
297+
(2 * tailOut - L / r)
298298
* (1 + (zCompact - r) / np.sqrt(aOut**2 + (zCompact - r) ** 2))
299299
/ 2
300300
)

src/WallGo/manager.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class WallSolverSettings:
3333
"""If False, will ignore all out-of-equilibrium effects (no Boltzmann solving).
3434
"""
3535

36-
meanFreePathScale: float = 100.0
36+
meanFreePathScale: float = 50.0
3737
"""Estimate of the mean free path of the plasma in units of 1/Tn. This will be used
3838
to set the tail lengths in the Grid object. Default is 100.
3939
"""
@@ -584,7 +584,7 @@ def buildGrid(
584584

585585
# We divide by Tnucl to get it in physical units of length
586586
tailLength = max(
587-
meanFreePathScale, wallThicknessIni * (1.0 + 3.0 * smoothing) / ratioPointsWall
587+
meanFreePathScale, 0.5 * wallThicknessIni * (1.0 + 3.0 * smoothing) / ratioPointsWall
588588
) / Tnucl
589589

590590
if gridN % 2 == 0:

0 commit comments

Comments
 (0)