- 注册时间
- 2011-5-29
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 1404
- 在线时间
- 小时
|
楼主 |
发表于 2013-1-17 08:17:46
|
显示全部楼层
如果你能看懂我的VB程序,你就分析一下,吧。
NameF.Text = "F(x) ="
Dim Ii, xChen0, Xp0 As Single
Dim cv As String * 2000
xChen0 = ychen
Xp0 = xP
Call SJbz
Select Case ychen
Case 64
xP = 24
xChen = 80
Case 128
xP = 45
xChen = 160
Case 256
xP = 85
xChen = 300
End Select
Xspd = 0
Call SJbz
Wx = Ax
An = SToo(0)
Bn = SToo(1)
Ax = An
Bx = Bn
hsfx = "-"
Call Addition
If Left(Ax.St, 1) <> 0 And An.bz = "" And Bn.bz = "" Then 'A -B <> 0
'初始值 x0
If Left(Xy.St, 1) = "1" Or Left(Xy.St, 1) = "3" Then 'C=0
If Ax.bz = "" Then '如果A>B A-B交换
An = SToo(1)
Bn = SToo(0)
End If
Call Dj01 '计算初始值 x0
Ax = SToo(3)
If Xspd = 0 Then
For Ii = 0 To 100
Call Dj2012 'x 带入原方程
'SToo(4) = Ax
Call Dj2012F '导数
SToo(5) = Ax
Cx = SToo(4)
Ax = SToo(5)
Call multx_ 'F(x)/F'(x)
Bx = Cx
Ax = SToo(3)
hsfx = "-"
Call Addition
If Left(Bx.St, 1) = "0" Or Bx.zs < -xChen - 20 Then
SToo(3) = Ax
Call Dj2012
SToo(4) = Ax
Exit For
End If
SToo(3) = Ax
Next
Else
'仅计算小数部分 '(2by)^(1/2)*d^b
Ax = Bn
Bx = Bn
hsfx = "+"
Call Addition '2b
Cx = SToo(3)
Call mult_ '2by
Ax = Cx
Call Lnx
Cx.bz = ""
Cx.St = "5"
Cx.zs = -1
Call mult_
Ax = Cx
Call Exp '(2by)^(1/2)
Px = Ax
Ax = Dn 'd
Call Lnx
Cx = Bn 'b
Call mult_
Ax = Cx
Call Exp 'd^b
Cx = Px
Call mult_
Ax = Cx
SToo(4) = Ax
'2b/a*(b^2-a^2)^(1/2)d^b*y
Ax = Ajn(1)
Cx = Bn
Call mult_
Ax = An
Call multx_
Ax = Cx
Bx = Cx
hsfx = "+"
Call Addition
Px = Ax
Ax = Dn
Call Lnx
Cx = Bn
Call mult_
Ax = Cx
Call Exp
Cx = Px
Call mult_ '*d^b
Ax = SToo(3)
Call mult_
Ax = SToo(3)
Bx = Cx
hsfx = "+"
Call Addition
End If
Else
'数值验证 ,=0
Call SJbz
Call Dj2012
End If
Else '如果 A=B 根x=A
Ax = An
SToo(3) = An
End If
'结果显示处理
Form1.Height = 5900
If Left(Xy.St, 1) = "1" Then '显示根
If Xspd = 0 Then
Ax = SToo(3)
xChen = xChen - fn0
Call sc(Ax.bz, Ax.St, Ax.zs)
Else
'只计算小数部分时
For Ii = xChen + 20 To Bn.zs + 1 Step -1
If Mid(Bn.St, Ii, 1) <> "0" Then
Bn.St = Left(Bn.St, Ii)
End If
Next
Call sc(Ax.bz, Ax.St, Ax.zs)
Ax = SToo(3)
cv = Left(Bn.St, Bn.zs + 1) + "." + IIf(Ii - Bn.zs = 0, "", Mid(Bn.St, Bn.zs + 1, Ii - Bn.zs)) + " + " + Left(Ax.St, 1) + "." + Mid(Ax.St, 2, ychen - 1) + " E" + CStr(Ax.zs)
'在下窗口按精度显示
Text11.Text = cv
End If
Else '显示验证结果
Ax = SToo(4)
Call sc(Ax.bz, Ax.St, Ax.zs)
End If
xChen = xChen0
xP = Xp0 |
|