牛顿环实验,请从13直径环依次输入到4环,且牛顿环实验试验次数为偶次,奇次请舍去!!!Lambda = 0.0005893 该函数无图像!!!
import numpy as np
import matplotlib.pyplot as plt
Lambda = 0.0005893
def Radius_of_curvature_of_lens(array):
length = len(array)
half_length = int(length/2)
list_max = array[0:half_length]
list_min = array[half_length:length]
list1 = []
for i in range(0,half_length):
top=(list_max[i]**2-list_min[i]**2)
bottom=4*((i+9)-(i+4))*Lambda
list1.append(top/bottom)
return list1
flag=1
while (flag==1):
print("牛顿环实验,请从13直径环依次输入到4环,只能从大到小输入,且牛顿环实验试验次数为偶次,奇次请舍去!!!Lambda = 0.0005893 该函数无图像")
print("支持n次实验测量但必须为偶次")
test_x = input("请输入n个数据,每个数据用空格隔开: ").split(" ")##依据空格,分片成列表
test_x = list(map(float,test_x))#将字符列表转化为数值列表
test_x = np.array(test_x)
RCL = np.round(Radius_of_curvature_of_lens(test_x),3)#透镜曲率半径
print("平凸透镜的曲率半径: ",RCL)
flag=int(input("请输入1或0.输入0退出程序,输入1重新进行数据测试: "))
还想了解其他帮助解决物理计算请往这边走---->>可视化测量平均值,残差,误差,标准误差