Question: 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

 I want these code to converted in PYTHON. it just aconversion don't make an excuse 1 question policy if u don't wantto answer please leave my question will refunded. #define n 3 //number of unknowns Remark: The following are the computer-generated results of Problem04 (computed with double precision arithmetic) using a self-written computer program for

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.

#define n 3 // number of unknowns Remark: The following are the computer-generated results of Problem 04 (computed with double precision arithmetic) using a self-written computer program for the Jacobi method. The error at kth iteration computed as the la norm of the difference of the two recent approximations, i.e. || xk) (-1 #define TOL 0.000001 // error tolerance Iteration 21 X I norm // maximum number # define N 200 of iterations 1 2 3 4 5 3.50000000 0.60714286 1.25071429 0.24821429 0.47696429 0.12258929 0.20265179 2.50000000 2.32142857 -1.23214286 2.91964286 2.53839286 3.12901786 2.99558036 9.64285714 7.46428571 10.83928571 10.07678571 11.25803571 10.99116071 11.40459821 10.55863125 6.03000575 3.60615085 2.11050201 1.26215280 0.73867570 0.44175343 int main { G 7 : 20 21 22 0.05498858 0.05504009 3.24168571 3.24159085 3.24173285 11.48319971 11.48346571 11.48340551 0.00047426 0.00028422 0.00016634 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; 0.05496029 : 38 39 0.05494506 0.05494506 0.0541506 -3.24175824 -3.24175823 3.24175824 11.48351646 11.48351648 0.00000004 0.00000002 0.00000001 40 cout #include using namespace std; for ( k=1 ;k #include using namespace std; 1.6 5.4 # define n 3 // number of unknowns Remark: The following are the computer-generated results of Problem 08 (computed with double precision arithmetic) using a self-written program for the Gauss-Seidel method. The error at kth iteration is computed as the lz norm of the difference of the two recent approximations, i.e. || (k) yk-1.2 #define TOL 0.000001 // error tolerance // maximum number X2 3.00000000 Iteration 1 2 3 # define N 200 of iterations # define WF 1.2 factor // over-relaxation 2 4.20000000 0.32365714 -0.04999680 0.02669976 0.05752179 0.05607953 0.0S501263 0.05489617 0.05493937 4 5 G 7 -2.66057143 -3.44332800 -3.28350040 -3.23853035 -3.23965411 -3.24168828 -3.24183118 -3.24175942 -3.24175633 3.24175763 3.2417525 -3.24175827 -3.24175824 3.24175824 8.43428571 11.62573714 11.62027666 11.49205072 11.47893364 11.48269850 11.48361473 11.48355942 11.48351702 11.48351482 11.48351629 11.48351653 11.48351650 11.48351648 11.48351648 I norm 9.98823420 7.56660195 0.86738396 0.21879012 0.05607460 0.00418535 0.00247297 0.00019247 0.00008648 0.00001483 0.00000203 0.00000079 0.00000004 0.00000001 0.00000000 int main() { 9 10 11 12 13 0.05494600 0.05494546 0.0549450 0.05494504 0.05494505 0.05494505 14 15 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} ; double x[n]; double xp[n], sum , err; // right-hand side constants // the solution vector //Computing 12 - norm sum = 0.0 ; for (i=0;i sum = 0; for(j=0; j> a[i]; cout> b[i]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!