⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1change.frm

📁 结合实例用VB编程表达了一阶偏微分方程的数值解法
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   7470
   ClientLeft      =   2250
   ClientTop       =   1065
   ClientWidth     =   9750
   LinkTopic       =   "Form1"
   ScaleHeight     =   7470
   ScaleWidth      =   9750
   Begin VB.HScrollBar HScroll2 
      Height          =   375
      Left            =   5280
      Max             =   100
      TabIndex        =   16
      Top             =   5880
      Value           =   50
      Width           =   3855
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   375
      Left            =   720
      Max             =   100
      TabIndex        =   15
      Top             =   5880
      Value           =   50
      Width           =   3735
   End
   Begin VB.CommandButton Command5 
      Caption         =   "此时刻开关阀状态"
      Height          =   615
      Left            =   5640
      TabIndex        =   14
      Top             =   4800
      Width           =   1815
   End
   Begin VB.CommandButton Command4 
      Caption         =   "此时刻开度阀状态"
      Height          =   615
      Left            =   1080
      TabIndex        =   13
      Top             =   4920
      Width           =   1695
   End
   Begin VB.CommandButton Command3 
      Caption         =   "显示此时液位高度"
      Height          =   375
      Left            =   3480
      TabIndex        =   12
      Top             =   3000
      Width           =   1815
   End
   Begin VB.TextBox Text6 
      Height          =   495
      Left            =   3480
      TabIndex        =   11
      Top             =   3480
      Width           =   1695
   End
   Begin VB.CommandButton Command2 
      Caption         =   "画图"
      Height          =   495
      Left            =   6120
      TabIndex        =   10
      Top             =   3000
      Width           =   855
   End
   Begin VB.TextBox Text3 
      Height          =   495
      Left            =   1200
      TabIndex        =   9
      Text            =   "1"
      Top             =   600
      Width           =   1575
   End
   Begin VB.TextBox Text5 
      Height          =   495
      Left            =   6720
      TabIndex        =   8
      Text            =   "1"
      Top             =   600
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   495
      Left            =   3960
      TabIndex        =   7
      Text            =   "1"
      Top             =   600
      Width           =   1335
   End
   Begin VB.TextBox text1 
      Height          =   495
      Left            =   1200
      TabIndex        =   6
      Text            =   "12"
      Top             =   2160
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "计算此时刻压力值"
      Height          =   375
      Left            =   1080
      TabIndex        =   5
      Top             =   3000
      Width           =   1695
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   3480
      Width           =   1575
   End
   Begin VB.Label Label6 
      Caption         =   "开阀"
      Height          =   255
      Left            =   8760
      TabIndex        =   20
      Top             =   6360
      Width           =   375
   End
   Begin VB.Label Label5 
      Caption         =   "关阀"
      Height          =   255
      Left            =   5160
      TabIndex        =   19
      Top             =   6360
      Width           =   615
   End
   Begin VB.Label Label4 
      Caption         =   "开阀"
      Height          =   255
      Left            =   4080
      TabIndex        =   18
      Top             =   6360
      Width           =   495
   End
   Begin VB.Label Label2 
      Caption         =   "关阀"
      Height          =   255
      Left            =   720
      TabIndex        =   17
      Top             =   6360
      Width           =   495
   End
   Begin VB.Label Label3 
      Caption         =   "参加工作的油缸个数"
      Height          =   375
      Index           =   2
      Left            =   6600
      TabIndex        =   4
      Top             =   240
      Width           =   1695
   End
   Begin VB.Label Label3 
      Caption         =   "参加工作的蓄压器个数"
      Height          =   375
      Index           =   1
      Left            =   3840
      TabIndex        =   3
      Top             =   240
      Width           =   1935
   End
   Begin VB.Label Label3 
      Caption         =   "参加工作的油泵数"
      Height          =   375
      Index           =   0
      Left            =   1200
      TabIndex        =   2
      Top             =   240
      Width           =   1695
   End
   Begin VB.Label Label1 
      Caption         =   "输入时刻"
      Height          =   255
      Left            =   1200
      TabIndex        =   1
      Top             =   1800
      Width           =   1215
   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() '计算
pr = 1
cip = 0.2
cic = 0.15

cd = 0.7
w = 3
xv = 1
midu = 0.8

dt(i) = 0
For i = 0 To 250
 dt(i + 1) = dt(i) + 0.1
Next i

ctc = 0.2
cel = 0.1
ctp = 0.2

pa = 5
n = 1
v0 = 10
ea = 0.8
fl = 3.38
al = 1

kp = Int(Text3.Text)
ka = Int(Text4.Text)
kc = Int(Text5.Text)

p(0) = 5
For i = 0 To 250
 p(i + 1) = ((kp * 5.7 + (kp * cip + kc * cic) * pr) - kc * cd * w * xv * Sqr((p(i) - pr - fl / al) / midu) - (kc * ctc + cel + kp * ctp) * p(i)) * (dt(i + 1) - dt(i)) / (ka * (pa / p(i)) ^ (1 / n) * v0 / ea) + p(i)
Next i
Text2.Text = p(Int(text1.Text))
End Sub

Private Sub Command2_Click() '画图
Form2.Show
End Sub


Private Sub Command3_Click()
h0 = 2
Voil = 4842
Aot = 2421
cep = 0.1
cec = 0.1
cel = 0.1
sum = 0
xh = Val(text1.Text)
For i = 1 To xh
 sum = sum + p(i) * dt(i)
 If Voil - (kp * cep + kc * cec + cel) * sum < 0 Then
 Exit For
 h = 2
 Else
 h = h0 + (Voil - (kp * cep + kc * cec + cel) * sum) / Aot
 End If
Next i
Text6.Text = h
End Sub

Private Sub Command4_Click()
HScroll1.Value = 50
End Sub

Private Sub Command5_Click()
HScroll2.Value = 50
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -