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
])
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,
Example #4
0
V2 = -s2
d_V2 = d_s2
V3 = s3
d_V3 = d_s3
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'),
Example #5
0
R_A1_dsys = 0.05 * R_A1
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
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
                title='Abbildung   : Extrema zweiter Ordnung (LiF)',
                xlabel='Winkel in deg',
                ylabel='Zählrate in 1/s')
pltext.plotdata(alpha_2o, rate_2o, rate_2o_err, label='Messwerte')
plt.plot(x_kb2o_array,
         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,
Example #8
0
R1 = npfarray([1, 10, 1]) * cs.kilo
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
Example #9
0
Q_V_pv = Qel - Qab - wk_Wpv_mv
Q_V_pv_dtot = sqrt(Qel_dtot**2 + Qab_dtot**2 + wk_Wpv_dsto**2)
Q_V_D = Qel - Qab - W_D
Q_V_D_dtot = sqrt(Qel_dtot**2 + Qab_dtot**2 + W_D_dsys**2)

P_V_pv = Q_V_pv * wk_f_mv
P_V_pv_dtot = sqrt((Q_V_pv_dtot * wk_f_mv)**2 + (Q_V_pv * wk_f_dsto)**2)
P_V_D = Q_V_D * wk_f_mv
P_V_D_dtot = sqrt((Q_V_D_dtot * wk_f_mv)**2 + (Q_V_D * wk_f_dsto)**2)

wk_n_th = wk_Wpv_mv / Qel
wk_n_th_dtot = 1 / Qel * sqrt(wk_Wpv_dsto**2 + (wk_Wpv_mv * Qel_dtot / Qel)**2)
wk_n_eff = W_D / Qel
wk_n_eff_dsys = 1 / Qel * sqrt(W_D_dsys**2 + (W_D * Qel_dtot / Qel)**2)

print()
print(tbl([['Qel']+lst(Qel,Qel_dtot),['Qab']+lst(Qab,Qab_dtot),['Wpv']+lst(wk_Wpv_mv,wk_Wpv_dsto),['W_D']+lst(W_D,W_D_dsys)]))
print(tbl([['Pel']+lst(Pel,Pel_dtot),['Pab']+lst(Pab,Pab_dtot),['Ppv']+lst(Ppv,Ppv_dsto),['P_D']+lst(P_D,P_D_dtot)]))
print(tbl([['Q_V (Wpv)']+lst(Q_V_pv,Q_V_pv_dtot),['Q_V (W_D)']+lst(Q_V_D,Q_V_D_dtot),['P_V (Wpv)']+lst(P_V_pv,P_V_pv_dtot),['P_V (W_D)']+lst(P_V_D,P_V_D_dtot)]))
print(tbl([['f']+lst(wk_f_mv,wk_f_dsto),['F']+lst(wk_F,wk_F_dsys),['n_th']+lst(wk_n_th,wk_n_th_dtot),['n_eff']+lst(wk_n_eff,wk_n_eff_dsys)]))

pltext.initplot(title='Wirkungsgrade in Abhängigkeit von der Frequenz', xlabel='Frequenz f / Hz', ylabel='Wirkungsgrad')
pltext.plotdata(wk_f_mv, wk_n_th, wk_n_th_dtot, wk_f_dsto, label=r'$n_{th}$', connect=True)
pltext.plotdata(wk_f_mv, wk_n_eff, wk_n_eff_dsys, wk_f_dsto, label=r'$n_{eff}$', connect=True)
plt.xlim(3.75,5.875)
plt.ylim(0.0,0.1)
plt.legend(loc='upper left')
plt.savefig('fig0.pdf', format='pdf')
plt.show()
Example #10
0
# Natrium
# Measured Values
wl = [331e-9, 395e-9, 404e-9, 416e-9, 420e-9, 427e-9, 430e-9, 434e-9, 439e-9, 442e-9, 449e-9, 454e-9, 467e-9, 475e-9, 498e-9, 515e-9, 525e-9, 568e-9, 589e-9, 668e-9, 675e-9, 687e-9, 696e-9, 703e-9, 707e-9, 715e-9, 720e-9, 727e-9, 738e-9, 751e-9, 763e-9, 770e-9, 773e-9, 795e-9, 801e-9, 811e-9, 819e-9]
dwl = [1.5e-9 for i in wl]

# Wellenlängen 1. Nebenserie
ns1 = [819e-9]
m = 3
Eryd = -13.605
E3p = Eryd / m**2 - h / e * c / ns1[0]

for m in range(4,13):
  ns1.append(h / e * c / (Eryd * m**-2 - E3p))

print()
print(lst("Wellenlängen 1. Nebenserie", ns1, [0.3e-9 for i in range(len(ns1))]))

# Wellenlängen 2. Nebenserie
ns2 = 589e-9
E3s = E3p - h / e * c / ns2
sCorr = 3 - sqrt(Eryd / E3s)

ns2 = []
for m in range(5,10):
  ns2.append(h / e * c / (Eryd  * (m - sCorr)**-2 - E3p))

print()
print(lst("Wellenlängen 2. Nebenserie", ns2, [0.3e-9 for i in range(len(ns2))]))

# Hauptserie
pCorr = 3 - sqrt(Eryd / E3p)
Example #11
0
    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()
print(val('Iz (mean value)', Iz, Iz_dtot))

# color frequency
Omega = 2. * pi * 10. / cf_10u
dOmega = 2. * pi * 10. * cf_d10u / cf_10u**2
wf = 2. * pi * cf_f
dwf = 2. * pi * cf_df

cfplot = plot(
    title=
    r'angular color speed Ω as function of the angular rotation speed $ω_f$',
    xlabel=r'$ω_f$ / rad/s',
    ylabel='Ω / rad/s',
    fig=3)