Dear Jim,
Thank you for your contribution. Lets try to solve this error/freezing...
I'll give more details about this simple code. It is a cumulative size distribution from fine powders.
First, I performed the "BinCounts" from raw data.
The "bin" stepsize follow a power range as bellow:
where "dpi" is the particle diameter in micrometers
dpi = N[PowerRange[1, 14000, 2^(1/3)]]
Then, I obtained the mean dpi, which is used as x-axis data:
bindpi = Length[dpi] - 1;
dpimean = ConstantArray[0, bindpi];
Do[dpimean[[i]] = (dpi[[i]] + dpi[[i + 1]])/2, {i, 1, bindpi}]
x-axis data is:
xdata={1.12996,1.42366,1.7937,2.25992,2.84732,3.5874,4.51984,5.69464,7.1748,9.03968,11.3893,14.3496,18.0794,22.7786,28.6992,36.1587,45.5572,57.3984,72.3175,91.1143,114.797,144.635,182.229,229.594,289.27,364.457,459.187,578.54,728.914,918.375,1157.08,1457.83,1836.75,2314.16,2915.66,3673.5,4628.32,5831.32,7347.,9256.64,11662.6}
y-axis data is (this is another data that is fitting correctly):
ydata={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.169972,0.705382,0.926346,0.988669,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.}
Then, I have the X,Y fitting Array
sizedistcum = Transpose[{xdata, ydata}]
Finally, I used the Rosin-Rammler exponential function and the nonlinear optimization:
RRmodel = 1 - Exp[-(x/dm)^n];
nlm = NonlinearModelFit[sizedistcum, RRmodel, {{dm, 10}, {n, 1}}, x];
{{dm, n}} = {dm, n} /. nlm[{"BestFitParameters"}]
{{dmdev, ndev}} = nlm[{"ParameterErrors"}]
RRrsquared = nlm[{"RSquared"}]
nlm[{"ParameterTable"}]
The "Memory Error" still occured with some y-data (not with all size distributions).. as example the following y-data showed this message error when try evaluated:
ydata={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.00215924,0.0283401,0.0537112,0.0753036,0.103104,0.268826,0.832659,0.964372,0.993522,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.}
Thanks,
Gustavo