Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Gauss Seidel VBA \'Daniel Schmitt Option Base 1 Option Explicit Sub GaussSeidel(

ID: 3861290 • Letter: G

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
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 < 0.000001
  
  
If k > 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 A

Explanation / Answer

Tips for you:

1 Create a Macro: With Excel VBA you can automate tasks in Excel by writing so called macros. In this chapter, learn how to create a simple macro.

2 MsgBox: The MsgBox is a dialog box in Excel VBA you can use to inform the users of your program.

3 Workbook and Worksheet Object: Learn more about the Workbook and Worksheet object in Excel VBA.

4 Range Object: The Range object, which is the representation of a cell (or cells) on your worksheet, is the most important object of Excel VBA.

5 Variables: This chapter teaches you how to declare, initialize and display a variable in Excel VBA.

6 If Then Statement: Use the If Then statement in Excel VBA to execute code lines if a specific condition is met.

7 Loop: Looping is one of the most powerful programming techniques. A loop in Excel VBA enables you to loop through a range of cells with just a few codes lines.

8 Macro Errors: This chapter teaches you how to deal with macro errors in Excel.

9 String Manipulation: In this chapter, you'll find the most important functions to manipulate strings in Excel VBA.

10 Date and Time: Learn how to work with dates and times in Excel VBA.

11 Events: Events are actions performed by users which trigger Excel VBA to execute code.

12 Array: An array is a group of variables. In Excel VBA, you can refer to a specific variable (element) of an array by using the array name and the index number.

13 Function and Sub: In Excel VBA, a function can return a value while a sub cannot.

14 Application Object: The mother of all objects is Excel itself. We call it the Application object. The application object gives access to a lot of Excel related options.

15 ActiveX Controls: Learn how to create ActiveX controls such as command buttons, text boxes, list boxes etc.

16 Userform: This chapter teaches you how to create an Excel VBA Userform.