weibull#

weibull(network, shape, scale, loc, seeds='pore.seed')[source]#

Produces values from a Weibull distribution given a set of random numbers.

Parameters:
  • network (OpenPNM Network object) – The network object to which this model is associated (i.e. attached). This controls the length of the calculated array(s), and also provides access to other necessary properties.

  • seeds (str (dict key)) – Name of the dictionary key on the target object pointing to the array containing values of eed

  • shape (float) – Controls the width or skewness of the distribution. For more information on the effect of this parameter refer to the corresponding scipy.stats function.

  • scale (float) – Controls the width of the distribution. For more information on the effect of this parameter refer to the corresponding scipy.stats function.

  • loc (float) – Specifies the central value of ???

Returns:

values – A numpy ndarray containing values following the distribution

Return type:

ndndarray

Examples

The following code illustrates the inner workings of this function, which uses the ‘weibull_min’ method of the scipy.stats module. This can be used to find suitable values of ‘shape’, ‘scale’` and ‘loc’. Note that ‘shape’ is represented by ‘c’ in the actual function call.

import numpy
import scipy.stats
import matplotlib.pyplot as plt

func = scipy.stats.weibull_min(c=1.5, scale=0.0001, loc=0)
plt.hist(func.ppf(q=numpy.random.rand(10000)), bins=50)

plt.show()
../../_images/openpnm-models-geometry-pore_size-weibull-1.svg