Message Boards Message Boards

0
|
5183 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

NonlinearModelFit not running

Dear All,

I'm fairly new to Mathematica. Please bear with me.
I've already been able to fit some experimental data in Matlab. However, I want to implement it in Mathematica as well, so as to extract the statistics easier each time.
The following is the model function I use. However, as I run the code it gives me a straight line which does not match my experimental data at all.
My very first question is, whether the way I've defined the function is correct or not?

I've attached the file which containes both the experimental data and the fitting function.
I greatly appreacite your helps in advance.

Kind Regards,
Arman
Attachments:
2 Replies
As it stands, the starting parameters are bad and the model has no variance over the range, try
Plot[model[x, 37., 1.68, 50., 0.46, 0.73], {x, 1.63, 1.71},
Epilog -> {PointSize[Small], Point[Data4kI3]},  PlotRange -> Automatic]
and see that the model grows seemingly linear between
In[60]:= model[#, 37., 1.68, 50., 0.46, 0.73] & /@ {1.63, 1.71}
Out[60]= {3.21643, 3.21647}
3.21643 and 3.21647, but the data vary in y from 0.56 to 0.63 over the range and have a strong peak around x = 0.65.
Look at this
Plot[model[x, 37., 1.68, 50., 0.01, 0.55], {x, 1.63, 1.71},
Epilog -> {PointSize[Small], Point[Data4kI3]},  PlotRange -> {{1.63, 1.71}, {0.56, 0.64}}]
to estimate how bad (without variability) the model is over the x-range the data have. Therefore NonlinearModelFit[] gives nothing but a horizontal line at about y=0.601 back.

What to do next:
  • Check the model (typos, missing expressions, ...)
  • find a parameter area where it has the variability which is necessary to fit the data
  • if such an area of parameters is not available: change the model
  • return to NonlinearModelFit[] and get the job done
POSTED BY: Udo Krause
POSTED BY: Chris Degnen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract