Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

cout

image text in transcribed

image text in transcribed

image text in transcribed

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 using namespace std; #define n 3 #define TOL 0.000001 #define N 200 #define WF 1.2 1/ number of unknowns 11 error tolerance // maximum number of iterations 11 over-relaxation factor int main() { inti..ki double a[n[n] = {{0.4,0,0.12}, {0.0.64, 0.32}, {0.12, 0.32, 0.56}} :// coefficient matrix double bin) = (1.4, 1.6, 5.4); 1/ right-hand side constants double x[n]: // the solution vector double xpin). sum, err; cout> a[i][j] : cout> b[i]; 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 using namespace std; #define n 3 #define TOL 0.000001 #define N 200 #define WF 1.2 1/ number of unknowns 11 error tolerance // maximum number of iterations 11 over-relaxation factor int main() { inti..ki double a[n[n] = {{0.4,0,0.12}, {0.0.64, 0.32}, {0.12, 0.32, 0.56}} :// coefficient matrix double bin) = (1.4, 1.6, 5.4); 1/ right-hand side constants double x[n]: // the solution vector double xpin). sum, err; cout> a[i][j] : cout> b[i]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago