mixture API
mixscatter.mixture
This module provides functionalities to represent and create mixtures of spherical particles with various size distributions. It includes classes and functions to handle different distributions like single-component, Flory-Schulz, Gaussian, and uniform distributions.
Classes:
| Name | Description |
|---|---|
Mixture |
Base class representing an N-component mixture of spherical particles. |
FlorySchulzMixture |
Represents a Schulz-Flory distributed mixture. |
GaussianMixture |
Represents a Gaussian distributed mixture. |
UniformMixture |
Represents a uniformly distributed mixture. |
SingleComponent |
Represents a pseudo one-component system. |
FlorySchulzMixture
Bases: Mixture
Representation of a Schulz-Flory distributed mixture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_of_components
|
int
|
Number of components in the mixture. |
required |
mean_radius
|
float
|
Mean radius of the distribution. |
required |
shape_parameter
|
float
|
Flory parameter controlling the distribution shape. |
required |
Source code in src/mixscatter/mixture/mixture.py
GaussianMixture
Bases: Mixture
Representation of a Gaussian distributed mixture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_of_components
|
int
|
Number of components in the mixture. |
required |
mean_radius
|
float
|
Mean radius of the distribution. |
required |
standard_deviation
|
float
|
Standard deviation of the distribution. |
required |
truncate
|
str
|
Method to handle unphysical radii. Options are 'no', 'negatives', and 'symmetric'.
|
'negatives'
|
Source code in src/mixscatter/mixture/mixture.py
Mixture
Representation of the size distribution of an N-component mixture of spherical particles.
Such a mixture can be interpreted as a collection of spheres with a discrete probability distribution of the radii, where the number fraction of each species describes their respective weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
ArrayLike
|
The physical, geometric radius of each component. |
required |
number_fraction
|
ArrayLike
|
Number fraction of each component. |
required |
normalize_number_fraction
|
bool
|
If True, |
True
|
Source code in src/mixscatter/mixture/mixture.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
mean
property
Calculate the first moment (mean) of the distribution.
Returns:
| Type | Description |
|---|---|
float
|
The mean of the distribution. |
number_fraction
property
writable
Get an array of the number fractions of each component
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
An array of the number fractions. |
number_of_components
property
Get the number of components of the mixture.
Returns:
| Type | Description |
|---|---|
int
|
The number of components. |
polydispersity
property
Calculate the polydispersity, which is the ratio of the standard deviation of the distribution to its mean.
Returns:
| Type | Description |
|---|---|
float
|
The polydispersity of the distribution. |
radius
property
writable
Get an array of the radii of each component.
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
An array of the radii. |
variance
property
Calculate the second central moment (variance) of the distribution.
Returns:
| Type | Description |
|---|---|
float
|
The variance of the distribution. |
central_moment(order)
Calculate the central moment of the specified order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
int
|
Order of the central moment to calculate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The central moment of the specified order. |
Source code in src/mixscatter/mixture/mixture.py
moment(order)
Calculate the moment of the specified order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
int
|
Order of the moment to calculate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The moment of the specified order. |
Source code in src/mixscatter/mixture/mixture.py
SingleComponent
Bases: Mixture
Representation of a pseudo one-component system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
Radius. |
required |
Source code in src/mixscatter/mixture/mixture.py
UniformMixture
Bases: Mixture
Representation of a uniformly distributed mixture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_of_components
|
int
|
Number of components in the mixture. |
required |
lower_bound
|
float
|
Lower bound of the distribution domain. |
required |
upper_bound
|
float
|
Upper bound of the distribution domain. |
required |