3. Modify your first user-defined function as Gauss_alt_pivot. Add a condition in the elimination phase, which will exchange the lines that have pivot multiplier equal to zero with a line with nonzero pivot multiplier. Confirm that your algorithm works with the following truss example shown in the lecture slides, note that 0=45deg, see slides (10-16). Linear Algebraic Systems - Example 1 end ab for j "First function": a= [ 1 2 -2; 2 3 1 ;3 2 -4 ] b=[9 23 11] if size (b,1) b = b'; = end end = [a b]; = == 1 end [r, c] if r ~= c error('Matrix A must be square') size(a); = 1:r-1 j+1:r = 100000 = cos(8) sin(8) 0 X = zeros(r, 1); x(r) for i = r-1:-1:1 x(i) end disp(x) A RAX RAY OLOOOO FAC 0 1 0 0 cos(0) 0 0 0 0 0 0 0 0 1 ab (r,c+1)/ab(r,c); 0 sin(8) -cos(0) cos(0) 0 0 0 -sin(0) -sin(8) 0 0 0 FAB 1. Create a user-defined MatLab function that implements the Gauss elimination method called Gauss_alt. The input arguments would matrix [a] and [b] from linear algebra ([a]*[x]=[b]) and the output [x]. If the input argument [b] is a row vector, the function should be able to transform it to a column vector. Use the augmented matrix for [ab] for all operations in the function. Solve the following set of equations by hand (explain the steps you are following): x₁ + 2x₂ - 2x₂ =9 2x₁ +3x₂ +x₂ = 23 3x₁ + 2x₂ - 4x₂ = 11 Use the function Gauss_alt to validate your hand-calculated solution. Ө FAC C 10 kN Ө Ax= b ⇒ FAB FAC FBC RAY RAX RB end if r ~= size(b, 1) error('Matrix A and Vector B have incompatible dimensions') for i ab(i,:) = ab(i,:) - (ab(i,j)/ab(j,j))* ab(j, :); FBC FBC 0 FAB -[1]- 0 10 B RB FAB FAC FBC RAY RAX RB 5 -7.07 -7.07 5 0 5 297 (ab(i,c+1) - sum(ab(i,i+1: c) *x(i+1:c)))/ab(i,i);
3. Modify your first user-defined function as Gauss_alt_pivot. Add a condition in the elimination phase, which will exchange the lines that have pivot multiplier equal to zero with a line with nonzero pivot multiplier. Confirm that your algorithm works with the following truss example shown in the lecture slides, note that 0=45deg, see slides (10-16). Linear Algebraic Systems - Example 1 end ab for j "First function": a= [ 1 2 -2; 2 3 1 ;3 2 -4 ] b=[9 23 11] if size (b,1) b = b'; = end end = [a b]; = == 1 end [r, c] if r ~= c error('Matrix A must be square') size(a); = 1:r-1 j+1:r = 100000 = cos(8) sin(8) 0 X = zeros(r, 1); x(r) for i = r-1:-1:1 x(i) end disp(x) A RAX RAY OLOOOO FAC 0 1 0 0 cos(0) 0 0 0 0 0 0 0 0 1 ab (r,c+1)/ab(r,c); 0 sin(8) -cos(0) cos(0) 0 0 0 -sin(0) -sin(8) 0 0 0 FAB 1. Create a user-defined MatLab function that implements the Gauss elimination method called Gauss_alt. The input arguments would matrix [a] and [b] from linear algebra ([a]*[x]=[b]) and the output [x]. If the input argument [b] is a row vector, the function should be able to transform it to a column vector. Use the augmented matrix for [ab] for all operations in the function. Solve the following set of equations by hand (explain the steps you are following): x₁ + 2x₂ - 2x₂ =9 2x₁ +3x₂ +x₂ = 23 3x₁ + 2x₂ - 4x₂ = 11 Use the function Gauss_alt to validate your hand-calculated solution. Ө FAC C 10 kN Ө Ax= b ⇒ FAB FAC FBC RAY RAX RB end if r ~= size(b, 1) error('Matrix A and Vector B have incompatible dimensions') for i ab(i,:) = ab(i,:) - (ab(i,j)/ab(j,j))* ab(j, :); FBC FBC 0 FAB -[1]- 0 10 B RB FAB FAC FBC RAY RAX RB 5 -7.07 -7.07 5 0 5 297 (ab(i,c+1) - sum(ab(i,i+1: c) *x(i+1:c)))/ab(i,i);
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
The "problem 1 " and its function just the supplement to the "problem 3", you only need to solve the "problem 3".The title of "question 3" requires modification of the previous function ( "first function" in problem 1)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 7 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education