cout
I want these code to converted in PYTHON. it just a conversion don't make an excuse 1 question policy if u don't want to answer please leave my question will refunded.
Question 25: Write a C++ program to solve the following linear system using the Jacobi method. Take initial approximate solution as: x(0) = [0, 0, 0]". The iterations of the method should stop when either the approximation is accurate within 10-6, or the number of iterations exceeds 200, whichever happens first. 0.4x + 0.12.x 1.4 0.64x2 + 0.32x3 = 1.6 0.12.x + 0.32x2 + 0.56x3 = 5.4 #include
#include using namespace std; #define n 3 Il number of unknowns #define TOL 0.000001 #define N 200 // error tolerance // maximum number of iterations int main() { int i, j, k; double a[n][n] = {{0.4, 0, 0.12}, {0, 0.64, 0.32}, {0.12, 0.32, 0.56}}; // coefficient matrix double b[n] = {1.4, 1.6, 5.4} ; // right-hand side constants double x[n]; // the solution vector double xp[n], sum , err; Question 27: Write a C++ program to solve the following linear system using the Gauss Seidel method with over relaxation (the SOR method). Take initial approximate solution as: X(1 [0, 0, 0]" and over relaxation factor as 1.2. The iterations of the method should stop when either the approximation is accurate within 10-, or the number of iterations exceeds 200, whichever happens first. 0.4x + 0.12.x, 1.4 0.64x2 + 0.32x - 1.6 0.12.x 0.32x2 + 0.56x3 = 5.4 + #include #include