├── .gitignore ├── README.md ├── 万用表的设计 ├── Figure1.png ├── Figure2.png ├── code.py └── data.pdf ├── 交流电路功率因数实验及弗兰克赫兹实验 ├── Figure.png ├── code.py └── data.pdf ├── 光电效应与普朗克常数测定 ├── Figure1.png ├── Figure2.png ├── code.py └── data.pdf ├── 分光计的调整和使用 └── code.py ├── 动态法测量材料杨氏模量 ├── Figure.png ├── code.py └── data.pdf ├── 惠斯登电桥 └── code.py ├── 抛射体运动的照相法研究 ├── Figure.png ├── code.py └── data.pdf ├── 用双臂电桥测低电阻 ├── Figure.png ├── code.py └── data.pdf ├── 示波器的应用 ├── Figure.png ├── code.py └── data.pdf ├── 组装整流器 └── data.pdf ├── 铁磁材料的磁滞回线和基本磁化曲线 ├── Figure1.png ├── Figure2.png ├── code.py └── data.pdf └── 非平衡电桥 ├── Figure.png ├── code.py └── data.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | *.rar 4 | *.wav 5 | *.ppt 6 | *.pps 7 | *.mpg 8 | *.wmv 9 | *.wma 10 | 11 | *.doc 12 | *.docx 13 | \[ignore\]*.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 普通物理学实验 I 2 | 3 | 实验时的数据、作图用代码 4 | 5 | ⚠️ 仅供作图代码学习参考,请勿直接抄袭 6 | 7 | - [x] 非平衡电桥 8 | - [x] 动态法测量材料杨氏模量 9 | - [x] 示波器的应用 10 | - [x] 交流电路功率因数实验 & 弗兰克赫兹实验 11 | - [x] 惠斯登电桥 12 | - [x] 用双臂电桥测低电阻 13 | - [x] 光电效应与普朗克常数测定 14 | - [x] 铁磁材料的磁滞回线和基本磁化曲线 15 | - [x] 分光计的调整和使用 16 | - [x] 万用表的设计 17 | - [x] 组装整流器(无数据、代码) 18 | - [x] 碰撞实验(手算、手写的,这里没有) 19 | - [x] 抛射体运动的照相法研究 20 | - [x] 演示实验(无数据、代码) -------------------------------------------------------------------------------- /万用表的设计/Figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/万用表的设计/Figure1.png -------------------------------------------------------------------------------- /万用表的设计/Figure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/万用表的设计/Figure2.png -------------------------------------------------------------------------------- /万用表的设计/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 5 | 6 | x = [1, 2, 3, 4, 5, 6] 7 | I = [0.94, 1.50, 2.00, 3.00, 4.00, 4.90] 8 | dI = [0.01, 0.05, 0.00, 0.05, 0.10, 0.10] 9 | 10 | plt.figure() 11 | plt.plot(x, I, marker="D") 12 | plt.plot(x, dI, marker=".", color="black") 13 | plt.title("5 mA 电流表校准曲线", weight="bold", size=20) 14 | plt.xlabel("次数", weight="bold", size=16) 15 | plt.ylabel("I标准/mA & ΔI/mA", weight="bold", size=16) 16 | plt.grid(True) 17 | 18 | plt.text(x[0], I[0]+0.4, f"{I[0]:.2f}", ha="center", va="top") 19 | for x_, I_ in zip(x[1:], I[1:]): 20 | plt.text(x_, I_-0.15, f"{I_:.2f}", ha="center", va="top") 21 | for x_, dI_ in zip(x, dI): 22 | plt.text(x_, dI_+0.4, f"{dI_:.2f}", ha="center", va="top") 23 | 24 | # plt.show() 25 | 26 | U = [1.00, 1.50, 1.95, 3.10, 3.95, 4.93] 27 | dU = [0.05, 0.00, 0.05, 0.10, 0.10, 0.07] 28 | 29 | plt.figure() 30 | plt.plot(x, U, marker="D") 31 | plt.plot(x, dU, marker=".", color="black") 32 | plt.title("5 V 电压表校准曲线", weight="bold", size=20) 33 | plt.xlabel("次数", weight="bold", size=16) 34 | plt.ylabel("U标准/V & ΔU/V", weight="bold", size=16) 35 | plt.grid(True) 36 | 37 | plt.text(x[0], U[0]+0.4, f"{U[0]:.2f}", ha="center", va="top") 38 | for x_, U_ in zip(x[1:], U[1:]): 39 | plt.text(x_, U_-0.15, f"{U_:.2f}", ha="center", va="top") 40 | for x_, dU_ in zip(x, dU): 41 | plt.text(x_, dU_+0.4, f"{dU_:.2f}", ha="center", va="top") 42 | 43 | plt.show() -------------------------------------------------------------------------------- /万用表的设计/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/万用表的设计/data.pdf -------------------------------------------------------------------------------- /交流电路功率因数实验及弗兰克赫兹实验/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/交流电路功率因数实验及弗兰克赫兹实验/Figure.png -------------------------------------------------------------------------------- /交流电路功率因数实验及弗兰克赫兹实验/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from scipy.signal import argrelextrema 4 | from scipy.interpolate import make_interp_spline 5 | 6 | print("---------- 交流电路功率因数实验 ----------") 7 | 8 | plt.rc("font", family="Source Han Serif CN", size=12, weight="bold") 9 | 10 | Is = [0.3042, 0.2547, 0.1843, 0.1475, 0.1178, 0.1234, 0.1681, 0.2082, 0.2683, 0.3331] 11 | Us = [220.2, 220.1, 219.9, 219.8, 219.9, 219.8, 219.9, 219.8, 219.7, 219.2] 12 | Ps = [22.7, 22.9, 22.9, 23.0, 23.1, 23.1, 23.2, 23.3, 23.2, 23.1] 13 | Cs = list(range(10)) 14 | cosphis = [] 15 | 16 | for i, u, p in zip(Is, Us, Ps): 17 | cosphis.append(p / (u * i)) 18 | 19 | print("功率因数:", end="") 20 | for cosphi in cosphis: 21 | print(round(cosphi, 3), end=" ") 22 | print() 23 | 24 | plt.figure(figsize=(8, 4)) 25 | plt.scatter(Cs, cosphis) 26 | plt.title("cosφ-C 曲线", weight="bold", size=18) 27 | plt.xlabel("C/μF", weight="bold", size=14) 28 | plt.ylabel("cosφ", weight="bold", size=14) 29 | plt.grid(True) 30 | for c, cosphi in zip(Cs, cosphis): 31 | plt.text(c + 0.05, cosphi, f"({c}, {round(cosphi, 3)})", ha="left", va="top") 32 | 33 | # model = np.polyfit(Cs, cosphis, 5) 34 | # model_fn = np.poly1d(model) 35 | model = make_interp_spline(Cs, cosphis) 36 | Cs_model = np.arange(0, 9.5, 0.01) 37 | index_C = argrelextrema(model(Cs_model), np.greater)[0] 38 | max_C = round(float(Cs_model[index_C]), 3) 39 | max_cosphi = round(float(model(max_C)), 3) 40 | print(f"图像最高点:({max_C}, {max_cosphi})") 41 | plt.plot(Cs_model, model(Cs_model), color="orange") 42 | 43 | plt.scatter([max_C], [max_cosphi], marker="x", color="black") 44 | plt.text(max_C + 0.05, max_cosphi, f"({max_C}, {max_cosphi})", ha="left", va="bottom") 45 | 46 | plt.ylim((0, 1)) 47 | plt.show() 48 | 49 | print("\n---------- 弗兰克赫兹实验 ----------") 50 | 51 | Ug2k = [ 52 | [28.4, 40.3, 51.3, 62.0, 75.0, 86.9, 100.3], 53 | [28.2, 40.1, 50.5, 62.4, 74.4, 86.7, 99.9], 54 | [28.4, 39.7, 50.7, 61.8, 74.4, 86.9, 99.9], 55 | [27.9, 39.9, 50.4, 61.8, 74.4, 86.7, 100.3], 56 | [27.9, 39.5, 51.4, 61.8, 74.2, 87.1, 99.9], 57 | ] 58 | 59 | U = [round(((e + f + g) - (a + b + c)) / 12, 1) for a, b, c, _, e, f, g in Ug2k] 60 | U_ = round(sum(U) / len(U), 1) 61 | uncertain = np.sqrt((1 / 20) * sum((u - U_) ** 2 for u in U)) 62 | 63 | print(f"逐差计算第一激发电势:{' '.join(map(str, U))}") 64 | print(f"平均值:{U_}V") 65 | print(f"相对误差:{round(abs(U_ - 11.61) / 11.61 * 100, 1)}%") 66 | print(f"不确定度:{uncertain}V -> 0.1V") 67 | 68 | """res: 69 | ---------- 交流电路功率因数实验 ---------- 70 | 功率因数:0.339 0.408 0.565 0.709 0.892 0.852 0.628 0.509 0.394 0.316 71 | 图像最高点:(4.35, 0.91) 72 | 73 | ---------- 弗兰克赫兹实验 ---------- 74 | 逐差计算第一激发电势:11.8 11.8 11.9 11.9 11.9 75 | 平均值:11.9V 76 | 相对误差:2.5% 77 | 不确定度:0.03162277660168368V -> 0.1V 78 | """ 79 | -------------------------------------------------------------------------------- /交流电路功率因数实验及弗兰克赫兹实验/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/交流电路功率因数实验及弗兰克赫兹实验/data.pdf -------------------------------------------------------------------------------- /光电效应与普朗克常数测定/Figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/光电效应与普朗克常数测定/Figure1.png -------------------------------------------------------------------------------- /光电效应与普朗克常数测定/Figure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/光电效应与普朗克常数测定/Figure2.png -------------------------------------------------------------------------------- /光电效应与普朗克常数测定/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from scipy.interpolate import make_interp_spline 4 | 5 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 6 | 7 | fs = [365, 405, 436, 546, 577] 8 | nus = list(round((3 / f) * 10**3, 2) for f in fs) 9 | print(nus) 10 | Uas = [1.536, 1.206, 1.009, 0.472, 0.353] 11 | 12 | plt.scatter(nus, Uas) 13 | plt.title("Ua-ν 图像", weight="bold", size=20) 14 | plt.xlabel("ν/10^14 Hz", weight="bold", size=16) 15 | plt.ylabel("Ua/V", weight="bold", size=16) 16 | plt.grid(True) 17 | for nu_, Ua_ in zip(nus[:-1], Uas[:-1]): 18 | plt.text(nu_ - 0.2, Ua_, f"({nu_}, {Ua_})", ha="right", va="center") 19 | plt.text(nus[-1] - 0.2, Uas[-1], f"({nus[-1]}, {Uas[-1]})", ha="right", va="top") 20 | 21 | linear_model = np.polyfit(nus, Uas, 1) 22 | print(f"linear fit model of Ua-v: Ua = {linear_model[0]} * v + {linear_model[1]}") 23 | linear_model_fn = np.poly1d(linear_model) 24 | x_s = np.arange(0, 9, 0.01) 25 | plt.plot(x_s, linear_model_fn(x_s), color="green") 26 | 27 | e = 1.602e-19 28 | h0 = 6.626 29 | h = linear_model[0] * e * 10**20 # 10^-34 Js 30 | W0 = -linear_model[1] * e * 10**19 # 10^-19 J 31 | delta = abs(h - h0) / h0 32 | 33 | print(f"普朗克常量 h = {h} *10^-34 Js") 34 | print(f"逸出功 W0 = {W0} *10^-19 J") 35 | print(f"普朗克常量相对误差 δ = {delta*100}%") 36 | 37 | plt.show() 38 | 39 | plt.figure() 40 | 41 | Is = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 21, 22, 23, 24, 25, 28, 32, 35, 38, 40, 43, 44, 48, 51, 53, 56, 59, 62, 64, 66, 69, 72, 79, 82, 88, 91, 94, 97, 102] 42 | Us = [-2.50, 0.42, 1.08, 1.30, 1.84, 1.99, 2.34, 2.42, 2.63, 2.74, 3.18, 3.24, 3.29, 3.38, 3.57, 3.61, 3.74, 3.85, 4.08, 4.28, 4.37, 4.54, 4.72, 5.32, 6.02, 7.07, 7.86, 8.32, 9.05, 9.41, 10.41, 10.94, 11.58, 12.48, 13.33, 14.04, 14.67, 15.16, 16.42, 17.47, 19.47, 20.84, 22.94, 24.35, 25.27, 26.57, 29.01] 43 | 44 | plt.scatter(Us, Is) 45 | plt.title("光电管伏安特性曲线", weight="bold", size=20) 46 | plt.xlabel("U/V", weight="bold", size=16) 47 | plt.ylabel("I/10^-10 A", weight="bold", size=16) 48 | plt.grid(True) 49 | 50 | # model = make_interp_spline(Us, Is) 51 | linear_model = np.polyfit(Us, Is, 10) 52 | model = np.poly1d(linear_model) 53 | Us_model = np.arange(-2.5, 30, 0.05) 54 | # plt.plot(Us_model, model(Us_model), color="orange") 55 | 56 | plt.show() 57 | 58 | """ 59 | [8.22, 7.41, 6.88, 5.49, 5.2] 60 | linear fit model of Ua-v: Ua = 0.38920067247440027 * v + -1.6690924652300176 61 | 普朗克常量 h = 6.234994773039892 *10^-34 Js 62 | 逸出功 W0 = 2.6738861292984883 *10^-19 J 63 | 普朗克常量相对误差 δ = 5.901074961667798% 64 | """ -------------------------------------------------------------------------------- /光电效应与普朗克常数测定/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/光电效应与普朗克常数测定/data.pdf -------------------------------------------------------------------------------- /分光计的调整和使用/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | left1 = np.array([166*60+39, 165*60+52, 165*60+36, 166*60+24, 164*60+38, 165*60+49]) 4 | left2 = np.array([346*60+42, 345*60+54, 345*60+40, 346*60+27, 344*60+40, 345*60+53]) 5 | right1 = np.array([ 46*60+45, 45*60+59, 45*60+39, 46*60+29, 44*60+48, 45*60+58]) 6 | right2 = np.array([226*60+39, 225*60+55, 225*60+37, 226*60+27, 224*60+44, 225*60+55]) 7 | 8 | left1_right1 = np.abs(left1 - right1) 9 | left2_right2 = np.abs(left2 - right2) 10 | A = (left1_right1 + left2_right2) / 4 11 | A_ = np.average(A) 12 | uA = np.sqrt(sum((a - A_)**2 for a in A) / 30) 13 | uB2 = 1 / 3 14 | u = np.sqrt(uA**2 + uB2) 15 | 16 | def print_ang(angle, end="\n"): 17 | print(f"{int(angle//60)}°{angle%60}'", end=end) 18 | 19 | def print_anglst(lst): 20 | for angle in lst: 21 | print_ang(angle, " ") 22 | print() 23 | 24 | print_anglst(left1_right1) 25 | print_anglst(left2_right2) 26 | print_anglst(A) 27 | print_ang(A_) 28 | print_ang(uA) 29 | print_ang(u) 30 | 31 | """ 32 | 119°54' 119°53' 119°57' 119°55' 119°50' 119°51' 33 | 120°3' 119°59' 120°3' 120°0' 119°56' 119°58' 34 | 59°59.25' 59°58.0' 60°0.0' 59°58.75' 59°56.5' 59°57.25' 35 | 59°58.291666666666515' -> 59°58' 36 | 0°0.5300026205385948' 37 | 0°0.7837321679700987' -> 1' 38 | """ -------------------------------------------------------------------------------- /动态法测量材料杨氏模量/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/动态法测量材料杨氏模量/Figure.png -------------------------------------------------------------------------------- /动态法测量材料杨氏模量/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | print("---------- plotter ----------") 5 | 6 | plt.rc("font", family="Source Han Serif CN", size=12, weight="bold") 7 | 8 | ds = [5.945, 5.950, 5.940, 5.945, 5.945] 9 | Ls = [160.0, 159.8, 160.0, 160.2, 160.0] 10 | ms = [37.439, 37.441, 37.440, 37.441, 37.440] 11 | 12 | L = 160.0 13 | xs_mm = [10, 20, 30, 40, 50] 14 | xs = list(map(lambda x: x / L, xs_mm)) 15 | fs = [745.2, 744.2, 743.7, 743.6, 743.9] 16 | 17 | plt.scatter(xs, fs) 18 | plt.title("试样棒 共振频率-位置 曲线", weight="bold", size=18) 19 | plt.xlabel("x/L", weight="bold", size=14) 20 | plt.ylabel("f/Hz", weight="bold", size=14) 21 | plt.grid(True) 22 | for x_, f_ in zip(xs, fs): 23 | plt.text(x_ + 0.01, f_, f"({x_}, {f_})", ha="left", va="bottom") 24 | 25 | model = np.polyfit(xs, fs, 2) 26 | model_fn = np.poly1d(model) 27 | xs_model = np.arange(0.05, 0.40, 0.01) 28 | plt.plot(xs_model, model_fn(xs_model), color="orange") 29 | 30 | a, b, c = model 31 | x_low = -b / (2*a) 32 | f_low = (4*a*c - b**2) / (4*a) 33 | plt.scatter([x_low], [f_low], marker="x", color="black") 34 | plt.text(x_low - 0.01, f_low, f"({x_low:.2f}, {f_low:.2f})", ha="right", va="center") 35 | 36 | print(f"fn: f = {a} x^2 + {b} x + {c}") 37 | print(f"lowest point: ({x_low}, {f_low})") 38 | 39 | plt.show() 40 | 41 | print("\n---------- calculator ----------") 42 | d = sum(ds) / len(ds) 43 | L = sum(Ls) / len(Ls) 44 | m = sum(ms) / len(ms) 45 | f = f_low 46 | dd_y = 0.004 47 | dL_y = 0.2 48 | dm_y = 0.001 49 | df_y = 0.1 50 | 51 | # d_u_A = np.sqrt((1/20) * sum((d_-d) ** 2 for d_ in ds)) 52 | d_u_A = 0.0016 53 | # L_u_A = np.sqrt((1/20) * sum((L_-L) ** 2 for L_ in Ls)) 54 | L_u_A = 0.06 55 | # m_u_A = np.sqrt((1/20) * sum((m_-m) ** 2 for m_ in ms)) 56 | m_u_A = 0.0004 57 | d_u_B = dd_y / np.sqrt(3) 58 | L_u_B = dL_y / np.sqrt(3) 59 | m_u_B = dm_y / np.sqrt(3) 60 | 61 | # dd = round(np.sqrt(d_u_A**2 + d_u_B**2), 4) 62 | dd = 0.003 63 | # dL = round(np.sqrt(L_u_A**2 + L_u_B**2), 2) 64 | dL = 0.2 65 | # dm = round(np.sqrt(m_u_A**2 + m_u_B**2), 5) 66 | dm = 0.0007 67 | df = df_y 68 | 69 | print(f"d: u_A = {d_u_A}\nL: u_A = {L_u_A}\nm: u_A = {m_u_A}") 70 | print(f"d: u_C = {dd}\nL: u_C = {dL}\nm: u_C = {dm}") 71 | 72 | E = 1.6067 * ((L**3) * m * (f**2)) / (d ** 4) 73 | dE = E * np.sqrt( 74 | (3 * dL / L) ** 2 + 75 | (4 * dd / d) ** 2 + 76 | ( dm / m) ** 2 + 77 | (2 * df / f) ** 2 78 | ) 79 | 80 | print() 81 | print(f"d = {d} ± {dd} mm") 82 | print(f"L = {L} ± {dL} mm") 83 | print(f"m = {m} ± {dm} g") 84 | print(f"E = {E} ± {dE} Pa") 85 | print(f"E = {E:.4g} ± {dE:.4g} Pa") 86 | 87 | """res 88 | ---------- plotter ---------- 89 | fn: f = 54.85714285716307 x^2 + -25.691428571436525 x + 746.5800000000011 90 | lowest point: (0.2341666666666529, 743.5719619047622) 91 | 92 | ---------- calculator ---------- 93 | d: u_A = 0.0016 94 | L: u_A = 0.06 95 | m: u_A = 0.0004 96 | d: u_C = 0.003 97 | L: u_C = 0.2 98 | m: u_C = 0.0007 99 | 100 | d = 5.945 ± 0.003 mm 101 | L = 160.0 ± 0.2 mm 102 | m = 37.4402 ± 0.0007 g 103 | E = 109061502500.9468 ± 465394319.9617047 Pa 104 | E = 1.091e+11 ± 4.654e+08 Pa 105 | """ -------------------------------------------------------------------------------- /动态法测量材料杨氏模量/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/动态法测量材料杨氏模量/data.pdf -------------------------------------------------------------------------------- /惠斯登电桥/code.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | Rs = [676.9, 676.3, 680.9, 677.8, 676.3, 684.1, 679.9, 684.6] 4 | R_ = sum(Rs) / len(Rs) 5 | S = (1/7*sum((R - R_)**2 for R in Rs)) ** 0.5 6 | p = S / R_ * 100 7 | 8 | print(f"平均: {R_}") 9 | print(f"标准差: {S}") 10 | print(f"离散度: {p}%") -------------------------------------------------------------------------------- /抛射体运动的照相法研究/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/抛射体运动的照相法研究/Figure.png -------------------------------------------------------------------------------- /抛射体运动的照相法研究/code.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import numpy as np 3 | 4 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 5 | plt.figure(figsize=(10, 10)) 6 | 7 | xs = [0.8, 7.6, 14.0, 21.0, 27.6, 34.2, 41.0, 47.2, 54.3, 61.0, 67.0] 8 | ys = [20.8, 13.9, 8.9, 5.1, 3.4, 3.1, 5.0, 8.5, 13.5, 18.9, 26.8] 9 | vxs = [round(b - a, 1) for a, b in zip(xs, xs[1:])] 10 | vys = [round(b - a, 1) for a, b in zip(ys, ys[1:])] 11 | ays = [round(b - a, 1) for a, b in zip(vys, vys[1:])] 12 | print(xs, ys, vxs, vys, ays, sep="\n") 13 | ts = list(range(11)) 14 | 15 | plt.subplot(321) 16 | plt.scatter(range(len(xs)), xs) 17 | plt.title("x-t 图", weight="bold", size=20) 18 | plt.xlabel("t/T", weight="bold", size=16) 19 | plt.ylabel("x/cm", weight="bold", size=16) 20 | plt.grid(True) 21 | 22 | linear_model = np.polyfit(ts, xs, 1) 23 | print(f"x-t: x = {linear_model[0]} * t + {linear_model[1]}") 24 | linear_model_fn = np.poly1d(linear_model) 25 | t_s = np.arange(0, 11) 26 | plt.plot(t_s, linear_model_fn(t_s), color="orange", linestyle="--") 27 | 28 | plt.subplot(322) 29 | plt.scatter(range(len(ys)), ys) 30 | plt.title("y-t 图", weight="bold", size=20) 31 | plt.xlabel("t/T", weight="bold", size=16) 32 | plt.ylabel("y/cm", weight="bold", size=16) 33 | plt.grid(True) 34 | 35 | linear_model = np.polyfit(ts, ys, 2) 36 | print(f"x-t: y = {linear_model[0]} * t^2 + {linear_model[1]} * t + {linear_model[2]}") 37 | linear_model_fn = np.poly1d(linear_model) 38 | t_s = np.arange(0, 11) 39 | plt.plot(t_s, linear_model_fn(t_s), color="orange", linestyle="--") 40 | 41 | plt.subplot(323) 42 | plt.scatter(np.arange(0.5, len(vxs)+0.5), vxs) 43 | plt.title("vx-t 图", weight="bold", size=20) 44 | plt.xlabel("t/T", weight="bold", size=16) 45 | plt.ylabel("vx/(cm/T)", weight="bold", size=16) 46 | plt.grid(True) 47 | 48 | linear_model = np.polyfit(np.arange(0.5, len(vxs)+0.5), vxs, 1) 49 | print(f"vx-t: vx = {linear_model[0]} * t + {linear_model[1]}") 50 | linear_model_fn = np.poly1d(linear_model) 51 | t_s = np.arange(0, 11) 52 | plt.plot(t_s, linear_model_fn(t_s), color="orange", linestyle="--") 53 | plt.ylim(0, 11) 54 | 55 | plt.subplot(324) 56 | plt.scatter(np.arange(0.5, len(vys)+0.5), vys) 57 | plt.title("vy-t 图", weight="bold", size=20) 58 | plt.xlabel("t/T", weight="bold", size=16) 59 | plt.ylabel("vy/(cm/T)", weight="bold", size=16) 60 | plt.grid(True) 61 | 62 | linear_model = np.polyfit(np.arange(0.5, len(vys)+0.5), vys, 1) 63 | print(f"vy-t: vy = {linear_model[0]} * t + {linear_model[1]}") 64 | linear_model_fn = np.poly1d(linear_model) 65 | t_s = np.arange(0, 11) 66 | plt.plot(t_s, linear_model_fn(t_s), color="orange", linestyle="--") 67 | # plt.ylim(0, 11) 68 | 69 | plt.subplot(325) 70 | plt.scatter(np.arange(1, len(ays)+1), ays) 71 | plt.title("ay-t 图", weight="bold", size=20) 72 | plt.xlabel("t/T", weight="bold", size=16) 73 | plt.ylabel("ay/(cm/T^2)", weight="bold", size=16) 74 | plt.grid(True) 75 | 76 | linear_model = np.polyfit(np.arange(1, len(ays)+1), ays, 1) 77 | print(f"ay-t: ay = {linear_model[0]} * t + {linear_model[1]}") 78 | linear_model_fn = np.poly1d(linear_model) 79 | t_s = np.arange(0, 11) 80 | plt.plot(t_s, linear_model_fn(t_s), color="orange", linestyle="--") 81 | plt.ylim(0, 11) 82 | 83 | a_ = sum(ays) / len(ays) 84 | g_ = a_ * 24 * 24 / 100 85 | g = 9.793 86 | E = abs(g_ - g) / g 87 | print(f"average of ay: {a_} cm/T^2\ng = {g_} m/s^2\nE = {E*100}%") 88 | 89 | plt.tight_layout() 90 | plt.show() 91 | 92 | """ 93 | [0.8, 7.6, 14.0, 21.0, 27.6, 34.2, 41.0, 47.2, 54.3, 61.0, 67.0] 94 | [20.8, 13.9, 8.9, 5.1, 3.4, 3.1, 5.0, 8.5, 13.5, 18.9, 26.8] 95 | [6.8, 6.4, 7.0, 6.6, 6.6, 6.8, 6.2, 7.1, 6.7, 6.0] 96 | [-6.9, -5.0, -3.8, -1.7, -0.3, 1.9, 3.5, 5.0, 5.4, 7.9] 97 | [1.9, 1.2, 2.1, 1.4, 2.2, 1.6, 1.5, 0.4, 2.5] 98 | x-t: x = 6.6481818181818175 * t + 0.9136363636363705 99 | x-t: y = 0.8160839160839166 * t^2 + -7.504475524475527 * t + 20.586713286713298 100 | vx-t: vx = -0.03393939393939427 * t + 6.789696969696973 101 | vy-t: vy = 1.6230303030303035 * t + -7.515151515151515 102 | ay-t: ay = -0.016666666666666777 * t + 1.727777777777778 103 | average of ay: 1.6444444444444446 cm/T^2 104 | g = 9.472000000000001 m/s^2 105 | E = 3.277851526600613% 106 | """ -------------------------------------------------------------------------------- /抛射体运动的照相法研究/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/抛射体运动的照相法研究/data.pdf -------------------------------------------------------------------------------- /用双臂电桥测低电阻/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/用双臂电桥测低电阻/Figure.png -------------------------------------------------------------------------------- /用双臂电桥测低电阻/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | print("---------- 测量金属导体电阻率 ----------") 5 | 6 | ds = [4.08, 4.10, 4.12, 4.04, 4.14, 4.10] 7 | ls = [20.00, 20.00, 20.00, 20.00, 20.00, 20.00] 8 | Rs = [4.376, 4.352, 4.344, 4.347, 4.346, 4.345] 9 | Rs = [R * 10**-4 for R in Rs] 10 | 11 | d_ = sum(ds) / len(ds) 12 | l_ = sum(ls) / len(ls) 13 | R_ = sum(Rs) / len(Rs) 14 | 15 | n = len(ds) 16 | ua_d = ((1 / n*(n-1)) * sum((d - d_)**2 for d in ds)) ** 0.5 17 | ua_l = ((1 / n*(n-1)) * sum((l - l_)**2 for l in ls)) ** 0.5 18 | ua_R = ((1 / n*(n-1)) * sum((R - R_)**2 for R in Rs)) ** 0.5 19 | ub_d = 0.02 / (3 ** 0.5) 20 | ub_l = 0.05 / (3 ** 0.5) 21 | ub_R = 0.0011*0.01 / (3 ** 0.5) 22 | u_d = (ua_d**2 + ub_d**2) ** 0.5 23 | u_l = (ua_l**2 + ub_l**2) ** 0.5 24 | u_R = (ua_R**2 + ub_R**2) ** 0.5 25 | 26 | rho = np.pi * (d_**2) * R_ * 10**-4 / (4 * l_) 27 | u_rho_over_rho = ( 28 | (u_R / R_) ** 2 + 29 | (2 * u_d / d_) ** 2 + 30 | (u_l / l_) ** 2 31 | ) ** 0.5 32 | u_rho = rho * u_rho_over_rho 33 | 34 | print(f"均值: d = {d_}mm l = {l_}cm R = {R_}Ω") 35 | print(f"电阻率均值: ρ = {rho}") 36 | print(f"A 类不确定度: ua_d = {ua_d}mm ua_l = {ua_l}cm ua_R = {ua_R}Ω") 37 | print(f"B 类不确定度: ub_d = {ub_d}mm ub_l = {ub_l}cm ub_R = {ub_R}Ω") 38 | print(f"合成不确定度: u_d = {u_d}mm u_l = {u_l}cm u_R = {u_R}Ω") 39 | print(f"电阻率相对不确定度: {u_rho_over_rho}") 40 | print(f"电阻率不确定度: {u_rho}") 41 | 42 | 43 | print("\n---------- 测量金属导体电阻温度系数 ----------") 44 | 45 | t = [20.0, 25.2, 30.1, 36.1, 40.0, 47.4, 50.1, 55.4] 46 | R = [4.615, 4.697, 4.795, 4.896, 4.981, 5.086, 5.156, 5.246] 47 | 48 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 49 | plt.scatter(t, R) 50 | plt.title("电阻 R-t 特性曲线", weight="bold", size=20) 51 | plt.xlabel("t/℃", weight="bold", size=16) 52 | plt.ylabel("R/10^-3Ω", weight="bold", size=16) 53 | plt.grid(True) 54 | for t_, R_ in zip(t, R): 55 | plt.text(t_ - 2, R_, f"({round(t_, 3)}, {R_})", ha="right", va="center") 56 | 57 | linear_model = np.polyfit(t, R, 1) 58 | print(f"linear fit model of R-t: R = {linear_model[0]} * t + {linear_model[1]}") 59 | linear_model_fn = np.poly1d(linear_model) 60 | x_s = np.arange(0, 60) 61 | plt.plot(x_s, linear_model_fn(x_s), color="green") 62 | plt.show() 63 | 64 | alphas = [ 65 | (R[4] - R[0]) / (R[0] * t[4] - R[4] * t[0]), 66 | (R[5] - R[1]) / (R[1] * t[5] - R[5] * t[1]), 67 | (R[6] - R[2]) / (R[2] * t[6] - R[6] * t[2]), 68 | (R[7] - R[3]) / (R[3] * t[7] - R[7] * t[3]) 69 | ] 70 | alpha_ = sum(alphas) / len(alphas) 71 | alpha = linear_model[0] / linear_model[1] 72 | 73 | print(f"α1 = {alphas[0]} α2 = {alphas[1]} α3 = {alphas[2]} α4 = {alphas[3]}") 74 | print(f"平均 α = {alpha_}") 75 | print(f"由图像 α = {alpha}") 76 | 77 | alpha0 = 0.00433 78 | print(f"E1 = {abs(alpha_ - alpha0) / alpha0 * 100}%") 79 | print(f"E2 = {abs(alpha - alpha0) / alpha0 * 100}%") 80 | 81 | """ 82 | ---------- 测量金属导体电阻率 ---------- 83 | 均值: d = 4.096666666666667mm l = 20.0cm R = 0.00043516666666666676Ω 84 | 电阻率均值: ρ = 2.867984259715793e-08 85 | A 类不确定度: ua_d = 0.07031674369909642mm ua_l = 0.0cm ua_R = 2.498888641865537e-06Ω 86 | B 类不确定度: ub_d = 0.011547005383792516mm ub_l = 0.02886751345948129cm ub_R = 6.3508529610858845e-06Ω 87 | 合成不确定度: u_d = 0.07125852775477297mm u_l = 0.02886751345948129cm u_R = 6.8247914091038665e-06Ω 88 | 电阻率相对不确定度: 0.038187532324404 89 | 电阻率不确定度: 1.0952124162377872e-09 90 | 91 | ---------- 测量金属导体电阻温度系数 ---------- 92 | linear fit model of R-t: R = 0.017878473541685893 * t + 4.253947562658123 93 | α1 = 0.0043068957401741536 α2 = 0.004117683173389396 α3 = 0.004245365671808534 α4 = 0.0042757073852461285 94 | 平均 α = 0.0042364129926545525 95 | 由图像 α = 0.004202795939147483 96 | E1 = 2.1613627562458935% 97 | E2 = 2.937738125924164% 98 | """ -------------------------------------------------------------------------------- /用双臂电桥测低电阻/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/用双臂电桥测低电阻/data.pdf -------------------------------------------------------------------------------- /示波器的应用/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/示波器的应用/Figure.png -------------------------------------------------------------------------------- /示波器的应用/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | theta = np.linspace(0, 2 * np.pi, 1000) 5 | 6 | ps = [1, 2, 3, 1, 3] 7 | qs = [1, 1, 1, 2, 2] 8 | ns = [0.25, 0.6, 0.25, 1.8, 0] 9 | 10 | plt.figure(figsize=(17, 3)) 11 | 12 | for ind, (p, q, n) in enumerate(zip(ps, qs, ns)): 13 | plt.subplot(1, 5, ind + 1) 14 | plt.xlim((-1.1, 1.1)) 15 | plt.ylim((-1.1, 1.1)) 16 | plt.axis('off') 17 | x = np.sin(p * theta) 18 | y = np.sin(q * theta + n * np.pi) 19 | plt.plot(x, y, color="black") 20 | 21 | plt.show() -------------------------------------------------------------------------------- /示波器的应用/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/示波器的应用/data.pdf -------------------------------------------------------------------------------- /组装整流器/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/组装整流器/data.pdf -------------------------------------------------------------------------------- /铁磁材料的磁滞回线和基本磁化曲线/Figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/铁磁材料的磁滞回线和基本磁化曲线/Figure1.png -------------------------------------------------------------------------------- /铁磁材料的磁滞回线和基本磁化曲线/Figure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/铁磁材料的磁滞回线和基本磁化曲线/Figure2.png -------------------------------------------------------------------------------- /铁磁材料的磁滞回线和基本磁化曲线/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from matplotlib.ticker import MultipleLocator 4 | from scipy.interpolate import make_interp_spline 5 | 6 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 7 | 8 | N1 = 150 9 | N2 = 150 10 | L = 0.13 11 | S = 1.24e-4 12 | R1 = 2.5 13 | R2 = 10000 14 | C = 3e-6 15 | 16 | Ux1 = np.array([0.024, 0.044, 0.070, 0.085, 0.110, 0.155, 0.230, 0.35, 0.56, 1.1]) 17 | Uy1 = np.array([0.025, 0.050, 0.085, 0.105, 0.125, 0.155, 0.190, 0.21, 0.23, 0.25]) 18 | H = N1 * Ux1 / (L * R1 * 2 * np.sqrt(2)) 19 | B = R2 * Uy1 * C / (N2 * S * 2 * np.sqrt(2)) 20 | mu = B / H 21 | # mu = mu / (4 * np.pi * 10**-7) 22 | 23 | print(H) 24 | print(B) 25 | print(mu) 26 | 27 | _, mu_axis = plt.subplots() 28 | B_axis = mu_axis.twinx() 29 | 30 | plt.title("μ-H / B-H 曲线", weight="bold", size=20) 31 | mu_axis.set_xlabel("H/(A/m)", weight="bold", size=16) 32 | mu_axis.set_ylabel("μ/(H/m)", weight="bold", size=16) 33 | B_axis.set_ylabel("B/T", weight="bold", size=16) 34 | 35 | mu_axis.scatter(H, mu, s=15) 36 | B_axis.scatter(H, B, marker="x") 37 | 38 | plt.show() 39 | 40 | Ux2 = np.array([ 41 | 0.15, 0.18, 0.20, 0.24, 0.30, 0.43, 0.30, 0.24, 0.20, 0.10, 42 | 0, -0.02, -0.04, -0.06, -0.08, -0.10, -0.12, -0.16, -0.18, 43 | -0.20, -0.22, -0.24, -0.26, -0.28, -0.30, -0.34, -0.43, 44 | -0.30, -0.26, -0.20, -0.10, -0.04, 0, 0.02, 0.04, 45 | 0.05, 0.08, 0.10, 0.12, 0.14 46 | ]) 47 | Uy2 = np.array([ 48 | 0, 0.06, 0.12, 0.16, 0.19, 0.22, 0.21, 0.20, 0.19, 0.17, 49 | 0.14, 0.13, 0.12, 0.10, 0.09, 0.07, 0.05, 0, -0.06, 50 | -0.09, -0.12, -0.15, -0.17, -0.18, -0.19, -0.20, -0.23, 51 | -0.21, -0.20, -0.19, -0.17, -0.15, -0.13, -0.12, -0.11, 52 | -0.10, -0.08, -0.06, -0.04, -0.01 53 | ]) 54 | H2 = N1 * Ux2 / (L * R1 * 2 * np.sqrt(2)) 55 | B2 = R2 * Uy2 * C / (N2 * S * 2 * np.sqrt(2)) 56 | print(H2) 57 | print(B2*1e4) 58 | 59 | plt.title("B-H 曲线", weight="bold", size=20) 60 | plt.xlabel("H/(A/m)", weight="bold", size=16) 61 | plt.ylabel("B/T", weight="bold", size=16) 62 | 63 | ax = plt.gca() 64 | ax.yaxis.set_minor_locator(MultipleLocator(0.01)) 65 | ax.yaxis.grid(True, which='minor') 66 | ax.xaxis.set_minor_locator(MultipleLocator(5)) 67 | ax.xaxis.grid(True, which='minor') 68 | 69 | plt.scatter(H2, B2) 70 | plt.grid(which="major") 71 | plt.show() 72 | 73 | """ 74 | [ 3.91628371 7.17985347 11.42249416 13.87017148 17.94963368 75 | 25.29266563 37.53105223 57.11247079 91.37995326 179.49633676] 76 | [0.01425619 0.02851237 0.04847103 0.05987598 0.07128093 0.08838835 77 | 0.10834701 0.11975195 0.1311569 0.14256185] 78 | [0.00364023 0.00397116 0.00424347 0.00431689 0.00397116 0.00349462 79 | 0.00288686 0.00209677 0.00143529 0.00079423] 80 | [ 24.47677319 29.37212783 32.63569759 39.16283711 48.95354639 81 | 70.16674983 48.95354639 39.16283711 32.63569759 16.3178488 82 | 0. -3.26356976 -6.52713952 -9.79070928 -13.05427904 83 | -16.3178488 -19.58141856 -26.10855807 -29.37212783 -32.63569759 84 | -35.89926735 -39.16283711 -42.42640687 -45.68997663 -48.95354639 85 | -55.48068591 -70.16674983 -48.95354639 -42.42640687 -32.63569759 86 | -16.3178488 -6.52713952 0. 3.26356976 6.52713952 87 | 8.1589244 13.05427904 16.3178488 19.58141856 22.84498832] 88 | [ 0. 342.14844251 684.29688502 912.39584669 89 | 1083.47006795 1254.5442892 1197.51954878 1140.49480837 90 | 1083.47006795 969.42058711 798.34636586 741.32162544 91 | 684.29688502 570.24740418 513.22266376 399.17318293 92 | 285.12370209 0. -342.14844251 -513.22266376 93 | -684.29688502 -855.37110627 -969.42058711 -1026.44532753 94 | -1083.47006795 -1140.49480837 -1311.56902962 -1197.51954878 95 | -1140.49480837 -1083.47006795 -969.42058711 -855.37110627 96 | -741.32162544 -684.29688502 -627.2721446 -570.24740418 97 | -456.19792335 -342.14844251 -228.09896167 -57.02474042] 98 | """ -------------------------------------------------------------------------------- /铁磁材料的磁滞回线和基本磁化曲线/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/铁磁材料的磁滞回线和基本磁化曲线/data.pdf -------------------------------------------------------------------------------- /非平衡电桥/Figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/非平衡电桥/Figure.png -------------------------------------------------------------------------------- /非平衡电桥/code.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | plt.rc("font", family="Source Han Serif CN", size=13, weight="bold") 5 | plt.figure(figsize=(13, 6)) 6 | 7 | t = [20.5, 25.3, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0] 8 | U = [29.3, 35.4, 41.0, 47.4, 53.3, 59.3, 65.2, 70.7] 9 | alphas = [] 10 | E = 1.3 11 | alpha_expect = 0.004280 12 | 13 | for t_, U_ in zip(t, U): 14 | U_ = U_ / 1000 15 | alphas.append(4 * U_ / (t_ * (E - 2 * U_))) 16 | alpha = sum(alphas) / len(alphas) 17 | 18 | print(f"alpha values: {alphas}") 19 | print(f"average alpha: {alpha} with relative error {abs(alpha - alpha_expect) / alpha_expect * 100}%") 20 | 21 | plt.subplot(121) 22 | plt.scatter(t, U) 23 | plt.title("Cu50 电阻 U-t 特性曲线", weight="bold", size=20) 24 | plt.xlabel("t/℃", weight="bold", size=16) 25 | plt.ylabel("U/mV", weight="bold", size=16) 26 | plt.grid(True) 27 | for t_, U_ in zip(t, U): 28 | plt.text(t_ - 2, U_, f"({t_}, {U_})", ha="right", va="center") 29 | 30 | linear_model = np.polyfit(t, U, 1) 31 | print(f"linear fit model of U-t: U = {linear_model[0]} * t + {linear_model[1]}") 32 | linear_model_fn = np.poly1d(linear_model) 33 | x_s = np.arange(0, 60) 34 | plt.plot(x_s, linear_model_fn(x_s), color="orange", linestyle="--") 35 | 36 | k = sum(x*y for x, y in zip(t, U)) / sum(x**2 for x in t) 37 | print(f"proportional fit model of U-t: U = {k} * t") 38 | print( 39 | f"alpha calculated by proportional fit: {4 * k / 1000 / 1.3}" 40 | f" with relative error {abs(4 * k / 1000 / 1.3 - alpha_expect) / alpha_expect * 100}%" 41 | ) 42 | fn = np.poly1d([k, 0]) 43 | plt.plot(x_s, fn(x_s), color="green") 44 | 45 | t = [60.0, 55.3, 50.0, 45.0, 40.0, 35.1, 30.0, 25.2] 46 | R = [63.77, 62.75, 61.60, 60.51, 59.41, 58.36, 57.19, 56.17] 47 | 48 | plt.subplot(122) 49 | plt.scatter(t, R) 50 | plt.title("Cu50 电阻 Rt-t 特性曲线", weight="bold", size=20) 51 | plt.xlabel("t/℃", weight="bold", size=16) 52 | plt.ylabel("Rt/Ω", weight="bold", size=16) 53 | plt.grid(True) 54 | for t_, R_ in zip(t, R): 55 | plt.text(t_ - 2, R_, f"({t_}, {R_})", ha="right", va="center") 56 | 57 | linear_model = np.polyfit(t, R, 1) 58 | print(f"linear model of Rt-t: Rt = {linear_model[0]} * t + {linear_model[1]}") 59 | linear_model_fn = np.poly1d(linear_model) 60 | x_s = np.arange(0, 65) 61 | plt.plot(x_s, linear_model_fn(x_s), color="green") 62 | 63 | R0 = linear_model[1] 64 | R0_alpha = linear_model[0] 65 | alpha_ = R0_alpha / R0 66 | print( 67 | f"alpha calculated by Rt-t graph: {alpha_}" 68 | f" with relative error {abs(alpha_ - alpha_expect) / alpha_expect * 100}%" 69 | ) 70 | 71 | plt.show() 72 | 73 | """ 74 | result: 75 | 76 | alpha values: [0.0046053432984789, 0.004553236206202433, 0.0044882320744389715, 0.004494808212033568, 0.004466230936819172, 0.0044617497131463615, 0.004459644322845418, 0.00443795803712945] 77 | average alpha: 0.004495900350136785 78 | linear fit model of U-t: U = 1.203704426194331 * t + 4.940713575093168 79 | proportional fit model of U-t: U = 1.324184821820882 * t 80 | alpha calculated by proportional fit: 0.0052967392872835285 81 | linear model of Rt-t: Rt = 0.21872471034558272 * t + 50.65779545703681 82 | """ 83 | -------------------------------------------------------------------------------- /非平衡电桥/data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TonyCrane/ZJU-General-Physics-Experiment-I/30a6fb35807e6e671f26ddd5b5cb8816314ea235/非平衡电桥/data.pdf --------------------------------------------------------------------------------