Solve in Matlab and show all steps as well as solving each question asked please. Thanks
Learn how to solve linear systems using the following methods: o MATLAB left division (Gauss elimination) o LU Factorization o Gauss-Seidel Iteration Learn how to test for round off error problems. . INSTRUCTIONS: Write a single MATLAB m-file that solves all problems below. For each problem, write the requested answers to ASCII data files with the exact filenames specified (e.g. "A3.dat"). Submit a printout of your main m-file and all associated m-files me for grading by the due date. For the data files you generate (e.g. "Al.dat"), submit those to me in an email! (This will save on paper.)Your entire assignment should run, generating all of the required data files, by typing the name of the main m-file at the command prompt. Consider the electric circuit shown below: V4 R7 V2 R6 R8 R1 12 R3 V1 R4 R5 V3 By applying Kirchoff's Laws and Ohm's law, the currents I,. /2, Is, and I, can be solved for with the following linear system: The resistors and voltages have the valoes given in the table belows Resistor Value (2) 150 1000 15000 3000 500 2000 100 80 Variable -40 60 R2 R4 Rs R6 V1 V4 Work by hand to write this system of linear equations in standard matrix form Ax b where x is the column vector of the four unknown currents (i, 12, 13, and /4) and all of the values on the diagonal of A are positive. Calculate the 2-norm condition number of the coefficient matrix A. Note that this step is intended as a check to make sure you have formulated A correctly in addition to giving an indication of the roundoff error potential a) b) Varying V2 from 0 to 120 in increments of 0.5, calculate , 12,13, and I4 using left division. Save your results in a matrix of 4 columns (results for 11, 12, 13s and 14 respectively) and 241 rows. c) Repeat the calculation for part (b) using LU factorization to increase the efficiency of the calculation. Also, for each value of V2, save the intermediate solution (the d vector resulting from the forward substitution step) as a row in a 241x4 matrix for submission to Scorelator Consider timing sections of your code using the tic and toc commands to measure the computational efficiency gained by using LU factorization. ANSWERS: Write your result for the condition number (1x1) to Al.dat. Write your current results (241x4) for parts (b) and (c) to A2.dat and A3.dat respectively. Write your matrix of intermediate d vectors (241 x4) to A4.dat