numerical_methods.systems package¶
Submodules¶
numerical_methods.systems.decomposition_LU module¶
- numerical_methods.systems.decomposition_LU.lu_decomposition(A: list[list[float]], b: list[float], n: int) None[source]¶
Perform LU decomposition of matrix A and solve the system AX = b.
- Parameters:
A (list[list[float]]) – Coefficient matrix.
b (list[float]) – Right-hand side vector.
n (int) – Size of the system.
- Returns:
None
numerical_methods.systems.jacobi module¶
- numerical_methods.systems.jacobi.jacobi_method(A: list[list[float]], b: list[float], n: int, num_iterations: int, x_init: list[float]) list[float][source]¶
Solve a linear system using the Jacobi iterative method.
- Parameters:
A (list[list[float]]) – Coefficient matrix of size n x n.
b (list[float]) – Right-hand side vector.
n (int) – Size of the system (number of equations).
num_iterations (int) – Number of iterations to perform.
x_init (list[float]) – Initial guess for the solution vector.
- Returns:
The approximated solution vector after iterations.
- Return type:
list[float]
- Example:
>>> A = [[4, -1, 0], [-1, 4, -1], [0, -1, 3]] >>> b = [15, 10, 10] >>> x_init = [0, 0, 0] >>> jacobi_method(A, b, 3, 10, x_init) [3.75, 4.375, 4.7917] # Approximated output
numerical_methods.systems.triongulation_partiel module¶
- numerical_methods.systems.triongulation_partiel.partial_pivoting_elimination(A: list[list[float]], b: list[float], n: int) None[source]¶
Perform Gaussian elimination with partial pivoting.
- Parameters:
A (list[list[float]]) – Coefficient matrix of size n x n.
b (list[float]) – Right-hand side vector.
n (int) – Size of the system.
- Returns:
None (modifies A and b in-place).
This function modifies matrix A and vector b to transform A into an upper triangular matrix.
numerical_methods.systems.triongulation_total module¶
- numerical_methods.systems.triongulation_total.full_pivoting_elimination(A: list[list[float]], b: list[float], n: int) None[source]¶
Perform Gaussian elimination with full pivoting.
- Parameters:
A (list[list[float]]) – Coefficient matrix of size n x n.
b (list[float]) – Right-hand side vector.
n (int) – Size of the system.
- Returns:
None (modifies A and b in-place).