示例#1
0
U1g_dsys = npfarray([3,1,1,1,1,1,1,1])*1e-3
Uag_48k7 = npfarray([3.32,2.60,1.80,1.00,-0.4,-1.0,-1.7,-2.7])
Uag_48k7_dsys = npfarray([50,10,10,10,1,10,100,100])*1e-3
Uag_274k = npfarray([14.6,14.4,9.6,5.0,-3.2,-6.90,-10.8,-12.8])
Uag_274k_dsys = npfarray([0.1,0.1,0.01,0.01,0.01,0.1,0.1,0.1])

U1w = npfarray([1.0,0.852,0.748,0.500,0.300,0.150]) / 10
U1w_dsys = npfarray([10,5,5,5,5,3])*1e-3 / 10
Uaw_274k = npfarray([8.76,7.48,6.46,4.38,2.61,1.28])
Uaw_274k_dsys = npfarray([0.05,0.05,0.03,0.03,0.02,0.02])
Uaw_680k = npfarray([21.9,18.7,16.1,10.8,6.52,3.25])
Uaw_680k_dsys = npfarray([0.1,0.1,0.1,0.1,0.05,0.02])

V_eg_48k7 = -1 * Uag_48k7 / U1g
V_eg_48k7_dsys = 1/abs(U1g) * sqrt(Uag_48k7_dsys**2 + (Uag_48k7 * U1g_dsys / U1g)**2)
V_eg_48k7_mv = mv(V_eg_48k7)
V_eg_48k7_mv_dtot = dtot_mv(V_eg_48k7,V_eg_48k7_dsys)

V_eg_274k = -1 * Uag_274k / U1g
V_eg_274k_dsys = 1/abs(U1g) * sqrt(Uag_274k_dsys**2 + (Uag_274k * U1g_dsys / U1g)**2)
V_eg_274k_mv = mv(V_eg_274k)
V_eg_274k_mv_dtot = dtot_mv(V_eg_274k,V_eg_274k_dsys)

V_ew_274k = Uaw_274k / U1w
V_ew_274k_dsys = 1/U1w * sqrt(Uaw_274k_dsys**2 + (Uaw_274k * U1w_dsys / U1w)**2)
V_ew_274k_mv = mv(V_ew_274k)
V_ew_274k_mv_dtot = dtot_mv(V_ew_274k,V_ew_274k_dsys)

V_ew_680k = Uaw_680k / U1w
V_ew_680k_dsys = 1/U1w * sqrt(Uaw_680k_dsys**2 + (Uaw_680k * U1w_dsys / U1w)**2)
V_ew_680k_mv = mv(V_ew_680k)
示例#2
0
  r'Zählrate $n$ in Abhängigkeit der Spannung der Röntgenröhre $U$ bei einem konstanten Winkel von 7.5$^\circ$',
  r'Bestimmung der Lagen der $K_\alpha$, $K_\beta$-Peaks durch Gaussfits an die Zählraten-Winkel-Abhängigkeit des NaCl-Kristalls.'
]

# Constants
d_LiF = 201.4 * cs.pico
rho_NaCl = 2.164 * cs.gram / cs.centi**3
M_NaCl = 58.44 * cs.gram

# (1) Analysis of the spectrum of the LiF-crystal
# Determination of planck's constant
U1 = 35.0 * cs.kilo
t1 = 5.0
beta1, n1 = np.loadtxt('data/255/data1.txt', unpack=True)
d_n1 = sqrt(n1 * t1) / t1
n1_0 = ms.mv(n1[0:7])
d_n1_0 = ms.dsto_mv(n1[0:7])

ms.pltext.initplot(num=1, title=titles[0], xlabel=r'$\beta$ / $^\circ$', ylabel=r'$n$ / (1/s)', fignum=True)
s1, d_s1, b1, d_b1 = ms.linreg(beta1[:20], n1[:20], d_n1[:20], fit_range=range(10, 13), plot=True)
beta1_G = (n1_0 - b1) / s1
d_beta1_G = beta1_G * sqrt((d_n1_0**2 + d_b1**2) / (n1_0 - b1)**2 + (d_s1 / s1)**2)
beta1_G *= cs.degree
d_beta1_G *= cs.degree
ld1_G = 2 * d_LiF * sin(beta1_G)
d_ld1_G = 2 * d_LiF * cos(beta1_G) * d_beta1_G
h1 = (cs.e * U1 / cs.c) * ld1_G
d_h1 = (cs.e * U1 / cs.c) * d_ld1_G
beta1_G2 = arcsin(ld1_G / d_LiF)
d_beta1_G2 = d_ld1_G / sqrt(d_LiF**2 - ld1_G**2)
示例#3
0
    79.821, 79.457, 79.912, 78.912, 77.457, 76.094, 75.366, 75.821, 76.003,
    74.821, 75.366, 74.457, 74.185, 74.73, 76.003, 75.003, 75.003, 74.003,
    74.73, 75.276, 75.639, 75.912, 75.73, 76.185, 77.548
])

dt = dx = dy = npfarray([])
for n in range(168):
    dt = np.append(dt, t[n + 1] - t[n])
    dx = np.append(dx, x[n + 1] - x[n])
    dy = np.append(dy, y[n + 1] - y[n])

r_k = 755e-9 / 2.
r_k_dsys = 30e-9 / 2.
T = npfarray([22.6, 23.0])
T_dsys = npfarray([0.1, 0.1])
T_mv = mv(T) + T0
T_dtot = dtot(dsys_mv(T_dsys), dsto_mv(T))
nu = 9.40e-4
nu_dsys = 0.05e-4

# Teilchenbewegung
pltext.initplot(num=1,
                title='Bewegung des Teilchens',
                xlabel='x in m',
                ylabel='y in m')
plt.plot(x, y, marker='s')
plt.savefig('fig1.pdf', format='pdf')

# mittleres Verschiebungsquadrat
r_sqr = dx**2 + dy**2
r_sqr_mv = mv(r_sqr)
示例#4
0
# measure version 1.8.4
from measure import npfarray, np, exp, sqrt, ln, mv, dsto_mv, dsys_mv, dtot, val, tbl, lst, T0, p0, plt, pltext, linreg, sig, curve_fit

# Messwerte
wl_sa = npfarray([-36, 0, 200, 404, 706]) * 1e-6
wl_sa_dsys = npfarray([10, 10, 10, 10, 10]) * 1e-6
wl_se = npfarray([2930, 2951, 3155, 3370, 3677]) * 1e-6
wl_se_dsys = npfarray([10, 10, 10, 10, 10]) * 1e-6
wl_m = npfarray([11165, 11136, 11134, 11163, 11170])
wl_m_dsys = npfarray([2, 2, 2, 2, 2])
wl_lit = 532e-9
wl_lit_dsys = 1e-9

bi_T = mv([23.3, 23.4]) + T0
bi_T_dtot = sqrt(2) * 0.1
bi_a = 50e-3
bi_a_dsys = 0.05e-3
bi_m1 = npfarray([0, 5, 10, 15, 20, 25, 30, 35])
bi_m2 = npfarray([0, 5, 10, 15, 20, 25, 30, 35])
bi_m3 = npfarray([0, 5, 10, 15, 20, 25, 30, 35])
bi_p1 = npfarray([540, 470, 395, 320, 245, 175, 100, 25]) * 101325 / 760
bi_p1_dsys = npfarray([5, 5, 5, 5, 5, 5, 5, 5]) * 101325 / 760
bi_p2 = npfarray([700, 625, 555, 480, 410, 340, 265, 190]) * 101325 / 760
bi_p2_dsys = npfarray([5, 5, 5, 5, 5, 5, 5, 5]) * 101325 / 760
bi_p3 = npfarray([630, 550, 485, 410, 335, 265, 190, 115]) * 101325 / 760
bi_p3_dsys = npfarray([5, 5, 5, 5, 5, 5, 5, 5]) * 101325 / 760
bi_n0_lit = 1.00028

kl_t = npfarray([
    -2.9599994e-02, -2.9399995e-02, -2.9199995e-02, -2.8999995e-02,
    -2.8799992e-02, -2.8599992e-02, -2.8399993e-02, -2.8199993e-02,
示例#5
0
                title='Abbildung   : Zählrate als Funktion des Winkels (LiF)',
                xlabel='Winkel in deg',
                ylabel='Zählrate in 1/s')
pltext.plotdata(alpha, rate, rate_err, label='Messwerte')
[slope, slope_err, yitc, yitc_err] = linreg(alpha[12:18],
                                            rate[12:18],
                                            rate_err[12:18],
                                            plot=True,
                                            prange=(4, 7))
pltext.set_layout(xlim=(4, 7), ylim=(-100, 400))

a1_uncorr = -yitc / slope * deg_to_rad
a1_uncorr_err = 1 / slope * sqrt(yitc_err**2 +
                                 (yitc / slope * slope_err)**2) * deg_to_rad

Ug = mv(rate[0:12])
Ug_err = dtot_mv(rate[0:12], rate_err[0:12])

a1 = (1 - Ug / yitc) * a1_uncorr
a1_err = sqrt((a1_uncorr / yitc)**2 * (Ug_err**2 + (Ug / yitc * yitc)**2) +
              ((1 - Ug / yitc) * a1_uncorr_err)**2)

d = 201.4e-12
U = 35e3

l = 2 * d * sin(a1)
l_err = 2 * d * cos(a1) * a1_err

h = l * e * U / c
h_err = l_err * e * U / c
示例#6
0
    return arctan(1 / (2 * pi * f * (R_A3 + R_A3_dsys) * (C_A3 + C_A3_dsys)))


def phase_b_45deg(f):
    return phase_b(f) - pi / 4


def phase_b_45deg_dsys(f):
    return phase_b_dys(f) - pi / 4


fgr_phase = fsolve(phase_b_45deg, x0=3.4e3)[0]
fgr_phase_dsys = abs(fsolve(phase_b_45deg_dsys, x0=0.3e3)[0] - fgr_phase)
fgr_fgang = npfarray([3.16, 3.58]) * 1e3
fgr_fgang_dsys = npfarray([0.15, 0.15]) * 1e3
fgr_fgang_mv = mv(fgr_fgang)
fgr_fgang_mv_dtot = dtot_mv(fgr_fgang, fgr_fgang_dsys)
fgr_calc = 1 / (2 * pi * R_A3 * C_A3)
fgr_calc_dsys = 1 / (2 * pi * R_A3 * C_A3) * sqrt((R_A3_dsys / R_A3)**2 +
                                                  (C_A3_dsys / C_A3)**2)

f_array = linspace(1e3, 10e3, 1000)

pltext.initplot(num=1,
                title='Abbildung   : Phase in Abhängigkeit der Frequenz',
                xlabel='Frequenz in Hz',
                ylabel='Phase in rad',
                scale='loglin')
pltext.plotdata(f_A3, Phi, Phi_dsys, label='gemessene Phase')
plt.plot([1e3, 10e3], [pi / 4, pi / 4], label='45°')
plt.plot(f_array, phase_b(f_array), label='berechnet')
示例#7
0
from numpy import loadtxt, arange

# Untergrund
unterg = loadtxt('data/252_untergrund.dat', usecols=[1])

# Silber
n1 = loadtxt('data/252_n1.dat', usecols=[1])
n2 = loadtxt('data/252_n2.dat', usecols=[1])
n3 = loadtxt('data/252_n3.dat', usecols=[1])
n4 = loadtxt('data/252_n4.dat', usecols=[1])

N_ag = n1 + n2 + n3 + n4
N_ag_err = sqrt(N_ag)
t = arange(5, 405, 10)

unterg_ag_mv = mv(4 * unterg)
unterg_ag_mv_dsto = dsto_mv(4 * unterg, ddof=0)


def fitfunc(x, A1, l1, A2, l2):
    return A1 * exp(-l1 * x) + A2 * exp(-l2 * x) + unterg_ag_mv


def fitfunc_pf(x, A1, l1, A2, l2):
    return A1 * exp(-l1 * x) + A2 * exp(
        -l2 * x) + unterg_ag_mv + unterg_ag_mv_dsto


def fitfunc_mf(x, A1, l1, A2, l2):
    return A1 * exp(-l1 * x) + A2 * exp(
        -l2 * x) + unterg_ag_mv - unterg_ag_mv_dsto
示例#8
0
d_U4_E = 0.01
U4_A = npfarray([0.94, 0.73, 0.31])
d_U4_A = npfarray([0.01, 0.01, 0.01])
f4_R = npfarray([3.85, 3.70, 3.70]) * cs.kilo
d_f4_R = npfarray([0.05, 0.05, 0.05]) * cs.kilo
f4_1 = npfarray([2.15, 3.18, 3.37]) * cs.kilo
d_f4_1 = npfarray([0.05, 0.05, 0.05]) * cs.kilo
f4_2 = npfarray([7.08, 4.41, 4.00]) * cs.kilo
d_f4_2 = npfarray([0.05, 0.05, 0.05]) * cs.kilo
delta_omega4 = 2 * pi * (f4_2 - f4_1)
d_delta_omega4 = 2 * pi * sqrt(d_f4_2**2 + d_f4_1**2)

L4 = 1 / ((2 * pi * f4_R)**2 * C4)
d_L4 = L4 * sqrt((2 * d_f4_R / f4_R)**2 + (d_C4 / C4)**2)
d_L4 = 1 / len(L4) * sqrt(np.sum(d_L4**2))
L4 = ms.mv(L4)

R4_G = delta_omega4 * L4
d_R4_G = R4_G * sqrt((d_delta_omega4 / delta_omega4)**2 + (d_L4 / L4)**2)

R4_V1 = (U4_E / U4_A - 1) * R4
d_R4_V1 = sqrt((R4 / U4_A)**2 * (d_U4_E**2 + (U4_E * d_U4_A / U4_A)**2) + ((U4_E / U4_A - 1) * d_R4)**2)

R4_V2 = R4_G - R4
d_R4_V2 = sqrt(d_R4_G**2 + d_R4**2)

print('4. Frequency of an oscillating circuit')
print(ms.val('L', L4, d_L4, unit='H'))
print()

print(ms.tbl([ms.lst(R4, d_R4, name='R', unit='Ω'),
示例#9
0
U_mot = 24.0
U_mot_dsys = 0.1
I_mot = 2.3
I_mot_dsys = 0.1

km_U_heiz = 5.58
km_U_heiz_dsys = 0.04
km_I_heiz = 1.14 * 5
km_I_heiz_dsys = 0.02 * 5
km_f = 325.2 / 60.
km_f_dsys = 0.1 / 60.
km_dT = 22.1 - 18.65
km_dT_dsys = sqrt(0.25**2 + 0.1**2)
km_Vps = npfarray([199.5,198.4,200.7,200.1,200.5]) / 6e7
km_Vps_mv = mv(km_Vps)
km_Vps_dsys = dsto_mv(km_Vps)

gf_t = 180.
gf_t_dsys = 15.
gf_V = 1e-6
gf_V_dsys = 0.5e-6
gf_f = 306.5 / 60.
gf_f_dsys = 0.1 / 60.

wk_l = 0.250
wk_l_dsys = 0.005
wk_Vps = 199.0 / 6e7
wk_Vps_dsys = 1.5 / 6e7
wk_dT = 26.3 - 19.0
wk_dT_dsys = sqrt(2) * 0.1
示例#10
0
rh_p = 994.15e2
rh_p_dsys = 0.15e2

k_air_lit = 0.78 * 1.401 + 0.21 * 1.398 + 0.01 * 1.648
k_arg_lit = 1.648

# Clément & Desormes
h1 = cd_h1r - cd_h1l
h3 = cd_h3r - cd_h3l
hi_dsys = sqrt(2) * cd_hix_dsys

cd_k = h1 / (h1 - h3)
cd_k_dsys = hi_dsys / (h1 - h3) * sqrt((1 + h1 / (h1 - h3))**2 +
                                       (1 / (h1 - h3))**2)

cd_k_mv = mv(cd_k)
cd_k_dsto_mv = dsto_mv(cd_k)
cd_k_dsys_mv = dsys_mv(cd_k_dsys)
cd_k_dtot = sqrt(cd_k_dsto_mv**2 + cd_k_dsys_mv**2)

print()
print('Clément & Desormes:')
print()
print(tbl(['h1', 'h3', 'k'], [h1, h3, cd_k], [hi_dsys, hi_dsys, cd_k_dsys]))
print()
print(val('k', cd_k_mv, cd_k_dtot))
print(sig('dev', cd_k_mv, cd_k_dtot, k_air_lit))

# Rüchardt
r_air = rh_2r_air / 2.
r_air_dsys = rh_2r_dsys / 2.
示例#11
0
Iz_1x15 = m_s * g * 0.15 * slope_1x15 / (2. * pi)**2
dIz_1x15 = m_s * 0.15 / (2. * pi)**2 * sqrt((g * dslope_1x15)**2 +
                                            (dg * slope_1x15)**2)
Iz_1x20 = m_s * g * 0.20 * slope_1x20 / (2. * pi)**2
dIz_1x20 = m_s * 0.20 / (2. * pi)**2 * sqrt((g * dslope_1x20)**2 +
                                            (dg * slope_1x20)**2)
Iz_2x15 = 2. * m_s * g * 0.15 * slope_2x15 / (2. * pi)**2
dIz_2x15 = 2. * m_s * 0.15 / (2. * pi)**2 * sqrt((g * dslope_2x15)**2 +
                                                 (dg * slope_2x15)**2)
Iz_2x20 = 2. * m_s * g * 0.20 * slope_2x20 / (2. * pi)**2
dIz_2x20 = 2. * m_s * 0.20 / (2. * pi)**2 * sqrt((g * dslope_2x20)**2 +
                                                 (dg * slope_2x20)**2)

Iz_list = np.array([Iz_1x15, Iz_1x20, Iz_2x15, Iz_2x20])
dIz_list = np.array([dIz_1x15, dIz_1x20, dIz_2x15, dIz_2x20])
Iz = mv(Iz_list)
Iz_dsto = dsto_mv(Iz_list)
Iz_dsys = dsys_mv(dIz_list)
Iz_dtot = dtot(Iz_dsto, Iz_dsys)

tblstr = ['1@15', '1@20', '2@15', '2@20']

print()
print('Frequency f:')
print(
    tbl(tblstr, [f_m1x15, f_m1x20, f_m2x15, f_m2x20],
        [df_m1x15, df_m1x20, df_m2x15, df_m2x20]))
print()
print('Linreg results (slope / yitc):')
print(
    tbl(tblstr, [[slope_1x15, yitc_1x15], [slope_1x20, yitc_1x20],
示例#12
0
U_aus_err = npfarray([0.00961, 0.0113, 0.0135, 0.0165, 0.0182, 0.0190]) * 1e-3
U_V = 1.3841 * 1e-3
U_V_err = 0.00524 * 1e-3
D = U_aus**2 - U_V**2
D_err = 2 * sqrt((U_aus * U_aus_err)**2 + (U_V * U_V_err)**2)


def linear(x, c):
    return c * x


popt, pcov = curve_fit(linear, R, D, sigma=D_err)

T_C = npfarray([22.3, 23.6])
T_C_dsys = npfarray([0.5, 0.5])
T = mv(T_C) + T0
T_dsys = dtot_mv(T_C + T0, T_C_dsys)

c = popt[0]
c_dsto = sqrt(pcov[0][0])

k = c / (4 * T * B)
k_dc = c_dsto / (4 * T * B)
k_dB = c / (4 * T * B**2) * B_dsys
k_dT = c / (4 * T**2 * B) * T_dsys

k_dtot = sqrt(k_dc**2 + k_dB**2 + k_dT**2)

from scipy.stats import chi2

chisqr = np.sum((linear(R, *popt) - D)**2 / D_err**2)
示例#13
0
ΔT0 = 10.0
ΔT_Ag = 10.0
ΔT_In = 120.0
T0 = 8 * cs.minute
T_Ag = 400
T_In = 50 * cs.minute

n0 = np.loadtxt('data/252/252_1j.dat', usecols=[1], unpack=True)
n_Ag_1 = np.loadtxt('data/252/252_2j.dat', usecols=[1], unpack=True)
n_Ag_2 = np.loadtxt('data/252/252_3j.dat', usecols=[1], unpack=True)
n_Ag_3 = np.loadtxt('data/252/252_4j.dat', usecols=[1], unpack=True)
n_Ag_4 = np.loadtxt('data/252/252_5j.dat', usecols=[1], unpack=True)
n_In = np.loadtxt('data/252/252_6j.dat', usecols=[1], unpack=True)

# Background radiation
n0_m = ms.mv(n0 / ΔT0)
d_n0_m = ms.dsto_mv(n0 / ΔT0)


# Fit function
def f_Ag(x, A1, λ1, A2, λ2):
    return A1 * exp(-λ1 * x) + A2 * exp(-λ2 * x)


def f_In(x, A, λ):
    return A * exp(-λ * x)


# Ag decay
t_Ag = np.arange(ΔT_Ag / 2, T_Ag + ΔT_Ag / 2, ΔT_Ag)
N_Ag = (n_Ag_1 + n_Ag_2 + n_Ag_3 + n_Ag_4)