Question
Gauss Seidel VBA 'Daniel Schmitt Option Base 1 Option Explicit Sub GaussSeidel() Dim A As Variant, b As Variant, x As Variant, MyRange As Variant
Gauss Seidel VBA
'Daniel Schmitt Option Base 1 Option Explicit
Sub GaussSeidel()
Dim A As Variant, b As Variant, x As Variant, MyRange As Variant Dim i As Integer, j As Integer, N As Integer, k As Integer Dim epsilon As Double, sum_aij As Double, sum_aijxj As Double Dim max_diff As Double, pre_xi As Double
A = Application.InputBox("Please select coefficient matrix", Type:=64) b = Application.InputBox("Please select constant vector", Type:=64) x = Application.InputBox("Please select 1st Trial", Type:=64)
'check if solution exists
'count how many rows for coeff matrix N = UBound(A, 1)
'Check if coeff matrix is diagonally dominant For i = 1 To N sum_aij = 0 For j = 1 To N ' ' ' Next If then MsgBox ("Coeff Matrix is not diagonally dominant") Exit Sub End If Next
'Do iteration k = 0 Do
k = k + 1 For i = 1 To N sum_aijxj = 0 For j = 1 To N 'Workout Sum of Aij*Xj Next 'Workout X(i) x(i,1)= 'Update Max_Diff If Then End If Loop While max_diff 100 Then MsgBox ("Something is wrong!") Exit Sub End If Loop
End Sub
I dont know how to fill in the blanks to make this VBA code work
D 10 10 0000 H x G 9776 3355 Fb E 5311 1113 C 1302 - 302-1 0243 AStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started