dcmri.conc_free#
- dcmri.conc_free(J, H, t=None, dt=1.0, TT=None, TTmin=0, TTmax=None, solver='trap')[source]#
Indicator concentration inside a free system.
See section Free for more detail.
- Parameters:
J (array_like) – the indicator flux entering the system.
H (array_like) – frequencies of the transit time histogram in each transit time bin. These do not have to be normalized - the function normalizes to unit area by default.
t (array_like, optional) – the time points of the indicator flux J, in the same units as T. If t=None, the time points are assumed to be uniformly spaced with spacing dt. Defaults to None.
dt (float, optional) – spacing between time points for uniformly spaced time points, in the same units as T. This parameter is ignored if t is explicity provided. Defaults to 1.0.
TT (array_like) – boundaries of the transit time histogram bins. The number of elements in this array must be one more than the number of elements in H. If TT is not provided, the boundaries are equally distributed between TTmin and TTmax. Defaults to None.
TTmin (float) – Minimal transit time to be considered. If TT is provided, this argument is ignored. Defaults to 0.
TTmax (float) – Maximal transit time to be considered. If TT is provided, this argument is ignored. Defaults to the maximum of t.
- Returns:
Concentration as a 1D array.
- Return type:
Example
>>> import dcmri as dc >>> t = [0,5,15,30,60] >>> J = [1,2,3,3,2]
Assume the transit time histogram is provided by two equally sized bins covering the entire time interval, with frequencies 2 and 1, respectively:
>>> dc.conc_free(J, [2,1], t) array([ 0. , 7.25308642, 29.41358025, 61.41975309, 77.56944444])
Assume the transit time has two equally sized bins, but between the values [0.5, 2.5]:
>>> dc.conc_free(J, [2,1], t, TTmin=0.5, TTmax=2.5) array([ 0. , 4.75925926, 10.15740741, 11.5 , 8.10185185])
Assume the transit time histogram is provided by two bins in the same range, but with different sizes: one from 0.5 to 1 and the other from 1 to 2.5. The frequencies in the bins are the same as in the previous example:
>>> dc.conc_free(J, [2,1], t, TT=[0.5,1.0,2.5]) array([ 0. , 4.64814815, 9.58101852, 10.75 , 7.5462963 ])
If the time array is not provided, the function assumes uniform time resolution with time step = 1:
>>> dc.conc_free(J, [2,1], TT=[0.5,1.0,2.5]) array([0. , 1.17777778, 2.45555556, 3.25277778, 3.075 ])
If the time step is different from 1, it needs to be provided explicitly:
>>> dc.conc_free(J, [2,1], dt=2.0, TT=[0.5,1.0,2.5]) array([0. , 2.05555556, 3.87037037, 4.76388889, 4.14351852])