% Input a size vector, d, (sieve sizes) and cumulative retained mass
% fraction vector, Rd. A linear fit is used to calculate
% Rosin-Rammler (RR) parameters, which are used to generate two plots:
% (1) Retained mass % vs sieve size.
% (2) Cumulative % passing vs sieve size (cumulative density function).
% The RR equation: Rd = exp(-d/k)^n,
% The linear form of the RR equation is used in this function:
% log(-log(Rd)) = n*log(d)+c, where c = n*log(k).
% d: sieve diameters used
% Rd: Rd(d) cumulative mass fraction retained on each sieve.
%% Output variables and values:
% n: uniformity constant of the material
% k: characteristic particle size, defined as the size
% at which 63.2% (1-1/e = 0.632) of the particles (by weight)
% are smaller.
% R2: RR coefficient of determination. How well RR model fits the data.
%% Input case 1:
% [n,k,R2,p80,p50] = RRfit(d, Rd);
% - Sieve diameters and cumulative retained fraction column vectors
% are input. For retained mass fraction, use 0 to 1 scale, not
% 0 to 100.
% - The size vector must start with the top size at which no material is
% passing. In the 'Example input', below, no material (0) passes
% is passing the 6 mm sieve.
%% Example input, case 1:
% d = [6.00; 4.75;3.35;1.7;0.85;0.425;0.3;0.106;0.038];
% Rd = [0.0000; 0.0158;0.0500;0.1342;0.2860;0.3684;0.5219;0.7693;0.8789];
% [n,k,R2,p80,p50] = RRfit(d,Rd)
% >> n = 0.7068
% >> k = 0.6136
% >> R2 = 0.9899
% >> p80 = 1.2031
% >> p50 = 0.3653
%% Input case 2:
% [n,k,R2,p80,p50] = RRfit;
% -Sample data is plotted if no variables are passed to the function
% Vesilind, P.A. 1980, Res. Rec. and Cons. vol. 5, 275-277.
% Plot labelling in this function was inspired by Ivan Brezani's RRD.m
% M. Ryan MacIver 2015.
M. Ryan MacIver (2023). rosRamFit (https://www.mathworks.com/matlabcentral/fileexchange/55290-rosramfit), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: Rosin-Rammler Diagram plot function
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!