Bug 6 - Jagged IC spectrum above 1 TeV
Jagged IC spectrum above 1 TeV
Product: GALPROP Code
Classification: Unclassified
Component: Code
54 (in WebRun)
: --- normal
Assigned To: Andy Strong
Depends on:
  Show dependency treegraph
Reported: 2010-09-01 05:38 PDT by Christoph Deil
Modified: 2013-11-28 00:45 PST (History)
2 users (show)

See Also:
Web Browser: ---

Requested plot (12.50 KB, image/png)
2010-09-01 09:13 PDT, Christoph Deil
Electron spectrum (10.81 KB, image/png)
2010-09-01 09:28 PDT, Christoph Deil

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Deil 2010-09-01 05:38:42 PDT
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:
1) http://galprop.stanford.edu/wrxiv/0353/results_54_0353000b_n7ndsk3opvktzios.tar.gz
2) http://galprop.stanford.edu/wrxiv/0353/results_54_0353000c_v1zjwo11bwa8zhnd.tar.gz
3) http://galprop.stanford.edu/wrxiv/0353/results_54_0353000d_82d1qhkgwxe6p6ko.tar.gz

Indeed the spectrum is only smooth for E_gamma_factor=Ekin_factor.
Andrey mentioned that this might be some interpolation problem in GALPROP.

Comment 1 Andy Strong 2010-09-01 08:54:40 PDT
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.
Comment 2 Christoph Deil 2010-09-01 09:01:01 PDT
(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.
Comment 3 Andy Strong 2010-09-01 09:05:39 PDT
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
Comment 4 Andy Strong 2010-09-01 09:06:44 PDT
this shows we definitely need an advanced user option to allow all values of parameters !
Comment 5 Christoph Deil 2010-09-01 09:13:34 PDT
Created attachment 1 [details]
Requested plot

Here is the spectrum plot for the E_gamma_factor = 1.5 plot that shows the problem.
Comment 6 Troy Porter 2010-09-01 09:17:22 PDT
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?
Comment 7 Christoph Deil 2010-09-01 09:20:53 PDT
(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.
Comment 8 Andy Strong 2010-09-01 09:22:29 PDT
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.
Comment 9 Andy Strong 2010-09-01 09:27:06 PDT
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.
Comment 10 Christoph Deil 2010-09-01 09:28:43 PDT
Created attachment 2 [details]
Electron spectrum

Here is the electron spectrum.
It is smooth.
Comment 11 Andy Strong 2010-09-01 09:34:33 PDT
OK so it must be the integration. The high-res E_gamma_factor runs will help.
Comment 12 Andy Strong 2010-09-01 09:37:10 PDT
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.
Comment 13 Andrey Vladimirov 2010-09-01 12:53:34 PDT
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).
Comment 14 Andy Strong 2010-09-01 13:01:07 PDT
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.
Comment 15 Andy Strong 2010-09-02 02:57:25 PDT
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.
Comment 16 Andy Strong 2010-09-02 03:12:53 PDT
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 ! )
Comment 17 Andy Strong 2010-09-02 05:47:13 PDT
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.
Comment 18 Andy Strong 2010-09-02 09:36:05 PDT
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.
Comment 19 Andy Strong 2010-09-02 23:41:45 PDT
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.
Comment 20 Christoph Deil 2010-09-03 04:50:22 PDT
The jobs are running. I'll post a plot showing the differences on Monday.
Comment 21 Christoph Deil 2013-11-27 13:35:14 PST
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 ... ?
Comment 22 Andy Strong 2013-11-28 00:45:11 PST
(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.