I am trying to fit the Strohmeyer equation to some fatigue life data using Mathematica 11.2 but I am receiving an error that I do not understand. Below is a MnonWE using a subset of the data:
In[1]:= dataRed={{7050,450},{9850,400},{10870,380},{11762,380},{12200,380},
{12483,380},{13319,380},{13573,380},{15406,380}};
In[2]:= TableForm[dataRed]
Out[2]//TableForm=
7050 450
9850 400
10870 380
11762 380
12200 380
12483 380
13319 380
13573 380
15406 380
In[3]:= model=Exp[Log[cs]-ks Log[s-\[Gamma]]]
Out[3]= cs (s-\[Gamma])^-ks
In[4]:= nlm = NonlinearModelFit[dataRed,model,{cs,ks,\[Gamma]},s]
During evaluation of In[4]:= NonlinearModelFit::nrlnum: The function value {-1.243820030066139*10^396+7.585736074658929*10^395 I,<<7>>,-1.124410753827639*10^396+6.857489839258512*10^395 I} is not a list of real numbers with dimensions {9} at {cs,ks,\[Gamma]} = {551.67,-58.8257,4.8815*10^6}.
Out[5]= FittedModel[551.67 (-4.8815*10^6+s)^58.8257]
So while I do get a result it is completely wrong as it gives complex numbers and the value of $\gamma$ is both negative and enormous which is nor physically realistic.
Also, what is the nrlnum error telling me in plain English?
So thinking that I'd got the order of the independent and dependent variables wrong I swapped the data columns (which was annoyingly laborious. Is there are better way?) and tried again.
In[6]:= a=Transpose[dataRed][[1]]
Out[6]= {7050,9850,10870,11762,12200,12483,13319,13573,15406}
In[7]:= b=Transpose[dataRed][[2]]
Out[7]= {450,400,380,380,380,380,380,380,380}
In[8]:= dataTrans=Transpose[{b,a}]
Out[8]= {{450,7050},{400,9850},{380,10870},{380,11762},{380,12200},{380,12483},{380,13319},{380,13573},{380,15406}}
In[9]:= nlmtrans = NonlinearModelFit[dataTrans,model,{cs,ks,\[Gamma]},s]
During evaluation of In[26]:= NonlinearModelFit::nrlnum: The function value {-2.56588*10^296-1.16791*10^297 I,-2.62127*10^296-1.19313*10^297 I,-2.64376*10^296-1.20336*10^297 I,<<4>>,-2.64376*10^296-1.20336*10^297 I,-2.64376*10^296-1.20336*10^297 I} is not a list of real numbers with dimensions {9} at {cs,ks,\[Gamma]} = {349.398,-57.4312,134874.}.
Out[9]= FittedModel[349.398 (-134874.+s)^57.4312]
and I got the same errors but with different parameter values (which was an expected outcome).
It someone could please explain these errors to me it would be greatly appreciated. I have looked for them in the Mathematica documentation to no avail. If there is a canonical list of Mathematica error messages somewhere on the net that would also be good to know of.
I'm afraid that while I can use Mathematica I'm very much a novice and find its syntax arcane.
Regards,
Bruce
Log
of a negative number. So maybe adding some constraints to prevent that would fix it. $\endgroup$