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
icon
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)

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 =
=
"First function":
a=[ 1 2 -2; 2 3 1 ;3 2 -4 ]
b=[9 23 11]
if size (b,1)
b = b';
end
[r,c]
if r ~= c
error('Matrix A must be square')
[a b];
for j = 1:r-1
for i = j+1:r
=
size(a);
ab(i, :)
end
end
x = zeros(r,1);
x(r)
for i r-1:-1:1
(ab (i, c+1)
x(i)
end
disp(x)
=
== 1
=
1
0
1
ab(i, :)
cos(0)
sin(0)
0
0
-cos(0)
-sin(0)
-
FAC
-
A
A 0
RAX RAY
ab(r,c+1)/ab(r,c);
Ө
FAC
FAB
0
0
1
0
0
1 0
0
0 0 0
0 0
1
cos(0)
sin(0)
cos(6)
-sin(0) 0 0 0
0 0 0
C
10 kN
Ꮎ
Ax = b ⇒
FAB
FAC
FBC
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.
RAY
RAX
RB
FBC
FBC
FAB
end
if r ~= size (b,1)
error('Matrix A and Vector B have incompatible dimensions')
е в
مه
0
·[1].
0
10
(ab(i,j)/ab(j,j))*ab(j, :);
FAB
FAC
FBC
RAY
RAX
RB
5
-7.07
-7.07
5
0
5
sum (ab(i,i+1:c)*x(i+1:c)))/ab(i,i);
Transcribed Image Text: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 = = "First function": a=[ 1 2 -2; 2 3 1 ;3 2 -4 ] b=[9 23 11] if size (b,1) b = b'; end [r,c] if r ~= c error('Matrix A must be square') [a b]; for j = 1:r-1 for i = j+1:r = size(a); ab(i, :) end end x = zeros(r,1); x(r) for i r-1:-1:1 (ab (i, c+1) x(i) end disp(x) = == 1 = 1 0 1 ab(i, :) cos(0) sin(0) 0 0 -cos(0) -sin(0) - FAC - A A 0 RAX RAY ab(r,c+1)/ab(r,c); Ө FAC FAB 0 0 1 0 0 1 0 0 0 0 0 0 0 1 cos(0) sin(0) cos(6) -sin(0) 0 0 0 0 0 0 C 10 kN Ꮎ Ax = b ⇒ FAB FAC FBC 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. RAY RAX RB FBC FBC FAB end if r ~= size (b,1) error('Matrix A and Vector B have incompatible dimensions') е в مه 0 ·[1]. 0 10 (ab(i,j)/ab(j,j))*ab(j, :); FAB FAC FBC RAY RAX RB 5 -7.07 -7.07 5 0 5 sum (ab(i,i+1:c)*x(i+1:c)))/ab(i,i);
Expert Solution
steps

Step by step

Solved in 7 steps with 1 images

Blurred answer
Knowledge Booster
Polynomial time
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education