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

    MC.run¶

    MC.run(model, link_out, nmc_eq=50000, nmc=100000, delta_df=0.05, delta_diff=0.05, num_mc_update=10, temp=1, np=0, print_freq=100, is_print=False, do_radial=False, is_parallel=True)¶

    This function do the MC Cycle to calculate the diffusion and free energy profile over the bins and save the results in an output hdf5 file. This happens with the adjustment of the coefficient from the model which is set with the appropriate model class. The code determines the results for all lag times for which a transition matrix was calculated. The results can be displayed with the post process functions. The MC Algorithm is divided in two parts. Frist ab equilibrium MC run starts to adjust the profile. The number of the equilibrium runs can be set with \(\text{nmc\_eq}\). After the equilibrium phase the sampling of the diffusion profile can start. In this part the MC Algorithm calculates in every step a new diffusion profile. The average over all profiles which are yields in MC production will be determined. The received profile gives the final result. The MC algorithm calculates a diffusion profile for each step length previously specified in the sampling (poreana.sample.Sample.init_diffusion_mc()) and thus, for each lag time. Here you have to set also step the move width of a MC step.

    More information about a MC step can be found in

    • _mcmove_diffusion()

    • _mcmove_df()

    The MC accepted criterium for a MC step is define as

    \[r < \exp \left ( \frac{L_\text{new} - L_\text{old}}{T} \right)\]

    with \(T\) as the temperature, \(r\) as a random number between \(0\) and \(1\) and \(L_\text{new}\) and \(L_\text{old}\) as the likelihood for the current and the last step. The likelihood is calculated with _log_likelihood_z() function.

    Parameters:
    modelclass

    Model object which set before with the model class

    link_outstring

    Link to output hdf5 data file

    nmc_eqinteger, optional

    Number of equilibrium MC steps

    nmcinteger, optional

    Number of production MC steps

    delta_dffloat, optional

    Potential MC move width

    delta_difffloat, optional

    ln(diffusion) MC move width

    num_mc_updateinteger, optional

    Number of moves between MC step width adjustments (=0 if no adjustment is required)

    tempfloat, optional

    Temperature in Monte Carlo acceptance criterium

    npinteger, optional

    Number of cores to use

    print_freqinteger, optional

    Print MC step every print_freq

    is_printbool, optional

    True to print output

    do_radialbool, optional

    True to calculate the radial diffusion

    is_parallelbool, optional

    True to run parallelized sampling

    Back to top

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