コード例 #1
0
ファイル: 10412.py プロジェクト: object8421/Phylab-Web
def MeasureGalvo(R0, R1, R2, U, d, delta_V):
    Rg = R2
    ki = R1 * U / ((R0 + R1) * R2 * d)
    #不确定度计算
    delta_R2 = phylab.DELTA_R(R2)
    U_Rg = delta_R2 / sqrt(3)
    delta_R1 = phylab.DELTA_R(R1)
    U_R1 = delta_R1 / sqrt(3)
    delta_R0 = phylab.DELTA_R(R0)
    U_R0 = delta_R0 / sqrt(3)
    U_V = delta_V / sqrt(3)
    U_d = 0.5 / sqrt(3)
    Uki = pow(R0 * U_R0 / (R1 * (R0 + R1)), 2)
    Uki = Uki + pow(U_V / U, 2)
    Uki = Uki + pow(U_R0 / (R0 + R1), 2)
    Uki = Uki + pow(U_Rg / Rg, 2)
    Uki = Uki + pow(U_d / d, 2)
    Uki = sqrt(Uki)
    U_ki = Uki * ki

    res_Rg = phylab.BitAdapt(Rg, U_Rg)
    print " res_Rg:" + res_Rg
    res_ki = phylab.BitAdapt(ki, U_ki)
    print " res_ki:" + res_ki
    R0 = round(R0, 1)
    print " R0:" + str(R0)
    Rg = round(Rg, 1)
    print " Rg:" + str(Rg)
    R2 = round(R2, 1)
    print "R2 :" + str(R2)
    d = ("%.0f" % d)
    print " d:" + d
    U = round(U, 1)
    print " U:" + str(U)
    R1 = ("%.0f" % R1)
    print "R1 :" + R1
    ki = phylab.ToScience(ki)
    print " ki:" + ki
    delta_R0 = round(delta_R0, 3)
    print " delta_R0:" + str(delta_R0)
    delta_R1 = round(delta_R1, 3)
    print " delta_R1:" + str(delta_R1)
    delta_R2 = round(delta_R2, 3)
    print " delta_R2:" + str(delta_R2)
    delta_V = round(delta_V, 3)
    print " delta_V:" + str(delta_V)
    U_R0 = round(U_R0, 4)
    print " U_R0:" + str(U_R0)
    U_R1 = round(U_R1, 4)
    print " U_R1:" + str(U_R1)
    U_Rg = round(U_Rg, 4)
    print " U_Rg:" + str(U_Rg)
    U_V = round(U_V, 4)
    print " U_V:" + str(U_V)
    U_d = round(U_d, 4)
    print " U_d:" + str(U_d)
    Uki = round(Uki, 5)
    print " Uki:" + str(Uki)
    U_ki = phylab.ToScience(U_ki)
    print " U_ki:" + U_ki
コード例 #2
0
def MeasureGalvo(R0, R1, R2, U, delta_V):
    global ki
    global d
    global Rg
    global U_ki
    global U_d
    Rg = R2
    ki = R1 * U / ((R0 + R1) * R2 * d)
    #不确定度计算
    delta_R2 = phylab.DELTA_R(R2)
    U_Rg = delta_R2 / sqrt(3)
    delta_R1 = phylab.DELTA_R(R1)
    U_R1 = delta_R1 / sqrt(3)
    delta_R0 = phylab.DELTA_R(R0)
    U_R0 = delta_R0 / sqrt(3)
    U_V = delta_V / sqrt(3)
    U_d = 0.5 / sqrt(3)
    Uki = pow(R0 * U_R0 / (R1 * (R0 + R1)), 2)
    Uki = Uki + pow(U_V / U, 2)
    Uki = Uki + pow(U_R0 / (R0 + R1), 2)
    Uki = Uki + pow(U_Rg / Rg, 2)
    Uki = Uki + pow(U_d / d, 2)
    Uki = sqrt(Uki)
    U_ki = Uki * ki

    res_Rg = phylab.BitAdapt(Rg, U_Rg)
    return res_Rg
コード例 #3
0
def VA_HR(Rs, U, delta_V):
    global ki
    global d
    global Rg
    global U_ki
    global U_d
    if ki == 0:
        return
    Rx = (Rs * U) / ((Rs + Rg) * ki * d)
    fRx = (Rs * U) / ((Rs + Rg) * ki * d) - Rg * Rs / (Rg + Rs)

    #不确定度计算
    delta_Rs = phylab.DELTA_R(Rs)
    delta_Rg = phylab.DELTA_R(Rg)
    U_Rs = delta_Rs / sqrt(3)
    U_Rg = delta_Rg / sqrt(3)
    U_V = delta_V / sqrt(3)

    a1 = pow(Rg * U_Rs / (Rs * (Rg + Rs)), 2)
    a2 = pow(U_V / (U - ki * d * Rg), 2)
    a3 = pow((d * Rg / (U - ki * d * Rg) + 1 / ki) * U_ki, 2)
    a4 = pow((ki * Rg / (U - ki * d * Rg) + 1 / d) * U_d, 2)
    a5 = pow((ki * d / (U - ki * d * Rg) + 1 / (Rg + Rs)) * U_Rg, 2)
    UfRx = sqrt(a1 + a2 + a3 + a4 + a5)
    U_fRx = UfRx * fRx

    res_fRx = phylab.BitAdapt(fRx, U_fRx)
    return res_fRx
コード例 #4
0
ファイル: 10413.py プロジェクト: ys15061078/PhyLab
def VA_HR(Rs,U,delta_V):
	global ki
	global d
	global Rg
	global U_ki
	global U_d
	if ki == 0:
		return
	Rx = (Rs*U) / ((Rs + Rg)*ki*d)
	fRx = (Rs*U) / ((Rs + Rg)*ki*d) - Rg*Rs/(Rg + Rs)

	#不确定度计算
	delta_Rs = phylab.DELTA_R(Rs)
	delta_Rg = phylab.DELTA_R(Rg)
	U_Rs = delta_Rs/sqrt(3)
	U_Rg = delta_Rg/sqrt(3)
	U_V = delta_V/sqrt(3)

	a1 = pow(Rg*U_Rs/(Rs*(Rg+Rs)) , 2)
	a2 = pow(U_V/(U-ki*d*Rg) , 2)
	a3 = pow((d*Rg/(U-ki*d*Rg)+1/ki)*U_ki,2)
	a4 = pow((ki*Rg/(U-ki*d*Rg)+1/d)*U_d,2)
	a5 = pow((ki*d/(U-ki*d*Rg)+1/(Rg+Rs))*U_Rg,2)
	UfRx = sqrt(a1+a2+a3+a4+a5)
	U_fRx = UfRx * fRx

	res_fRx = phylab.BitAdapt(fRx,U_fRx)
	print "res_fRx:" + res_fRx
	r_U = round(U,2)
	print "U:" + str(r_U)
	r_d = ("%d" %d)
	print "d:" + r_d
	r_Rs = ("%d" %Rs)
	print "Rs:" + r_Rs
	r_Rx = phylab.ToScience(Rx)
	print "Rx:" + r_Rx
	r_fRx = phylab.ToScience(fRx)
	print "fRx:" + r_fRx
	r_delta_Rs = round(delta_Rs,2)
	print "delta_Rs:" + str(r_delta_Rs)
	r_U_Rs = round(U_Rs,3)
	print "U_Rs:" + str(r_U_Rs)
	r_U_Rg = round(U_Rg,3)
	print "U_Rg:" + str(r_U_Rg)
	r_delta_V = round(delta_V,3)
	print "delta_V:" + str(r_delta_V)
	r_U_V = round(U_V,4)
	print "U_V:" + str(r_U_V)
	r_U_ki = phylab.ToScience(U_ki)
	print "U_ki:" + r_U_ki
	r_U_d = round(U_d,4)
	print "U_d:" + str(r_U_d)
	r_UfRx = phylab.ToScience(UfRx)
	print "UfRx:" + r_UfRx
	r_U_fRx = phylab.ToScience(U_fRx)
	print "U_fRx:" + r_U_fRx