В качестве «доказательства концепции» для двух температурных датчиков (не помещая здесь шум и не думая о реальных параметрах):
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import leastsq
def strain( t, a, b, c, d ):
return a * t**3 + b * t**2 + c * t + d
def residuals( params, x1Data, x2Data, yData ):
s1, s2, a, b, c, d = params
cxData = [ (s1**2 * x1 + s2**2 * x2) /( s1**2 + s2**2 ) for x1, x2 in zip( x1Data, x2Data) ]
diff = [ strain( x, a, b, c, d ) -y for x, y in zip( cxData, yData ) ]
return diff
timeList = np.linspace( 0, 25, 55 )
t1List = np.fromiter( ( 5 + 25. * (1 - np.exp( -t / 9. ) )for t in timeList ), np.float )
t2List = np.fromiter( (30. * (1 - np.exp( -t / 7. ) ) * ( 1 - np.exp( -t / 3. ) ) for t in timeList ), np.float )
combinedList = np.fromiter( ( (.7 * a + .2 * b)/.9 for a, b in zip( t1List, t2List ) ), np.float )
strainList = np.fromiter( ( strain( t, .01, -.1, .88, .2 ) for t in combinedList ), np.float )
fit, ier = leastsq( residuals, [.71,.22, 0,0, .1, .1 ], args=( t1List, t2List, strainList ), maxfev=5000 )
print fit
fittedT = [ (fit[0]**2 * x1 + fit[1]**2 *x2 ) /( fit[0]**2 + fit[1]**2 ) for x1, x2 in zip( t1List, t2List) ]
fittedS = [ strain( t, *(fit[2:]) ) for t in fittedT ]
fig = plt.figure()
ax = fig.add_subplot( 3, 1, 1 )
bx = fig.add_subplot( 3, 1, 2 )
cx = fig.add_subplot( 3, 1, 3 )
ax.plot( timeList, t1List )
ax.plot( timeList, t2List )
ax.plot( timeList, combinedList )
bx.plot( combinedList, strainList, linestyle='', marker='x' )
bx.plot( fittedT, fittedS )
cx.plot( timeList, fittedT ,'--')
cx.plot( timeList, combinedList,':' )
plt.show()
Давая
[ 4.21350842e+03 2.25221499e+03 1.00000000e-02 -1.00000000e-01 8.80000000e-01 2.00000000e-01]
и показывая:

Верх: температура 1 (синяя) и 2 (оранжевая), а также линейная комбинация (зеленая) Центр: «моделируемые данные» (синяя) и подгонка(оранжевый) Внизу: установленная температура (синий), истинная температура (оранжевый)
В зависимости от реальных данных может потребоваться некоторая путаница.