dcmri.prop_ncomp#
- dcmri.prop_ncomp(T, E, t)[source]#
Propagator of an n-compartment system.
See section N-compartment system for more detail.
- Parameters:
T (array_like) – n-element array with mean transit times of each compartment.
E (array_like) – dimensionless and square n x n matrix. An off-diagonal element E[j,i] is the extraction fraction from compartment i to compartment j. A diagonal element E[i,i] is the extraction fraction from compartment i to the outside.
t (array_like) – the time points of the indicator flux J, in the same units as T. If t is not provided, the time points are assumed to be uniformly spaced with spacing dt. Defaults to None.
- Returns:
Propagator for each arrow as a 4D array with dimensions (n,n,n,k), where n is the number of compartments and k is the number of time points in t. Encoding of the first indices is as follows: H[i,k,j,:] is the propagator from the inlet at compartment i to the outlet from j to k. The diagonal element H[i,j,j,:] is the propagator from the inlet at i to the outlet of j to the environment.
- Return type:
See also
Example
>>> import numpy as np >>> import dcmri as dc
Consider a measurement with 10 time points from 0 to 20s, and a 2-compartment system defined by T and E as follows:
>>> t = np.linspace(0, 20, 10) >>> T = [20,2] >>> E = [[0.7, 0.9], [0.3, 0.1]]
Calculate the propagator for the system:
>>> H = dc.prop_ncomp(T, E, t)
The propagator from the inlet at 1 (first index = 1) to the outlet of compartment 0 is:
>>> H[1,0,0,:] array([0. , 0.019906 , 0.02474194, 0.0248889 , 0.02364703, 0.02206017, 0.02045362, 0.01892422, 0.01749653, 0.01617252])
The propagator from the inlet at 1 (first index = 1) to the outlet from 0 to 1 is:
>>> H[1,1,0,:] array([0. , 0.00853114, 0.01060369, 0.01066667, 0.01013444, 0.00945436, 0.00876584, 0.00811038, 0.00749851, 0.00693108])