谁能用VB解一下这个一元方程,求代码.20.26 = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5还是自己把它编出来了.答案196.61475.Private Sub Command1_Click()Dim v As DoubleDim v1 As Double,v

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 02:29:21
谁能用VB解一下这个一元方程,求代码.20.26 = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5还是自己把它编出来了.答案196.61475.Private Sub Command1_Click()Dim v As DoubleDim v1 As Double,v
xT[oQ+tW`aK[$hbb7 mX6}Ri5{Ya7vS{d %`i!*Ħ! !fil Db.``.ŁupNgΎ٬?Zzlt =p[I 16=pPȠB^=E̕aQd25žԓRӨ+u9"hؠJ!^1y>4yM.Q]HGqO%CmYOGJA&ck.[0 etR"C%A\ IH>;qým Zb*$'uo kZU{aO<{M~e=fӐRoVPNSTL>e U iu1~%שDxj%ĶWxeX.UMWJgdH$)`Y^B|=!{'8SG(YK$>ꐋ@:+ Xt&SE7Mq$Ak۟"ä#&V4[uuBoՍQ-3(E&7q^3

谁能用VB解一下这个一元方程,求代码.20.26 = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5还是自己把它编出来了.答案196.61475.Private Sub Command1_Click()Dim v As DoubleDim v1 As Double,v
谁能用VB解一下这个一元方程,求代码.
20.26 = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5
还是自己把它编出来了.答案196.61475.
Private Sub Command1_Click()
Dim v As Double
Dim v1 As Double,v2 As Double
Dim e As Double,n As Integer
v = 1
n = 0
Do
v1 = v
v = (8.314 * 473.15) / (20.26 + (3.224 * 1000000) / ((473.15 ^ 0.5) * v * (v + 29.85))) + 29.85
v2 = v
n = n + 1
e = Abs(v2 - v1)
Loop Until e < 1E-20
Print "v="; v
End Sub

谁能用VB解一下这个一元方程,求代码.20.26 = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5还是自己把它编出来了.答案196.61475.Private Sub Command1_Click()Dim v As DoubleDim v1 As Double,v
'答案是29.85,注意代码里可以设置结果的精确度
Private Function calc(bitnum As Integer) As Double
Dim v As Double, eps As Double
Dim cnt As Integer: cnt = 0
eps = 1
v = eps
Do While True
r = (8.314 * 473.15) / (v - 29.85) - (3.224 * 1000000) / (473.15 * v * (v + 29.85)) ^ 0.5
If r > 20.26 Then
cnt = cnt + 1
If cnt > bitnum Then
Exit Do
End If
v = v - eps
eps = eps / 10
End If
v = v + eps
Loop
calc = v
End Function
Private Sub Command1_Click()
v = calc(6) '结果精确到6位小数
MsgBox v
End Sub