Question: By using Matlab Create a function jc.m that computes the solution of [A] {x} = {b} using the Jacobi method with relaxation. - x =
By using Matlab
Create a function jc.m that computes the solution of [A] {x} = {b} using the Jacobi method with relaxation.
- x = function jc (A, B, x0, lambda, es, maxit)
- x0 is the initial vector of x to apply the Jacobi method.
- lambda is the lambda value for applying relaxation. ( 0 < ? <= 2)
- Output the result to jacobi_output.txt for each iteration.
- Demonstrate in the report that the results are the same as the results obtained by hand until the third iteration.
- Write a program to stop if the stopping condition is ea less than es or if iteration is less than maxit.
For Example:
A = [10 0.4 0.6; 0.2 8 0.3; 0.7 0.2 9];
b = [5;7;4];
x0=[0;0;0];
x=jc(A,b,x0,0.5,0.05,100)
x =
0.442569499354694
0.848919166123933
0.391137158570143
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
