西安交通大学密立根油滴实验仿真实验计算
import math
# 静态法测量
pi = 3.14
d = 0.005
n = 1.85 * (10 ** (-5))
s = 0.002
p1 = 981
p2 = 1.293
g = 9.794
u = int(input("输入平衡电压:"))
tf = float(input("输入下落时间:"))
b = 0.00822
p = 101300
r0 = math.sqrt((9 * n * s) / (2 * (p1 - p2) * g * tf))
q2 = 9 * math.sqrt(2) * pi * d * math.sqrt(((n * s) ** 3) / ((p1 - p2) * g)) * (1 / u) * ((1 / tf) ** (3 / 2)) * (
(1 / (1 + b / p * r0)) ** (3 / 2))
number = q2 // (1.602 * (10 ** (-19)))
qs = q2 / number
e = 1.602 * (10 ** (-19))
print("总电量:", q2)
print("所带基本电荷数:", number)
print("元电荷带电量", qs)
wu = (qs - e) / e
print("相对误差", wu)
import math
# 动态法测量
pi = 3.14
d = 0.005
n = 1.85 * (10 ** (-5))
s = 0.002
p1 = 981
p2 = 1.293
g = 9.794
b = 0.00822
p = 101300
u = int(input("输入平衡电压:"))
tf = float(input("输入下落时间:"))
tr = float((input("输入上升时间:")))
r0 = math.sqrt((9 * n * s) / (2 * (p1 - p2) * g * tf))
q = 9 * math.sqrt(2) * pi * d * math.sqrt(((n * s) ** 3) / ((p1 - p2) * g)) * (1 / u) * (
(1 / tf) + (1 / tr)) * math.sqrt(1 / tf) * ((1 / (1 + b / p * r0)) ** (3 / 2))
number = q // (1.602 * (10 ** (-19)))
qs = q / number
e = 1.602 * (10 ** (-19))
print("总电量:", q)
print("所带基本电荷数:", number)
print("元电荷带电量", qs)
wu = (qs - e) / e
print("相对误差", wu)
具体代码和公式我是按照仿真实验所给的填写和计算的,可能每个学校都不太一样,可以自行修改,代码写起来不难,就是浪费时间