Bugzilla for GALPROP – Bug 6
Jagged IC spectrum above 1 TeV
Last modified: 2013-11-28 00:45:11 PST
The bug is described here:
As suggested by Andrey I reran the analyses varying the E_gamma_factor parameter.
1) for E_gamma_factor=1.5 (like in your run) I get the same jagged spectrum of IC.
2) for E_gamma_factor=1.3 (just to make it smaller), IC came out with a smooth spectrum.
3) for E_gamma_factor=1.19 (a test), the IC spectrum is jagged again.
You can find the results here:
Indeed the spectrum is only smooth for E_gamma_factor=Ekin_factor.
Andrey mentioned that this might be some interpolation problem in GALPROP.
can you try with integration_mode = 1 for comparison ?
this is a simpler method, there were some problems with power-law integration although this should be better in principle when E_kin_factor is not small enough.
integration_mode =1 should anyway work perfectly when E_kin_factor is small enough.
(In reply to comment #1)
> can you try with integration_mode = 1 for comparison ?
No, I don't think I can change integration_mode to value 1.
integration_mode is a Fixed parameter in the web interface.
then we should allow it to be changed.
I will try your cases.
Could you send the plots ?
meanwhile try e.g. E_kin_factor << E_gamma-factor
this shows we definitely need an advanced user option to allow all values of parameters !
Created attachment 1 [details]
Here is the spectrum plot for the E_gamma_factor = 1.5 plot that shows the problem.
There is an advanced user option that should allow to change the integration modes (if not, we can easily put that into the advanced user mode). What do the results look like if you (Andy) run using the integration mode that should not have the problem Christoph is finding?
(In reply to comment #6)
At the moment each parameter has a "Mode" which is either "First-time", "Advanced" or "Fixed".
I recommend changing "Fixed" to "Expert" and adding a button "Expert User Mode" on the left.
so it is really starting > 1 TeV where the electrons are > 10 TeV mostly.
so it could be the electrons going crazy there.
could you plot the electrons ?
following Troy's suggestion I will try this out too.
looking at all the runs I made for papers etc recently I notice I always used E_kin_factor=E_gamma_factor, but can't remember if that was because of this problem or what. To be investigated.
Created attachment 2 [details]
Here is the electron spectrum.
It is smooth.
OK so it must be the integration. The high-res E_gamma_factor runs will help.
we did have originally have a similar problem with IC due to machine accuracy (these numbers get pretty small at high energies), but thought it was solved since galprop is now double precision everywhere. Will check on that too.
Some parameters are fixed now because they exist either for debugging, or for historic reasons, and we want to prevent misconfigured runs. I don't imagine how it will be useful to allow all parameters to be changed in an "expert mode", but this idea has come up in the past, we can think about it again for the future updates of WebRun, if users find it necessary.
Meanwhile, I allowed the parameter integration_mode to be changed, and with integration_mode=1 (obsolete), the IC spectrum is still jagged, but the spectrum of bremsstrahlung also gets non-smooth (one of the reasons to keep this parameter at =0).
option 1 is useful since it is much simpler implementation, does not assume a powerlaw. at least as a cross-check.
anyway I suspect a machine precision problem here. will be interesting to compare running on various machines.
I reproduced the wiggles, and established that it is only in the CMB component
(The IC output includes optical, FIR and CMB separately).
The rest are smooth right up to 100 TeV.
So it is coming from the highest energy electrons.
That was for integration_mode=0, now will try 1.
NB in any case such high energy electrons have such drastic energy losses that it is at the limits of what galprop can do. But this does not excuse the wiggles.
NB I use E_kin_max=1e9 since with 1e8 you won't make any 100 TeV IC
(even at KN limit, energy is conserved ! )
integration_mode = 1 has the same problem (and bremss. is jagged too)
so that doesn't help.
I guess it is connected with the KN regime, since there Egamma ~ Eelectron
and the cross-section is very peaked,
so the electron binning is critical. Will make a corresponding test.
We probably need a difference technique for this case.
I ran with E_kin_factor = 1.05, E_kin_max=1e9, integration_mode = 1 and the spectrum is now perfectly smooth. So it is due to the peaked cross-section as mentioned above.
I will now try integration_mode = 0 for the same parameters.
NB smooth does not necessarily mean correct. We may need another method here, as mentioned above.
with E_kin_factor=1.05 integration_mode =0 (powerlaw interpolation) it gives exactly the same, smooth spectrum as integration_mode=0, so this is the solution,
and a good check on the method too.
In fact it is always better to use small factors, this is a numerical code after all. We often use 1.3 or 1.5 for fast results, but these are not so accurate e.g. even for the propagation calculation (energy losses etc).
Christof could you make a short systematic study by comparing the results for various E_kin_factor, say 1.001.. 1.01.. 1.1
This will help me to evaluate the absolute accuracy of the method.
The jobs are running. I'll post a plot showing the differences on Monday.
I just started using GALPROP again.
What's the status on this?
Should I attach the results to this ticket as you suggested in 2010 or re-run or ... ?
(In reply to Christoph Deil from comment #21)
> I just started using GALPROP again.
> What's the status on this?
> Should I attach the results to this ticket as you suggested in 2010 or
> re-run or ... ?
A general rule is that small Ekin factors should be used, otherwise the solution is anyway inaccurate.