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

源代码在线查看: d9r1.txt

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

相关代码

				Private Sub Command1_Click()
				    'PROGRAM D9R1
				    'Driver for routine FIT
				    NPT = 100
				    SPREAD = 0.5
				    Dim X(100), Y(100), SIG(100)
				    IDUM& = -117
				    For I = 1 To NPT
				        X(I) = 0.1 * I
				        Y(I) = -2# * X(I) + 1# + SPREAD * GASDEV(IDUM&)
				        SIG(I) = SPREAD
				    Next
				    For MWT = 0 To 1
				        Call FIT(X(), Y(), NPT, SIG(), MWT, A, B, SIGA, SIGB, CHI2, Q)
				        If MWT = 0 Then
				            Print
				            Print Tab(5); "Ignoring standard deviation"
				            Print
				        Else
				            Print
				            Print Tab(5); "Including standard deviation"
				            Print
				        End If
				        Print Tab(5); "A =  "; Format$(A, "##.#####0"),
				        Print "Uncertainty: "; Format$(SIGA, "##.#####0")
				        Print
				        Print Tab(5); "B = "; Format$(B, "##.#####0"),
				        Print "Uncertainty: "; Format$(SIGB, "##.#####0")
				        Print
				        Print Tab(5); "Chi-squared:  "; Format$(CHI2, "##.#####0")
				        Print
				        Print Tab(5); "Goodness-of-fit:  "; Format$(Q, "##.000000")
				    Next MWT
				End Sub			

相关资源