GOAL: SOLVE FOR THE 6 CURRENTS IN THE CIRCUIT. Problem Description: Read chapter section 8.3 (Case Study) in the textbook. Perform the same computation for the circuit given in Figure P8.14 (in the Chapter 8 Problems section, and reproduced below), using Gauss Elimination with Partial Pivoting. Follow the assumed current directions shown in Figure 8.10 of the textbook. When converting your system of equations to a matrix equation, use the same {i} vector as in the case study: i=[i12, i52, i32, i65, i54, i43] ' Using a different algorithm -.- including, but not limited to, the "backslash" operator in MATLAB - . may result in no credit for your solution. function x=GaussPi vot(A,b) of GaussPivot: Gauss elimination pivoting of x Gaussivot (A,b) : Gauss elimination with pivoting. & input: & A= coefficient matrix of b= right hand side vector output: s x= solution vector [m,n]=size(A); if m∼n, error('Matrix A must be square'); end nb=n+1; Aug =[[A,b]]; forward elimination for k=1:n-1 % partial pivoting [big,i]=max(abs(Aug(k:n,k))); ipr =i+k-1; if ipr ∼=k Aug([k,1pr],:)=Aug([ipr,k],:); end for i=k+1:n factor =Aug(i,k)/(A)ug(k,k); Aug(i,k:nb)=Aug(i,k:nb)-factor**Aug(k,k:nb); end end & back substitution x=zeros(n,1); x(n)=Aug(n,nb)/(A)ug(n,n); for i=n-1:-1:1 x(i)=(Aug(i,nb)-Aug(i,i+1:n)**x(i+1:n))/(A)ug(i,i); end Problem Description: Read chapter section 8.3(Case Study in the textbook. Perform the same computation for the circuit given in Figure P8.14 in the Chapter 8 Problems section, and reproduced below, using Gauss Elimination with Partial Pivoting. R=20 Ω 2 R=10 Ω OV=150 volts R=2 Ω R=5 Ω R=5 Ω R=25 Ω OV=0 volts Follow the assumed current directions shown in Figure 8.10 of the textbook. When converting your system of equations to a matrix equation, use the same {} vector as in the case study: i=[i12, i52, i32, i65, i54, i43] Using a different algorithm --- including, but not limited to, the "backslash" operator in MATLAB --- may result in no credit for your solution. function x = GaussPivot(A,b) GaussPivot: Gauss elimination pivoting x = GaussPivot(A,b): Gauss elimination with pivoting. input: A = coefficient matrix b = right hand side vector output: x = solution vector [m,n]=size(A); if m=n, error('Matrix A must be square'); end nb=n+1; Aug=[A,b]; % forward elimination for k=1:n-1 % partial pivoting [big,i]=max(abs(Aug(k:n,k)); ipr=i+k-1; if ipr=k Aug([k,ipr],:)=Aug([ipr,k],:); end for i=k+1:n factor=Aug(i,k)/Aug(k,k); Aug(i,k:nb)=Aug(i,k:nb)-factor*Aug(k,k:nb); end end % back substitution x=zeros(n,1); x(n)=Aug(n,nb)/Aug(n,n); for i=n-1:-1:1 x(i)=(Aug(i,nb)-Aug(i,i+1:n)*x(i+1:n))/Aug(i,i); end