In [1]:
import sys
sys.path.append('../')
sys.path.append('../../')
from errorpro.interactive import *
init(locals())

In [2]:
%%eq
{t [s], B_1 [T], B_2 [T], B_3 [T]
 1 10 30 50
 2 12 26 52
 3 15 14 45
 4 16 15 56
 5 18 12 56
 6 25 6 45
 7 23 1 56
}

In [3]:
B = assign([B_1.value, B_2.value, B_3.value], name='B', unit='T')
B.value


Out[3]:
array([[ 10.,  12.,  15.,  16.,  18.,  25.,  23.],
       [ 30.,  26.,  14.,  15.,  12.,   6.,   1.],
       [ 50.,  52.,  45.,  56.,  56.,  45.,  56.]])

In [5]:
m,b = params('m b')
fit(m*t+b, t, B, [m,b], ydata_axes=(1,))


Out[5]:
Results of fit

$m \; \mathrm{\left[\frac{T}{s}\right]}$ $b \; \mathrm{\left[T\right]}$
$\phantom{+} 2.4 \pm 0.4$ $\phantom{0} 7.3 \pm 1.5$
$-4.6 \pm 0.6$ $33.3 \pm 2.4$
$\phantom{+} 0.5 \pm 1.0$ $49 \phantom{.0} \pm 5 \phantom{.0}$