Roland,
The problem is that your data formatting is messed up. I can't even read the data file you provided with the code you provided. By editing the data file a bit (I broke it into two files because Import was reading it as strings). I was able to read it. Next, you have all these options, constraints and precision specifications that you simply do not need. Your data does not need 20 digits of precision. For example, you have time values in 1 second increments with 20 digits of precision! Mathematica does an excellent fit out of the box.
time = Get["Raw_heatflow_data.txt"];
heatflow = Get["Raw_heatflow_data2.txt"];
ListPlot[Thread[{time, heatflow}]]
t0 = time[[1]];
q0 = heatflow[[1]];
data = Thread[{time, heatflow}];
model = (q0 - (a + b*(t - t0)))*Exp[-(t - t0)/tau] + (a + b*(t - t0));
fit = NonlinearModelFit[
data, {model}, {{a, 1*10^-6`20}, {b, -1*10^-9`20}, {tau, 650`20}},
t];
Show[Plot[fit[x], {x, time[[1]], time[[-1]]}, PlotStyle -> Red],
ListPlot[data], Frame -> True]
Without changing your model, you will unlikely get a better fit. How does this compare to the Matlab Result?
In[20]:= fit["BestFitParameters"]
Out[20]= {a -> -0.000075701139127212902371,
b -> 1.7776365345108173411*10^-8, tau -> 615.11694898053211394}
Regards,
Neil
