aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-25 14:41:25 +0800
committerAaron LI <aly@aaronly.me>2017-10-25 14:41:25 +0800
commitbd8b01302d77df4a74da4e8374f0e32a8ec2598b (patch)
tree2d3a5a44736511f74d330bab4da2c1e4c309a9ad
parented5ccfd562bff2e2c790395f8379eb36c4745c8d (diff)
downloadfg21sim-bd8b01302d77df4a74da4e8374f0e32a8ec2598b.tar.bz2
clusters/halo: Adjust initial electron spectrum calculation
-rw-r--r--fg21sim/configs/20-extragalactic.conf.spec2
-rw-r--r--fg21sim/extragalactic/clusters/halo.py10
2 files changed, 7 insertions, 5 deletions
diff --git a/fg21sim/configs/20-extragalactic.conf.spec b/fg21sim/configs/20-extragalactic.conf.spec
index f7f96a8..94b2fe4 100644
--- a/fg21sim/configs/20-extragalactic.conf.spec
+++ b/fg21sim/configs/20-extragalactic.conf.spec
@@ -192,7 +192,7 @@
# an approximately steady initial electron spectrum. During this period,
# the acceleration is turned off and only leaves energy loss mechanisms.
# Unit: [Gyr]
- time_init = float(default=0.4, min=0)
+ time_init = float(default=0.6, min=0)
# Extragalactic point sources
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index 02d8891..d543dcc 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -407,10 +407,12 @@ class RadioHalo:
n0_e = n_inj * self.age_merger
logger.debug("Derive the initial electron spectrum ...")
- tstart = self.age_merger - self.time_init
- tstop = self.age_merger
+ # NOTE: subtract ``time_step`` to avoid the acceleration at the
+ # last step at ``age_merger``.
+ tstart = self.age_merger - self.time_init - self.time_step
+ tstop = self.age_merger - self.time_step
# Use a bigger time step to save time
- self.fpsolver.tstep *= 2
+ self.fpsolver.tstep = 3 * self.time_step
n_e = self.fpsolver.solve(u0=n0_e, tstart=tstart, tstop=tstop)
# Restore the original time step
self.fpsolver.tstep = self.time_step
@@ -730,7 +732,7 @@ class RadioHalo:
if (t < self.age_merger) or (t > self.age_merger+self.time_crossing):
# NO acceleration; use a large enough timescale to avoid
# unstable results.
- tau_acc = 10.0 # [Gyr]
+ tau_acc = 100 # [Gyr]
else:
# Turbulence acceleration
tau_acc = self.tau_acceleration # [Gyr]