📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Height = 375
Left = 720
TabIndex = 8
Text = "0.5"
Top = 240
Width = 855
End
Begin VB.TextBox Text3
Height = 495
Left = 2880
TabIndex = 6
Text = "输出结果"
Top = 2040
Width = 1455
End
Begin VB.TextBox Text2
Height = 495
Left = 2880
TabIndex = 3
Text = "497"
Top = 1080
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 375
Left = 3600
TabIndex = 2
Top = 2640
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 2880
TabIndex = 0
Text = "746"
Top = 240
Width = 1455
End
Begin VB.Label Label4
Caption = "电压变化步长"
Height = 375
Left = 120
TabIndex = 7
Top = 120
Width = 615
End
Begin VB.Label Label3
Caption = "带电作业危险率"
Height = 495
Left = 1800
TabIndex = 5
Top = 2040
Width = 975
End
Begin VB.Label Label2
Caption = "Ua 操作过电压平均值"
Height = 495
Left = 1800
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.Label Label1
Caption = "U50%放电电压"
Height = 615
Left = 1800
TabIndex = 1
Top = 120
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Ustart1, USTART2, U, Ustep As Double
Dim R2 As Double
Ustart1 = Text1.Text
USTART2 = Text2.Text
Ustep = Text4.Text
U = Text1.Text
R2 = 0
Do While (U - Ustart1) / Ustart1 / 0.03 < 10
R2 = (2 - NormSDist((U - Ustart1) / Ustart1 / 0.03) - NormSDist((U + Ustep - Ustart1) / Ustart1 / 0.03)) / 2 * (NormSDist((U + Ustep - USTART2) / USTART2 / 0.12) - NormSDist((U - USTART2) / USTART2 / 0.12)) + R2
U = U + Ustep
Loop
Text3.Text = R2
End Sub
Private Function NormSDist(z As Double) As Double
Dim step1 As Double
Dim pi As Double
step1 = 0.001
r1 = 0
pi = 3.1415926
For i = -20 To z Step step1
r1 = 1 / (2 * pi) ^ (1 / 2) * (Exp(-(i) ^ 2 / 2) + Exp(-(i + step1) ^ 2 / 2)) / 2 * step1 + r1
Next
NormSDist = r1
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -