Question
Could someone explain these four promblems on matlab and if you do, could you write what you wrote on matlab I.e. on the command window or script. Also if you have written anything by hand can you write neatly. Also an explain of how you did it would be greatly appreciated.

1] 5 points) Write the following set of equations in Matrix form and use Matlab to find the solution. 50 -5x3-6x2 2x2 + 7x3-30 x1-7x3-50-3x2 + 5x1 [2] (10 points) Given the equations 2x1-6x2-x,--38 -3x1 x27x3-34 -8x1 +x2-2x3-20 Solve by Gaussian Elimination Using partial pivoting (show the steps by hand) 3] (10 points) Apply two iterations of the Newton Raphson Method to the following set of equations. Use initial guesses ofx =y= 1. Do all your work in MATLAB including defining the functions and their respective partial derivatives. Please show what the answer is after two iterations. Include all your code. [4] (15 points) a) Solve the following set of linear equations using a built-in MATLAB function. b) Show two iterations of the Gauss Siedel Method to solve the following system of linear equations. Show your calculations in MATLAB. What is the true initial guess of x2x30. Comment on what test you can do to make sure whether the algorithm will merge or not. percentage error after two iterations for x x2 and x.Use arn 10x1 + 2x2-x,-27 123 -3x 6x2 +2x3 43 x1 +x2+Sx3
0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;
%1)
%Define the system of equations
%Matrix A
A = [0 6 -5; %Coefficient of x1 = 0, x2 = 6, x3 = -5
0 2 7; %Coefficient of x1 = 0, x2 = 2, x3 = 7
-4 3 -7]; %Coefficient of x1 = -4, x2 = 3, x3 = -7

%Matrix b
b = [-50; -30; 50];

%find the solution using inverse A * b
x = A\b

Output:

MATLAB R2017a HOME PLOTS EDITOR lSearch Documentation Log In Find Files 凶Compare ▼ 연 Go To▼ Comment 1 96.aste New Open Save BreakpointsRun Run and Advance Run and Print ▼ Find Indent Advance Time FILE C. Program Filesト MATLAB R2017aトbin Command Window -17.0192 -9.6154 -1.5385 06:39 O Type here to search f ^ 4x ENG 22-10-2018 무

2)

clc;
%2)
%Define the matrices
A = [2 -6 -1;
-3 -1 7;
-8 1 -2];
b = [-38; -34; -20];

%create the augmented matrix A|B
Aug=[A b];
n=rank(A);
%initialize the nrow vector
for i=1:n
nrow(i)=i;
end
nrow=nrow';
for k=1:n-1
max=0;
index=0;
%find the maximum value in the column under the current checked element and
%return its row position
for j=k:n
if abs(Aug(nrow(j),k))>max
max=abs(Aug(nrow(j),k));
index=j;
end
end
%perform row exchange in the nrow vector
if nrow(k)~=nrow(index)
ncopy=nrow(k);
nrow(k)=nrow(index);
nrow(index)=ncopy;
  
else
  
end
%Gaussian elimination
for i=(k+1):n
m(nrow(i),k)=Aug(nrow(i),k)/Aug(nrow(k),k);

for j=k:n+1
Aug(nrow(i),j)=Aug(nrow(i),j)-m(nrow(i),k)*Aug(nrow(k),j);
end
  
end
end
%backward subsitution
x(n)=0;
x=x';
x(n)=Aug(nrow(n),n+1)/Aug(nrow(n),n);
i=n-1;
while i>0
x(i)=(Aug(nrow(i),n+1)-Aug(nrow(i),i+1:n)*x(i+1:n))/(Aug(nrow(i),i));
i=i-1;
end
x_soln=x
A_aug=Aug;

Output:

3)

Add a comment
Know the answer?
Add Answer to:
Could someone explain these four promblems on matlab and if you do, could you write what...
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
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