numerical solution of a linear system through the use of the Gauss method without pivoting
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The linear system Ax = b is given, with A∈Rn × n and b∈Rn.Siaxc the numerical solution of the system obtained by the Gauss method without pivoting, the associated residual vector has the form r = b - A · xc. Remember that from the theory of conditioning we have that
∥x - xc∥ ≤ k (A) ∥r∥, (1) ∥x∥ ∥b∥
with k (A) conditioning number of A.
a) Write a function that, given A and b, calculates xc and returns: xc, the number of
conditioning of A, the norm of the residual vector and the upper limitation in (1), or k (A) ∥r∥.
∥b∥
b) Execute the function using the matrix A = (aij) ∈ Rn × n, with
aij = ij − 1, i, j = 1, ..., n,
known term b = A * (1.1 * ones (n, 1)) (by construction the linear system Ax = b has solution x = (1.1, 1.1, ..., 1.1) ⊤) and dimension n = 6, 7, 8, 9, 10.
Examine and interpret the results of the function and the relative error between the calculated solution and the exact one.
1 Kommentar
Benjamin Thompson
am 25 Mai 2022
Is there a MATLAB question here or are you just posting a homework assignment to the Community site? If you have a specific question about MATLAB please ask.
Antworten (1)
Saarthak Gupta
am 15 Dez. 2023
Bearbeitet: Saarthak Gupta
am 15 Dez. 2023
Hi Aurora,
I understand you need to use method of Gauss-Jordan elimination without pivoting to solve a system of linear equations.
Here is a brief step-by-step procedure for Gaussian elimination without pivoting:
1. Augmented Matrix: Write the system of linear equations as an augmented matrix.
2. Eliminate Downwards: Starting with the first column, use the element in the current row (the pivot) to eliminate all elements below the pivot in that column. This is done by subtracting a suitable multiple of the current row from the rows below.
3. Move to Next Row and Column: Shift to the next row and the next column to the right. Use the new pivot (the first non-zero element in the current row and column) to eliminate all elements below it.
4. Repeat: Repeat the elimination process for each row, moving from top to bottom and left to right, until you have zeros below all diagonal elements, creating an upper triangular matrix.
5. Back Substitution: Once the matrix is in upper triangular form, start from the last row and solve for the variables by back substitution, working upwards to the first row.
Please refer to the following MATLAB Answer for a simple implementation of Gauss Elimination without pivoting: https://www.mathworks.com/matlabcentral/answers/508662
The condition number of a matrix is a measure of its sensitivity to numerical errors and instability in solving systems of linear equations or inverting the matrix. It reflects how much the output value can change for a small change in the input. The condition number is a property of this matrix, not of the system of equations itself.
Depending on the norm you choose, condition number of a matrix is defined as:
cond(A) = ||A||*||A-1||
Alternatively, for Euclidean norm (or 2-norm), we can calculate the condition number as the ratio of the largest to the smallest singular value in the singular value decomposition (SVD) of the matrix.
Please refer to the following MATLAB documentation for further reference:
Hope this helps!
Best regards,
Saarthak
0 Kommentare
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!