Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB MATLAB MATLAB Note: This problem is identical to the Gauss-Seidel method problem, except that you need to use the Jacobi method. Consider the linear

MATLAB MATLAB MATLAB

image text in transcribed

Note: This problem is identical to the Gauss-Seidel method problem, except that you need to use the Jacobi method. Consider the linear system A,=p, where A, is an nxn matrix with 2's on the main diagonal, -1's directly above and below the main diagonal and O's everywhere else. For example, 1 2 -1 0 0 0 1-1 2 -1 0 0 Az = 0 -12 -1 0 1 0 0 -1 2 -1 0 0 0 -1 2 This is a discretized version of Poisson's equation db(x) = p(x) dr? which appears very often in physical applications. We will discuss discretizations and differential equations, including the origin of the matrix A, later in the class. Construct the matrix A103 in Matlab. (You should be able to do this in only a few lines with the help of the diag command. In particular, you should figure out what the commands diag(v), diag(v, 1) and diag(v, -1) do when v is a vector.) Save your matrix in a variable named A In addition, construct the 103 x 1 vector p such that the th entry of p is defined according of the formula P;= 2(1 - cos 104) sin com Save this vector in a variable named rho. If you are particularly good with trigonometric identities, you can show that the exact solution to our problem is the 103 x 1 vector whose jth entry is defined according to the formula 0; = sin (377j Save this vector in a variable named phi. The Jacobi method for this problem can be written as o, = MOL-1+c. (Note that means the kth guess for and it is an entire vector. It does not mean the kth entry of o.) Find the largest in magnitude) eigenvalue of M and save the magnitude of this eigenvalue in a variable named ans 1. (Remember, you can use the abs function to find the magnitude of a number. Your answer should be a positive, real number.) Use the Jacobi method to solve for . Your initial guess should be a 103 x 1 vector of all ones, and you should use a tolerance of 10-5. That is, you should stop when - Dillo

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

Step: 3

blur-text-image

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago

Question

=+6 Who is the peer of the IA ?

Answered: 1 week ago

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago