Question

Use Matlab to compute the first 10 iterates with Jacobi Method for equations u + 4v...

Use Matlab to compute the first 10 iterates with Jacobi Method for equations

u + 4v = 5

v + 2w = 2

4u + 3w = 0

Homework Answers

Answer #1

Code

a=[4 0 3;1 4 0;0 1 2]

b=[0;5;2]

x=[0;0;0]

y=x;

for k=1:10

disp('iteration')

disp(k)

x

for i=1:3

y(i)=b(i);

for j=1:3

if i==j

y(i)=y(i);

else

y(i)=y(i)-a(i,j)*x(j);

end

end

y(i)=(1/a(i,i))*y(i);

end

x=y;

end

Output

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Matlab: Solve the following set of simultaneous equations. Remember, the system cannot be solved if the...
Matlab: Solve the following set of simultaneous equations. Remember, the system cannot be solved if the determinant of the coefficient matrix is zero. Use if statements to only display the results if the determinant is not zero a) 3x1 + 2x2 + 4x3 = 5 2x1 + 5x2 + 3x3 = 17 7x1 + 2x2 + 2x3 = 11 b) x – y – z = 0 30x + 40y = 12 30x + 50z = 12 c) 4x +...
In Problems 17-20 use determinants to decide whether the system has (a) a unique solution or...
In Problems 17-20 use determinants to decide whether the system has (a) a unique solution or (b) either no solution or infinitely many solutions. Do not solve the system. 17. 3x − 4y = 7 x + 2y = -4 20. 4u + 2v + 4w = 2 2u + v + 2w = 1 3u - 4v + w = -5
Use a matrix method to find the relationship between the constants a and b for which...
Use a matrix method to find the relationship between the constants a and b for which the system of equations u + 2v + 3w = a, u − v + w = 1, 2u + v + 4w = b has solutions. When a and b satisfy this relationship, find all of the solutions to this system in terms of a and write your answer in vector form?
I) Use MATLAB to compute the determinants of the following two matrices.   (Use format rat) P                         &
I) Use MATLAB to compute the determinants of the following two matrices.   (Use format rat) P                                         Q 5 0 0 0 -1 -1 1 1 13 2 0 0 2 0 1 3 -6 4 -1 0 2 -1 1 2 10 0 3 -2 1 0 3 3 II) The determinant of P could be computed without MATLAB. What general fact could have been used to do this? III) Use MATLAB to compute the matrix R= PQ and also...
Use MATLAB to determine the intersection point for the sets of equations shown below. Use the...
Use MATLAB to determine the intersection point for the sets of equations shown below. Use the backslash when possible. Graph the equations with different colors, and plot the intersection point with a red star marker. If the equations do not intersect, graph them anyway. Include a legend. cannot use 'ezplot' or 'solve' b) -4(x1)+(2(x2))^3=10 x1+x2=-8
To compute the integral ∫cos3(x)esin(x)dx, we should use first the substitution u= __________ to obtain the...
To compute the integral ∫cos3(x)esin(x)dx, we should use first the substitution u= __________ to obtain the integral ∫F(u)du, where F(u)= __________ To compute the integral ∫F(u)du, we use the method of integration by parts with f(u)= __________ and g′(u)= __________ to get ∫F(u)du=G(u)−∫H(u)du , where G(u)= __________ and H(u)= __________ Now, to compute the integral ∫H(u)du, we need to use the method of integration by parts a second time with f(u)= __________ and g′(u)= __________ to get ∫H(u)du= __________ +C...
Use Steffensen’s method with ?0 = 2 to compute an approximation to √5 accurate to within...
Use Steffensen’s method with ?0 = 2 to compute an approximation to √5 accurate to within 10−2.
Use the Bisection Method to locate all solutions of the following equations. Sketch the function by...
Use the Bisection Method to locate all solutions of the following equations. Sketch the function by using Matlab’s plot command and identify three intervals of length one that contain a root. Then find the roots to six correct decimal places. (a) 2x3 − 6x − 1 = 0 (b) ex−2 + x3 − x = 0 (c) 1 + 5x − 6x3 − e2x = 0 **MUST BE DONE IN MATLAB AND NEEDS CODE
Use the given transformation to evaluate the integral. (15x + 15y) dA R , where R...
Use the given transformation to evaluate the integral. (15x + 15y) dA R , where R is the parallelogram with vertices (−1, 4), (1, −4), (2, −3), and (0, 5) ; x = 1 5 (u + v), y = 1 5 (v − 4u)
Partial differential equations Solve using the method of characteristics ut +1/2 ux + 3/2 vx =...
Partial differential equations Solve using the method of characteristics ut +1/2 ux + 3/2 vx = 0 , u(x,0) =cos(2x) vt + 3/2 ux + 1/2 vx = 0 , v(x,0) = sin(2x)