PoreAna 0.2
  • API
  • Sample
  • Density
  • Diffusion (Bin)
  • Diffusion (MC)
  • Further Properties
  • Site
    • Page
        • mc_fit
          • mc_fit()
    • mc_fit
      • mc_fit()
    Source

    mc_fit¶

    poreana.diffusion.mc_fit(link, len_step=[], section=[], is_std=False, is_print=True, is_plot=True, kwargs_scatter={}, kwargs_line={})¶

    This function uses the diffusion profiles over box length which are calculated in the function poreana.mc.MC.run() to estimate the final diffusion coefficient. For that a line is fitted of the averaged diffusion profiles \(D_{\mathrm{mean}}({\Delta t_{\alpha}})\) for the different lag times as a function of \(1/\Delta t_{\alpha}\). The function plots all mean diffusion \(D_\mathrm{mean}({\Delta t_{\alpha}})\) over the inverse lag times and the linear fit. Additionally, the final diffusion coefficient \(D\) for a lag time \(\Delta t_{\alpha} \rightarrow \infty\) is printed. Also, a table of the selected step length and the belonging \(D_{\mathrm{mean}}({\Delta t_{\alpha}})\) can be displayed.

    In order to be able to estimate how the choice of lag times affects the result, an additional error estimation is possible. For this all possible fourth tuples of the entire calculated lag times are used to estimate a mean diffusion coefficient \(\langle D \rangle\) which is the mean value of all fourth tuples fitting results. Also, the standard deviation of all fitting results is printed. If there is no big difference between the diffusion coefficient \(D\) and the mean diffusion coefficient \(\langle D \rangle\), all \(D_\mathrm{mean}({\Delta t_{\alpha}})\) are on a straight line. The standard deviation also can be used to check if the result fluctuates strongly at the choice of other lag times. This error estimate is calculated if \(\mathrm{is}\_{\mathrm{std}}=True\).

    Parameters:
    link: string

    Link to the diffusion hdf5 data file generated by the MC Alogrithm poreana.mc.MC.run()

    len_step: integer, list, optional

    List of the different step length, if it is [] all calculated lag times will be used to fit the diffusion coefficent

    sectionlist, string, optional

    If \(\mathrm{section} = \mathrm{"pore"}\) the pore section is fitted. If \(\mathrm{section} = \mathrm{"reservoir"}\) the left reservoir area is fitted. If \(\mathrm{section} = \mathrm{[a,b]}\) the box area between a and b is fitted.

    is_stdbool, optional

    True to calculate a mean diffusion coefficient to assess the dependency of the result on the selected lag time

    is_printbool, optional

    Print diffusion coefficient

    is_plotbool, optional

    Show the fitting plot

    kwargs_scatter: dict, optional

    Dictionary with plotting parameters for the points

    kwargs_line: dict, optional

    Dictionary with plotting parameters for the fitting line

    Returns:
    diffusion: float

    Diffusion coefficient \(D \ \left( 10^{-9} \frac{m^2}{s}\right)\) for the calculated system

    diffusion_mean: float

    Mean diffusion coefficient \(\langle D \rangle \ \left(10^{-9} \frac{m^2}{s}\right)\) for the calculated system

    diff_tableobj

    Table of used lag times with the associated \(D_{\mathrm{mean}}({\Delta t_{\alpha}}) \ \left(10^{-9} \frac{m^2}{s}\right)\)

    resfloat

    error of intercept \(\left(10^{-9} \frac{m^2}{s}\right)\) for fitting the selected lag times

    Back to top

    © Copyright 2021, Hamzeh Kraus.
    Created using Sphinx 7.4.6.