mceq-project / MCEq

Matrix cascade equation core code
BSD 3-Clause "New" or "Revised" License
30 stars 33 forks source link

Wish: simulating water/ice/rock propagation (with different water models) #16

Closed pkalaczynski closed 10 months ago

pkalaczynski commented 4 years ago

Hi again!

is there any plan on including water/ice/rock propagation? This would be really great for systematic studies for a number of experiments (although my guess is it may not be so simple).

afedynitch commented 4 years ago

Hi.

Well, it is actually already there but somewhat unfinished and not fully debugged. There is a density class called GeneralizedTarget. This gives you a 1D target with piece-wise homogeneous media. This may be numerically unstable and needs sometimes a bit of fiddling mainly because I have no time to properly debug it. There are even people using this.

To switch to one of these media ['air', 'standard_rock', 'ice', 'water'], look at line 368 in data.py. These are dEdX tables from PDG. I had no time yet to make a user iface. If you think a config variable will do the job, let me know or feel free to propose something. If you compute also hadronic cascades and not just muons, you need to adjust A_target in the config and preferably not deviate much from 14 since the interaction tables are for air (but dependence is relatively weak).

Look at the attached jupyter notebook for how to interact with this feature. You should definitely compare this with some kind of benchmark calculation or a different code, for instance PROPOSAL Please let me know about the results, positive or negative, since I have no idea. ArbitraryDensityPrototype.zip

pkalaczynski commented 4 years ago

Thanks, will have a look!

pkalaczynski commented 4 years ago

Hmm, when I execute ad.draw_materials() in your jupyter notebook it does not display a plot :< Do I need %run -i "../../initjupyter_ng.py" for this?

afedynitch commented 4 years ago

That's a remnant of my dev environment. There are just basic settings and imports. Replace it with

# %run -i "../../initjupyter_ng.py"
import numpy as np
%matplotlib inline
import mceq_config as config
from MCEq.core import MCEqRun
import crflux.models as pm
import matplotlib.pyplot as plt
pkalaczynski commented 4 years ago

The notebook works, however by the similar logic as in the muon bundles issue, I drop this for now.

pkalaczynski commented 10 months ago

FYI, I've tested this notebook with MCEq v1.2.6 and the ratio of muon spectrum to the one at the surface seems not to produce the same result anymore.

plot from your notebook: image

what I get running the same code: image

afedynitch commented 10 months ago

Hi! Could you please share some pieces of your code? What are we looking at here?

pkalaczynski commented 10 months ago

Ah, tried now to reproduce from scratch from your ArbitraryDensityPrototype.ipynb notebook and when I just add missing imports I do get the same plot, must have modified something else when playing with things. Sorry for the false alarm 🙈. I wanted to try to evaluate muon and neutron fluxes in two underground mines, but I was getting strange results... I might produce a comparison with something else at some point as a cross-check, will post it here for reference.

afedynitch commented 10 months ago

Glad to hear. But good that you mention that you want to compute underground labs. If these labs are deep, i.e. X > 1 kmwe then the MCEq propagation is not going to return accurate results. There are some technical reasons behind it, which are not relevant for X < 100000 g/cm2 but become relevant for larger depth. You may want to consider using the code MUTE, which makes use of MCEq at the surface and then does some convolutions to calculate the underground or underwater fluxes.

pkalaczynski commented 10 months ago

Well, they're roughly around 800 mwe, so it may still work. Thanks for the recommendation, I'll check MUTE out as well!

pkalaczynski commented 10 months ago

Oh, basically MCEq + PROPOSAL, I see :)

pkalaczynski commented 7 months ago

Thanks for the recommendation @afedynitch, MUTE was exactly what I needed :)