# Modelling the heat exchange between a steel cylinder and the surrounding medium [duplicate]

Massively refactoring my question after @user2974951 feedback below.

I have a set of measurements (time, temperature) that correspond to a certain physical process. Both time and temperature measurements have some error.

The model of the process I'm going to use is

$$f(t) = a + e^{bt}$$

where $$f(t)$$ is the temperature, $$t$$ is the time, and $$a$$ and $$b$$ are some unknown coefficients.

What would be the best approach to find these unknowns?

My brute-force approach would be to iteratively bisect both $$a$$ and $$b$$ by going over the dataset multiple times, but perhaps there is a more efficient solution.

EDIT:

An example dataset would be [(3.7,15.1), (5.5,14.3), (7.1,13.6), (8.9,13.0), (9.7,12.8), ...] and the output of the algorithm would be something like a=10, b=-0.1. The actual output values would be similar, but not exactly what I specified.

EDIT 2:

There are typically more points in the dataset than just the 5 that I initially suggested. I would guess that we can afford at least 10 measurements, maybe more, but not arbitrarily more - PSNR drops, and we eventually measure only noise.

The error in the time variable $$t$$ is small, only a few milliseconds, while the whole timespan is many seconds. The error in the temperature variable is significantly larger, say 5% of the whole observed range.

EDIT 3:

It seems that I forgot about horizontal alignment and to address that I need the third unknown. Therefore the approximating formula becomes

$$f(t) = a + e^{bt + c}$$

which adds another level of complication to my naive brute-force approach.

EDIT 4:

My question was marked as a duplicate, but it's not the same topic as referred questions. I can't use a well-established software where I just say "make a fit" and the curve is automagically fitted for me. I have to actually implement the fit myself.

Answering a question below - if implemented on an embedded platform, then this would be C and no external libraries. If implemented server-side - then Java or Kotlin and a wide choice of what to link against.

EDIT 5:

I can't answer my own question, perhaps because it's marked as a duplicate. This is the last update.

I have settled on my bisect algorithm (first $$b$$, then $$c$$, then $$a$$) that gives me $$O(N (logN)^2)$$ complexity. It feels fast on a mac, but I have doubts if it is suitable for an embedded solution on a low-power ARM processor.

• Probably better to ask on the physics forum, my guts tell me this will be solved using differential equations. – user2974951 Jul 17 '19 at 5:55
• Your situation is interesting because it involves errors in the independent variable $t,$ but for the same reason it is problematic because that requires you to estimate at least four parameters ($a, b,$ and the variances of errors in $t$ and $f$) using only five points. It would therefore help if you had reliable independent estimates of the two error variances or if you could collect more data. – whuber Jul 17 '19 at 11:55
• There are many more posts that answer this question, but finding them might take some creativity because people often use unusual terms to describe this model. "Nonlinear regression" might be two useful keywords. – whuber Jul 17 '19 at 15:03
• What programming language or statistics software would you prefer to use? – James Phillips Jul 19 '19 at 0:14