Question

6 5 - x € 4 CS3010_HW1_Wl15.pdf x + V 7 0 0 file:///C:/Users/Jean/Downloads/CS3010_HW1_W115.pdf of 11 | = Contents o - + Q Fi6 5 - x € 10 CS3010_HW1_Wl15.pdf x + V 7 0 0 file:///C:/Users/Jean/Downloads/CS3010_HW1_W115.pdf of 11 | = Contents o - + O F6 5 - x o < 11 CS3010_HW1_Wl15.pdf x + V file:///C:/Users/Jean/Downloads/C5301_HWI_W115.pdf | 3 Contents o of 11 — + O Fit toThe exercise given above must be done using Gauss Seidel. This must contain an input and an output. The exercise that is given must be done using the method of Gauss Seidel. It must be tested with matlab. It must contain the input and output.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
format long
A=[1,2,-1,1;-1,-2,-3,2;2,1,-1,-5;1,1,1,1];
b=[5;7;-1;10];
x=gauss_seidel(A,b,[11.6;-5;0;3],1e-4,100)
function x = gauss_seidel(A,d,x0,tol,Imax)
% gauss_seidel: implements the Jacobi iterative method
% for solving a system of linear equations.
% Input: A = square coefficient matrix (nxn)
% d = right hand side vector (nx1)
% x0 = initial guess (nx1) (default = zeros)
% tol = stop criterion (default = 10^-6)
% Imax = maximum iterations (default = 100)
% Output: Solution vector.
if nargin<5, Imax=100; end
if nargin<4, tol=10^-6; end
[m,n]=size(A);
if m~=n, error('Matrix A must be square'); end
if nargin<3, x=zeros(n,1); else x=x0; end
C=A;
for i=1:n
C(i,i)=0;
end
for i=1:n
C(i,1:n)=C(i,1:n)/A(i,i);
end
b=zeros(1,n);
for i=1:n
b(i)=d(i)/A(i,i);
end
iter=0;
while true
x_old=x;
for i=1:n
x(i)=b(i)-C(i,:)*x;
if x(i)~=0
err(i)=abs((x(i)-x_old(i))/x(i));
end
end
iter=iter+1;
if iter>=Imax || norm((x-x_old)./x)<tol
fprintf('Total Iterations are: %d\n',iter);
return
end
end
end

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
The exercise given above must be done using Gauss Seidel. This must contain an input and...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • must be done in MATLAB 2. Create a main program that calls the subroutine created on problem 1 and compare resu...

    must be done in MATLAB 2. Create a main program that calls the subroutine created on problem 1 and compare results using the following data sets: b. (1 5), (0, 8), (3, -10) С. (-10,-2). ( 4,5), (7, 3), (12, 20) Output: (copy and paste the output in the following box) Use MATLAB or Scilab to solve the following problems 1. Create a MATLAB subroutine called Lagrange.m that receives two set data points, x and y and plots the curve...

  • please explain answer for 37,38 V - x a Sound Waves, Intensity leve c Get Homework...

    please explain answer for 37,38 V - x a Sound Waves, Intensity leve c Get Homework Help With C Dashboard Files 3C_week_3-F_slides 1214 X + E > 0 O file:///C:/Users/salma/AppData/local/Packages/Microsoft. Microsoft Edge_Bwekyb3d3bbwe/TempState/Downloads/3c_week_3-F_slides%20(2).pdf 7 of 11 lo - + Fit to page Page View All read aloud Add notes Consider a transverse wave on a string. You are given the graph of position vs. time for a single location on the string. What is the wave's wavelength? period? m. -t(s) A)...

  • Please complete only F, H, and J only. step by step clearly. please follow the questions. also ty...

    please complete only F, H, and J only. step by step clearly. please follow the questions. also type any codes you used. 100 Consider the following LTI system, where, Q = 5, and wo 200π rad. /sec. a) Use MATLAB to determine magnitude response and phase response of the filter b) What type of filter is it? c) What will be the output of this filter if input x,(t)-5Cos(100t). Show all calculations step by step as shown in Lecture-20 d)...

  • 100 Consider the following LTI system, 5, and wo = 2000π rad/sec. where, Q a) Use MATLAB to deter...

    please complete this project. 100 Consider the following LTI system, 5, and wo = 2000π rad/sec. where, Q a) Use MATLAB to determine magnitude response and phase response of the filter b) What type of filter is it? c) What will be the output of this filter if input x,(t)-5Cos(100t). Show all calculations step by step as shown in Lecture-20 d) Verify your answer of part (e) by using Simulink model. Attach the snapshot of Simulink model and output e)...

  • a Week 5 - DNA structure. 20 205 Week 5 DNA mode x C Get Homework...

    a Week 5 - DNA structure. 20 205 Week 5 DNA mode x C Get Homework Help With C + v € → 0 A file:///C:/Users/megan/AppData/Local/Packages/Microsoft.Microsoft Edge awekyb3dBbbwe/TempState/Downloads/20S%20Week%20S%20DNA%20model%20images%20(1).pdf | 2 of lo - + Q anillo pare D Page view A Rand aloud Add notes Type here to search A . 1:16 PM 3/30/2020 G 6 Week 5 - DNA structure qu: 205 Week 5 DNA model im. Get Homework Help With C Exercise 2 DNA Isolatice x + V...

  • tv - x 6 + 2 5 Homework Assignment x B pdf.pdf pdf-1.pdf → 0 0...

    tv - x 6 + 2 5 Homework Assignment x B pdf.pdf pdf-1.pdf → 0 0 file:///C:/Users/ayesha/Documents/HRM/Homework%20Assignment%201.pdf of 6 lo – + O Fit to page CD Page view A Read aloud L Add notes 6 H EB 6 4. (15 pts) Consider the three stocks in the following table. Pt represents price at time t, and Qt represents shares outstanding at time t. Stock C splits two-for-one in the last period. PO QOPQiP2Q2 $90 100 $95 100 $95 100...

  • Question is above picture. 5. Assume the seven projects were not mutually exclusive and you were...

    Question is above picture. 5. Assume the seven projects were not mutually exclusive and you were faced with a budget constraint that allowed you to pick only two. Which two projects would appear at the top of your preferred list? Why? 5 5 + - E New tab → 0 Career: D O Course R HW 1 X Syllabus GOECD ILI GOECD iLit Field Cha Online Bc C Three ML c Get Hom 0 file:///C:/Users/bwjon/AppData/Local/Packages/Microsoft. MicrosoftEdge_3wekyb3d8bbwe/Tempstate/Downloads/HW%201%20APEC%205950%20(3).pdf ☆ B ... Find...

  • CODE THE FOLLOWING FUNCTIONS IN JAVASCRIPT (USE OF THE ABOVE MENTIONED IN BUILT FUNCTIONS IS NOT...

    CODE THE FOLLOWING FUNCTIONS IN JAVASCRIPT (USE OF THE ABOVE MENTIONED IN BUILT FUNCTIONS IS NOT ALLOWED) Write a function that accepts an array as argument. The function should loop through the array elements and accumulate the sum of ASCII value of each character in element and return the total. For example: function([‘A’, ‘bc’, 12]); // returns 361 which is the sum of 65 + 98 + 99 + 49 + 50 Write a function that accepts two arguments (a...

  • 6 5 D Group Assignment -Se D PGBLAR 2017_Website D PetGas_AR 2018_1.pdf PetGas_AR 2018_2.pdf Malaysia Tax...

    6 5 D Group Assignment -Se D PGBLAR 2017_Website D PetGas_AR 2018_1.pdf PetGas_AR 2018_2.pdf Malaysia Tax Incentives Individual Assignm x + V E 0 file:///C:/Users/asus/Desktop/Individual%20Assignment-Sept%202019.pdf → of 2 0 O – + D Fit to page 9 Page view A Read aloud Add notes 6 H ACCT2412 TAXATION II INDIVIDUAL ASSIGNMENT SEPTEMBER/OCTOBER SEMESTER 2019 SUBMISSION DATE : 17.1.2020 Objective: CLO3: To evaluate the impact of tax reliefs and incentives provided to Malaysia Question 1 Tenaga Sdn Bhd (TSB), a manufacturing...

  • THE ATTACHMENTS:( needed to solve the problem above) (1) My Morse Code Program: #03/22/2018 #Creating a...

    THE ATTACHMENTS:( needed to solve the problem above) (1) My Morse Code Program: #03/22/2018 #Creating a program that translates sentences in to morse code def main():    morsecode_dict={}    line=""   f1 = open("MorseCode.txt",'r');    content = f1.readlines()    for x in content: #print x x=x.split() my_dict[x[0]]=x[1] print (morsecode_dict)    val=raw_input("Enter a String value: ") val.upper() output=""    for i in val: print (i.upper()) if(i!=' '): output = output + morsecode_dict[i.upper()]+' ' else: output = output+'\n' print ("-----Morse Code of The...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT