Example #1
0
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)
V_ew_680k_mv_dtot = dtot_mv(V_ew_680k,V_ew_680k_dsys)

R_E = 3e3
R_G = npfarray([48.7e3,274e3,680e3])
V_t = R_G / R_E

print('\nAufgabe 1:\n')
print(tbl([['Widerstand','48k7 (g)','274k (g)','274k (w)','680k (w)'],lst([V_t[0],V_t[1],V_t[1],V_t[2]],name='V_t'),lst([V_eg_48k7_mv,V_eg_274k_mv,V_ew_274k_mv,V_ew_680k_mv],[V_eg_48k7_mv_dtot,V_eg_274k_mv_dtot,V_ew_274k_mv_dtot,V_ew_680k_mv_dtot],'V_e'),['Abw',sig('',V_eg_48k7_mv,V_eg_48k7_mv_dtot,V_t[0],perc=True),sig('',V_eg_274k_mv,V_eg_274k_mv_dtot,V_t[1],perc=True),sig('',V_ew_274k_mv,V_ew_274k_mv_dtot,V_t[1],perc=True),sig('',V_ew_680k_mv,V_ew_680k_mv_dtot,V_t[2],perc=True)]]))
print('\nEinzelwerte für 48k7 (g):\n')
print(tbl([lst(V_eg_48k7,V_eg_48k7_dsys,'Verstärkung'),dev(V_eg_48k7,V_eg_48k7_dsys,V_t[0],name='Abw',perc=True)]))
print('\nEinzelwerte für 274k (g):\n')
print(tbl([lst(V_eg_274k,V_eg_274k_dsys,'Verstärkung'),dev(V_eg_274k,V_eg_274k_dsys,V_t[1],name='Abw',perc=True)]))
print('\nEinzelwerte für 274k (w):\n')
print(tbl([lst(V_ew_274k,V_ew_274k_dsys,'Verstärkung'),dev(V_ew_274k,V_ew_274k_dsys,V_t[1],name='Abw',perc=True)]))
print('\nEinzelwerte für 680k (w):\n')
print(tbl([lst(V_ew_680k,V_ew_680k_dsys,'Verstärkung'),dev(V_ew_680k,V_ew_680k_dsys,V_t[2],name='Abw',perc=True)]))

# Plots
f_uncert = 50e-6

f_1 = npfarray([0.3,0.6,0.9,3,6,9,30,60,90,150,200,300])*1e3
f_1_dsys = f_1 * f_uncert
U_A1 = npfarray([6.76,6.70,6.68,5.46,3.82,2.78,0.900,0.456,0.306,0.187,0.140,0.095])
Example #2
0
A1 = k1 * A
A1_err = sqrt((k1_err * A)**2 + (k1 * A_err)**2)

d = 1.4e-3
dichte = 7.9e3
k2 = exp(-msk * dichte * d)
k2_err = dichte * d * msk_err * exp(-msk * dichte * d)

A2 = k2 * A1
A2_err = sqrt((k2_err * A1)**2 + (k2 * A1_err)**2)

print('\nAufgabe 5:\n')
print(
    tbl([
        lst(s, s_err, name='s / m'),
        lst(A, A_err, name='A / Bq'),
        lst(A1, A1_err, name='A1 / Bq'),
        lst(A2, A2_err, name='A2 / Bq')
    ]))

# Aufgabe 6
p = npfarray([
    20, 57, 99, 126, 162, 222, 321, 353, 369, 391, 434, 470, 495, 521, 549, 602
])
p_err = npfarray([2 for x in range(len(p))])

N = npfarray([
    4868, 4803, 4915, 4835, 4710, 4689, 3971, 2561, 1489, 609, 84, 67, 73, 93,
    68, 83
])
N_err = sqrt(N)
Example #3
0
# Wellenlänge Laser
ds = wl_se - wl_sa
ds_dsys = sqrt(wl_se_dsys**2 + wl_sa_dsys**2)
wl = 2. * ds / wl_m
wl_dsys = 2. / wl_m * sqrt(ds_dsys**2 + (wl_m_dsys / wl_m)**2)
wl_mv = mv(wl)
wl_mv_dsto = dsto_mv(wl)
wl_mv_dsys = dsys_mv(wl_dsys)
wl_mv_dtot = dtot(wl_mv_dsys, wl_mv_dsto)

print()
print('Wellenlänge Laser:')
print(
    tbl([
        lst(ds, ds_dsys, 'ds'),
        lst(wl_m, wl_m_dsys, 'm'),
        lst(wl, wl_dsys, 'wl')
    ], ))
print(val('Mitellwert', wl_mv, wl_mv_dtot))
print(sig('Abweichung', wl_mv, wl_mv_dtot, wl_lit, wl_lit_dsys))

# Brechungsindex Luft
pltext.initplot(num=1,
                title='Brechungsindex Luft',
                xlabel='Intensitätsringe',
                ylabel='Druck in Pa')
[sl1, dsl1, tmp, tmp] = linreg(bi_m1,
                               bi_p1,
                               bi_p1_dsys,
                               plot=True,
                               graphname='1. Durchgang')
Example #4
0
V4 = s4
d_V4 = d_s4

V1_T = R1_G / R1_E
V2_T = R2_G / R2_E
V3_T = R3_G / R3_E
V4_T = R4_G / R4_E

print()
print(
    ms.tbl([
        ms.lst(npfarray([R1_E, R2_E]), name='R_E', unit='Ω'),
        ms.lst(npfarray([R1_G, R2_G]), name='R_G', unit='Ω'),
        ms.lst(npfarray([V1, V2]), npfarray([d_V1, d_V2]), name='V'),
        ms.lst(npfarray([V1_T, V2_T]), name='V'),
        ms.dev(npfarray([V1, V2]),
               npfarray([d_V1, d_V2]),
               npfarray([V1_T, V2_T]),
               name='V',
               perc=True)
    ]))
print()
print(
    ms.tbl([
        ms.lst(npfarray([R3_E, R4_E]), name='R_E', unit='Ω'),
        ms.lst(npfarray([R3_G, R4_G]), name='R_G', unit='Ω'),
        ms.lst(npfarray([V3, V4]), npfarray([d_V3, d_V4]), name='V'),
        ms.lst(npfarray([V3_T, V4_T]), name='V'),
        ms.dev(npfarray([V3, V4]),
               npfarray([d_V3, d_V4]),
               npfarray([V3_T, V4_T]),
Example #5
0
C_A1 = npfarray([470, 4.7, 47]) * 1e-9
C_A1_dsys = 0.10 * C_A1
g_thalb = npfarray([312, 32.6, 32.6]) * 1e-6
g_thalb_dsys = npfarray([4, 0.6, 0.6]) * 1e-6

tau = R_A1 * C_A1
tau_dsys = sqrt((R_A1 * C_A1_dsys)**2 + (R_A1_dsys * C_A1)**2)
b_thalb = ln(2) * tau
b_thalb_dsys = ln(2) * tau_dsys

print()
print('Aufgabe 1:\n')
print(
    tbl([
        lst(R_A1, R_A1_dsys, 'R'),
        lst(C_A1, C_A1_dsys, 'C'),
        lst(tau, tau_dsys, 'Tau')
    ]))
print(
    tbl([
        lst(b_thalb, b_thalb_dsys, 'T_1/2 (b)'),
        lst(g_thalb, g_thalb_dsys, 'T_1/2 (g)'), ['Abw'] + [
            sig('', b_thalb[i], b_thalb_dsys[i], g_thalb[i], g_thalb_dsys[i])
            for i in range(len(b_thalb))
        ]
    ]))

# Aufgabe 3
R_A3 = 1e3
R_A3_dsys = 0.05 * R_A3
C_A3 = 47e-9
Example #6
0
T_CoA = (dt.datetime(2019, 2, 21) - dt.datetime(2012, 2, 2)).total_seconds()
T_H_CoA = 5.27 * cs.year
eps_CoA = 0.04
rho_abs_CoA = 7.9 * cs.gram / cs.centi**3
d_abs_CoA = 1.4 * cs.milli

t_CoA = cs.minute
a_CoA = npf([50, 105, 190]) * cs.milli
d_a_CoA = npf([2, 2, 2]) * cs.milli
n_CoA = npf([33865, 8266, 2171])
d_n_CoA = sqrt(n_CoA)
n_CoA = (n_CoA / t_CoA - n0) / eps_CoA
d_n_CoA = sqrt((d_n_CoA / t_CoA)**2 + d_n0**2) / eps_CoA

print("Activity of γ-Radiation:")
print(ms.tbl([ms.lst(n_CoA, d_n_CoA, name='n', unit='1/s', prefix=False)]))

mu_abs_CoA = mu_rho_Co * rho_abs_CoA
d_mu_abs_CoA = d_mu_rho_Co * rho_abs_CoA
A_CoA = 4 * n_CoA * a_CoA**2 / r_c**2
d_A_CoA = A_CoA * sqrt((d_n_CoA / n_CoA)**2 + (2 * d_a_CoA / a_CoA)**2)
A1_CoA = 4 * n_CoA * (a_CoA + l_c / 2)**2 / r_c**2
d_A1_CoA = A1_CoA * sqrt((d_n_CoA / n_CoA)**2 + (2 * d_a_CoA /
                                                 (a_CoA + l_c / 2))**2)
A2_CoA = A1_CoA * exp(-mu_abs_CoA * d_abs_CoA)
d_A2_CoA = A2_CoA * sqrt((d_A1_CoA / A1_CoA)**2 +
                         (d_abs_CoA * d_mu_abs_CoA)**2)
A_l_CoA = A_N_CoA * exp(-ln(2) * T_CoA / T_H_CoA)

k1_CoA = A1_CoA / A_CoA
k2_CoA = A2_CoA / A1_CoA
Example #7
0
d_R1 = 0.05 * R1
T1_12 = npfarray([0.32, 0.04, 0.04]) * cs.milli
d_T1_12 = npfarray([0.03, 0.01, 0.01]) * cs.milli
f1 = npfarray([110, 600, 600])
U1_pp = npfarray([0.95, 0.95, 0.95])
d_U1_pp = npfarray([0.02, 0.02, 0.02])

tau1_O = T1_12 / ln(2)
d_tau1_O = d_T1_12 / ln(2)
tau1_T = R1 * C1
d_tau1_T = tau1_T * sqrt((d_R1 / R1)**2 + (d_C1 / C1)**2)

print()
print('1. Determination of the response time of a RC-element:')
print(ms.tbl([ms.lst(C1, d_C1, name='C', unit='F'),
              ms.lst(R1, d_R1, name='R', unit='Ω'),
              ms.lst(tau1_O, d_tau1_O, name='τ', unit='s'),
              ms.lst(tau1_T, d_tau1_T, name='τ', unit='s'), ms.dev(tau1_O, d_tau1_O, tau1_T, d_tau1_T, name='τ')]))

# (3) Frequency and phase of a RC-element
R3 = cs.kilo
d_R3 = 0.05 * R3
C3 = 47 * cs.nano
d_C3 = 0.10 * C3
f3_G_low = 3.0 * cs.kilo
d_f3_G_low = 0.3 * cs.kilo
f3_G_high = 3.1 * cs.kilo
d_f3_G_high = 0.3 * cs.kilo

f3 = np.arange(1, 11, 1) * cs.kilo
delta_t3 = npfarray([0.20, 0.08, 0.042, 0.027, 0.019, 0.013, 0.010, 0.007, 0.007, 0.005]) * cs.milli
d_delta_t3 = npfarray([0.03, 0.02, 0.015, 0.015, 0.010, 0.010, 0.005, 0.005, 0.005, 0.004]) * cs.milli
Example #8
0
         gauss(x_kb2o_array, *p_opt_kb2o),
         label=r'$K_\beta$ Fit')
plt.plot(x_ka2o_array,
         gauss(x_ka2o_array, *p_opt_ka2o),
         label=r'$K_\alpha$ Fit')
pltext.set_layout(xlim=(17.4, 21.6))

print('\nAufgabe 1b\n')
print(
    tbl([['Peak:', ' A', ' mu', ' sig', ' Ug', ' FWHM', ' l', ' Abw'],
         lst([*p_opt_kb1o, fwhm_kb1o, l_kb1o],
             [*p_err_kb1o, fwhm_kb1o_err, l_kb1o_err], 'kb1o') +
         [dev(l_kb1o, l_kb1o_err, l_kb_lit, perc=True)],
         lst([*p_opt_ka1o, fwhm_ka1o, l_ka1o],
             [*p_err_ka1o, fwhm_ka1o_err, l_ka1o_err], 'ka1o') +
         [dev(l_ka1o, l_ka1o_err, l_ka_lit, perc=True)],
         lst([*p_opt_kb2o, fwhm_kb2o, l_kb2o],
             [*p_err_kb2o, fwhm_kb2o_err, l_kb2o_err], 'kb2o') +
         [dev(l_kb2o, l_kb2o_err, l_kb_lit, perc=True)],
         lst([*p_opt_ka2o, fwhm_ka2o, l_ka2o],
             [*p_err_ka2o, fwhm_ka2o_err, l_ka2o_err], 'ka2o') +
         [dev(l_ka2o, l_ka2o_err, l_ka_lit, perc=True)]]))

# Aufgabe 1c
U = npfarray([20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35])
rate = npfarray([
    1.00, 1.90, 2.25, 8.00, 37.55, 72.20, 104.0, 134.4, 160.2, 180.5, 212.5,
    245.6, 264.6, 284.8, 314.1, 339.1
])
rate_err = sqrt(rate)
Example #9
0
print('\nSilber:\n')
print(val(unterg_ag_mv, unterg_ag_mv_dsto, name='Untergrund'))
print()
print(
    tbl([['', 'A1', 'l1', 'A2', 'l2'],
         [
             'Fitwerte',
             val(p_opt[0], p_err[0]),
             val(p_opt[1], p_err[1]),
             val(p_opt[2], p_err[2]),
             val(p_opt[3], p_err[3])
         ],
         [
             'Fitwerte pf',
             val(p_opt_pf[0], p_err_pf[0]),
             val(p_opt_pf[1], p_err_pf[1]),
             val(p_opt_pf[2], p_err_pf[2]),
             val(p_opt_pf[3], p_err_pf[3])
         ],
         [
             'Fitwerte mf',
             val(p_opt_mf[0], p_err_mf[0]),
             val(p_opt_mf[1], p_err_mf[1]),
             val(p_opt_mf[2], p_err_mf[2]),
             val(p_opt_mf[3], p_err_mf[3])
         ]]))
print()
print(
    tbl([['', 'chi2', 'chi2_red', 'fitwkeit'],
         ['', val(chi2_), val(chi2_red),
          val(prob)], ['pf',
Example #10
0
Wh = km_U_heiz * km_I_heiz / km_f
Wh_dsys = 1./km_f * sqrt((km_U_heiz * km_I_heiz_dsys)**2 + (km_U_heiz_dsys * km_I_heiz)**2 + (km_U_heiz * km_I_heiz * km_f_dsys / km_f)**2)

tWges = c_w * roh_w * km_dT * km_Vps_mv / km_f
tWges_dsys = c_w / km_f * sqrt((roh_w_dsys * km_dT * km_Vps_mv)**2 + (roh_w * km_dT_dsys * km_Vps_mv)**2 + (roh_w * km_dT * km_Vps_dsys)**2 + (roh_w * km_dT * km_Vps_mv * km_f_dsys / km_f)**2)

eWges = Wm + Wh
eWges_dsys = sqrt(Wm_dsys**2 + Wh_dsys**2)
dW = eWges - tWges
dW_dsys = sqrt(eWges_dsys**2 + tWges_dsys**2)

km_n = Wh / Wm
km_n_dsys = 1./Wm * sqrt(Wh_dsys**2 + (Wh * Wm_dsys / Wm)**2)

print()
print(tbl([['Wm',val('',Wm,Wm_dsys)],['Wh',val('',Wh,Wh_dsys)],['Wm+Wh',val('',eWges,eWges_dsys)],['Q1',val('',tWges,tWges_dsys)],['dW',val('',dW,dW_dsys)]]))
print(val('Wirkungsgrad', km_n, km_n_dsys))

# Gefrierzeit Wasser
Pk = gf_V * roh_w * lamba_w / gf_t
Pk_dsys = lamba_w / gf_t * sqrt((gf_V * roh_w * gf_t_dsys / gf_t)**2 + (gf_V * roh_w_dsys)**2 + (gf_V_dsys * roh_w)**2)
Wk = Pk / gf_f
Wk_dsys = 1 / gf_f * sqrt(Pk_dsys**2 + (Pk * gf_f_dsys / gf_f)**2)

print()
print(val('Pk', Pk, Pk_dsys))
print(val('Wk', Wk, Wk_dsys))

# Wärmekraftmaschine
Qel = wk_Uh * wk_Ih / wk_f_mv
Qel_dtot = 1 / wk_f_mv * sqrt((wk_Uh * wk_Ih_dsys)**2 + (wk_Uh_dsys * wk_Ih)**2 + (wk_Uh * wk_Ih * wk_f_dsto / wk_f_mv)**2)
Example #11
0
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.
T_air = rh_50T_air / 50.
T_air_dsys = rh_50T_dsys / 50.
rh_k_air = 4. * rh_m_air * rh_V_air / (r_air**4 * T_air**2 * rh_p)
rh_k_air_dsys = 4. / (r_air**4 * T_air**2 * rh_p) * sqrt(
    (rh_m_dsys * rh_V_air)**2 + (rh_m_air * rh_V_dsys)**2 +
    (rh_m_air * rh_V_air)**2 * ((4. * r_air_dsys / r_air)**2 +
                                (2. * T_air_dsys / T_air)**2 +
                                (rh_p_dsys / rh_p)**2))
Example #12
0
                title='Abbildung   : Statistik des radioaktiven Zerfalls',
                xlabel='Zerfälle in 1/s',
                ylabel='Häufigkeit')
pltext.plotdata(anzahl, ereig, fehler, label='Messwerte')
plt.plot(x_array, gauss(x_array, *p_opt_g), label='Gauss Fit')
plt.plot(x_array, poisson(x_array, *p_opt_p), label='Poisson Fit')
pltext.set_layout(xlim=(40, 100), ylim=(-2, 142))

print('\nAufgabe 4:\n')
print(
    tbl([['Fitmethode', 'A', 'mu', 'sig'],
         [
             'Gauss',
             val(p_opt_g[0], p_err_g[0]),
             val(p_opt_g[1], p_err_g[1]),
             val(p_opt_g[2], p_err_g[2])
         ],
         [
             'Poisson',
             val(p_opt_p[0], p_err_p[0]),
             val(p_opt_p[1], p_err_p[1]), ''
         ]]))
print()
print(val(sigma_theo, sigma_theo_err, name='sig (theo)'))
print(
    dev(p_opt_g[2], p_err_g[2], sigma_theo, sigma_theo_err, name='Abweichung'))
print()
print(
    tbl([['Fitmethode', 'Chi2', 'Chi2red', 'Fitwkeit'],
         ['Gauss', val(chi2_g),
          val(chi2_red_g), val(prob_g)],
         ['Poisson', val(chi2_p),
Example #13
0
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],
                 [slope_2x15, yitc_2x15], [slope_2x20, yitc_2x20]],
        [[dslope_1x15, dyitc_1x15], [dslope_1x20, dyitc_1x20],
         [dslope_2x15, dyitc_2x15], [dslope_2x20, dyitc_2x20]]))
print()
print(sig('0-yitc 1@15', yitc_1x15, dyitc_1x15, 0.0))
print(sig('0-yitc 1@20', yitc_1x20, dyitc_1x20, 0.0))
print(sig('0-yitc 2@15', yitc_2x15, dyitc_2x15, 0.0))
print(sig('0-yitc 2@20', yitc_2x20, dyitc_2x20, 0.0))
print()
print(lst('Moment of anertia Iz', Iz_list, dIz_list))
print()