aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters/halo.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-18 23:20:40 +0800
committerAaron LI <aly@aaronly.me>2017-10-18 23:20:40 +0800
commit13861dc37376e04ea64bbf61a49c0f183d84a558 (patch)
tree98509b580662f9e1abdd5f81c04295806e33cff3 /fg21sim/extragalactic/clusters/halo.py
parent375198fb380933ea1b00f2e42401550ae20da76d (diff)
downloadfg21sim-13861dc37376e04ea64bbf61a49c0f183d84a558.tar.bz2
clusters/halo: Increase the time step, but require a minimum of 20 steps
Diffstat (limited to 'fg21sim/extragalactic/clusters/halo.py')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index 6bfa4ca..a481ce5 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -290,6 +290,13 @@ class RadioHalo:
n_inj = self.fp_injection(self.gamma)
n0_e = n_inj * tstart
+ # When the evolution time is too short, decrease the time step
+ # to improve the results.
+ # XXX: is this necessary???
+ nstep_min = 20
+ if (tstop - tstart) / self.fpsolver.tstep < nstep_min:
+ self.fpsolver.tstep = (tstop - tstart) / nstep_min
+
self.electron_spec = self.fpsolver.solve(u0=n0_e, tstart=tstart,
tstop=tstop)
return self.electron_spec