If I have the following data:
data={{2, 66.7635}, {Log[300]/Log[10], 69.9679}, {Log[600]/Log[10],
71.54}, {3, 72.2428}, {-2.30103, 54.0023}, {-(Log[60]/Log[10]),
55.1941}, {-(Log[20]/Log[10]), 56.0038}, {-1,
56.9497}, {-(Log[6]/Log[10]), 57.305}, {-(Log[10/3]/Log[10]),
57.7213}, {-(Log[2]/Log[10]), 58.2489}, {-2.30103,
54.0367}, {-(Log[60]/Log[10]), 55.1157}, {-(Log[20]/Log[10]),
56.1704}, {-1, 56.7117}, {-(Log[6]/Log[10]),
57.2506}, {-(Log[10/3]/Log[10]), 57.7097}, {-(Log[2]/Log[10]),
58.1068}}
Which looks like this plotted:
I have two questions:
1) How can I fit and plot the fit of this data based on the following equation?
:
where Tf'_ref=57.2506
, q_ref=0.166667
and c1 and c2 are the fitting parameters. Also, notice that data
is Tf'
vs Log q
in the equation. "Log" in the equation refers to based 10 logarithm and not to natural logarithm.
2) How can I find the values of c1
and c2
which are the fitting parameters.
The fitting (orange line) is supposed to look like this (done in excel):
with fitting parameters c1=9.43903909249581
and c2=23.1214485816819
EDIT: I tried using NonLinearFitModel
like this: Table[{NonlinearModelFit[data, Logqref - ((c1*(data[[i, 2]] - Tfref))/(c2*(data[[i, 2]] - Tfref))), {{c1, 8.6}, {c2, 17.2}}, x]; }, {i, 1, 11}]
but this does not work. The reason I tried this is because data[[i, 2]]
represents Tf'
in the equation. Here Logref=Log10[0.16667]
EDIT2: When I do it in Excel c1=9.43903909249581
and c2=23.1214485816819
. When I put this parameters into the equation they seem to fit the equation very well as well. Since the parameters found by @Bob Hanlon seems to fit the data very well as well, 3) How can I know what is the best parameters to fit and how could mathematica also find the parameters I found in excel, which seems to have a lower sum of errors squared?
Table[{NonlinearModelFit[data, Logqref - ((c1*(data[[i, 2]] - Tfref))/(c2*(data[[i, 2]] - Tfref))), {{c1, 8.6}, {c2, 17.2}}, x]; }, {i, 1, 11}]
. This is not working because what I am trying is to usedata[[i,2]]
to get theTf'
and fit them but I do not think this is the right approach. HereLogref=Log10[0.16667]
$\endgroup$