VB常用数值算法集 内含有解线性代数方程组

源代码在线查看: d9r9.txt

软件大小: 1879 K
上传用户: whyzhao
关键词: 数值算法 解线性 方程
下载地址: 免注册下载 普通下载 VIP

相关代码

				Private Sub Command1_Click()
				    'PROGRAM D9R9
				    'Driver for roution FGAUSS
				    NPT = 3
				    NLIN = 2
				    NA = 3 * NLIN
				    Dim A(6), DYDA(6), DF(6)
				    A(1) = 3#: A(2) = 0.2: A(3) = 0.5: A(4) = 1#: A(5) = 0.7: A(6) = 0.3
				    Print Tab(6); "X   Y  DATA1  DATA2   DATA3   DATA4   DATA5   DATA6"
				    For I = 1 To NPT
				        X = 0.3 * I
				        Call FGAUSS(X, A(), Y, DYDA(), NA)
				        E1 = Exp(-((X - A(2)) / A(3)) ^ 2)
				        E2 = Exp(-((X - A(5)) / A(6)) ^ 2)
				        F = A(1) * E1 + A(4) * E2
				        DF(1) = E1
				        DF(4) = E2
				        DF(2) = A(1) * E1 * 2# * (X - A(2)) / (A(3) ^ 2)
				        DF(5) = A(4) * E2 * 2# * (X - A(5)) / (A(6) ^ 2)
				        DF(3) = A(1) * E1 * 2# * ((X - A(2)) ^ 2) / (A(3) ^ 3)
				        DF(6) = A(4) * E2 * 2# * ((X - A(5)) ^ 2) / (A(6) ^ 3)
				        Print Tab(5)
				        Print Tab(5); "from FGAUSS"
				        Print Tab(5)
				        Print Tab(3); Format(X, "##.##00"); Tab(13); Format$(Y, "##.##00");
				        For J = 1 To 6
				            Print Tab(21 + (J - 1) * 9); Format$(DYDA(J), "##.####");
				        Next J
				        Print Tab(5)
				        Print Tab(5); "independent calc."
				        Print Tab(5)
				        Print Tab(3); Format(X, "##.##00"); Tab(13); Format$(F, "##.##00");
				        For J = 1 To 6
				            Print Tab(21 + (J - 1) * 9); Format$(DF(J), "##.####");
				        Next J
				        Print
				    Next I
				End Sub			

相关资源