Linear Algebra. Solving SLEs with Matlab. Matrix Inversion. Solving SLE s by Matlab - Inverse. Solving Simultaneous Linear Equations in MATLAB

Similar documents
M 340L CS Homework Set 1

Row Reduction and Echelon Forms

Chapter 8: Linear Algebraic Equations

Chapter 8 Linear Algebraic Equations

LU Factorization. A m x n matrix A admits an LU factorization if it can be written in the form of A = LU

MATH 152 Exam 1-Solutions 135 pts. Write your answers on separate paper. You do not need to copy the questions. Show your work!!!

Solutions of Linear system, vector and matrix equation

Solution Set 3, Fall '12

Handout 1 EXAMPLES OF SOLVING SYSTEMS OF LINEAR EQUATIONS

Introduction to Mathematical Programming

Linear Algebra I Lecture 10

Linear Equations in Linear Algebra

CSL361 Problem set 4: Basic linear algebra

Linear Equations in Linear Algebra

Matrices and Determinants

Quiz ) Locate your 1 st order neighbors. 1) Simplify. Name Hometown. Name Hometown. Name Hometown.

Lecture 2 Systems of Linear Equations and Matrices, Continued

Lecture 1 Systems of Linear Equations and Matrices

Math Linear Algebra Final Exam Review Sheet

Sections 1.5, 1.7. Ma 322 Fall Ma 322. Sept

Solutions to Exam I MATH 304, section 6

Sections 1.5, 1.7. Ma 322 Spring Ma 322. Jan 24-28

Matrix Factorization Reading: Lay 2.5

33A Linear Algebra and Applications: Practice Final Exam - Solutions

Linear Algebra Practice Problems

MA 242 LINEAR ALGEBRA C1, Solutions to First Midterm Exam

18.06 Problem Set 3 - Solutions Due Wednesday, 26 September 2007 at 4 pm in

Eigenvalues, Eigenvectors. Eigenvalues and eigenvector will be fundamentally related to the nature of the solutions of state space systems.

MATH 2050 Assignment 6 Fall 2018 Due: Thursday, November 1. x + y + 2z = 2 x + y + z = c 4x + 2z = 2

MATH 2331 Linear Algebra. Section 2.1 Matrix Operations. Definition: A : m n, B : n p. Example: Compute AB, if possible.

3.4 Elementary Matrices and Matrix Inverse

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

Math 22AL Lab #4. 1 Objectives. 2 Header. 0.1 Notes

Chapter 16 Numerical Linear Algebra

Math 415 Exam I. Name: Student ID: Calculators, books and notes are not allowed!

Linear Systems of Differential Equations

Scientific Computing: Dense Linear Systems

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Linear Equation: a 1 x 1 + a 2 x a n x n = b. x 1, x 2,..., x n : variables or unknowns

Linear Systems of n equations for n unknowns

MATH 167: APPLIED LINEAR ALGEBRA Chapter 2

Solution Set 4, Fall 12

ENGINEERING COMPUTATION Second Year Lectures. Stephen Roberts Michaelmas Term

Applied Linear Algebra in Geoscience Using MATLAB

MATH 3321 Sample Questions for Exam 3. 3y y, C = Perform the indicated operations, if possible: (a) AC (b) AB (c) B + AC (d) CBA

Rank, Homogenous Systems, Linear Independence

Math 54 HW 4 solutions

Inverting Matrices. 1 Properties of Transpose. 2 Matrix Algebra. P. Danziger 3.2, 3.3

Reduction to the associated homogeneous system via a particular solution

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

Shan Feng

S09 MTH 371 Linear Algebra NEW PRACTICE QUIZ 4, SOLUTIONS Prof. G.Todorov February 15, 2009 Please, justify your answers.

Paul Heckbert. Computer Science Department Carnegie Mellon University. 26 Sept B - Introduction to Scientific Computing 1

Exact and Approximate Numbers:

Applied Matrix Algebra Lecture Notes Section 2.2. Gerald Höhn Department of Mathematics, Kansas State University

Chapter 1. Vectors, Matrices, and Linear Spaces

Eigenvalues and Eigenvectors

Linear Equations and Vectors

Math 314H EXAM I. 1. (28 points) The row reduced echelon form of the augmented matrix for the system. is the matrix

Section 3.5 LU Decomposition (Factorization) Key terms. Matrix factorization Forward and back substitution LU-decomposition Storage economization

Problems for M 10/12:

Elimination Method Streamlined

Math 414 Lecture 1. Reading assignment: Text: Pages 1-29 and Scilab Users Guide: Sections 1-3.

Applied Mathematics Course Contents Matrices, linear systems Gauss-Jordan elimination, Determinants, Cramer's rule, inverse matrix.

Linear Algebra Final Exam Study Guide Solutions Fall 2012

PROBLEMS In each of Problems 1 through 12:

Math 265 Linear Algebra Sample Spring 2002., rref (A) =

Find the solution set of 2x 3y = 5. Answer: We solve for x = (5 + 3y)/2. Hence the solution space consists of all vectors of the form

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Pre-Calculus I. For example, the system. x y 2 z. may be represented by the augmented matrix

1 9/5 Matrices, vectors, and their applications

Section 1.1: Systems of Linear Equations. A linear equation: a 1 x 1 a 2 x 2 a n x n b. EXAMPLE: 4x 1 5x 2 2 x 1 and x x 1 x 3

4 Chapter 4 Lecture Notes. Vector Spaces and Subspaces

Linear independence, span, basis, dimension - and their connection with linear systems

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

The scope of the midterm exam is up to and includes Section 2.1 in the textbook (homework sets 1-4). Below we highlight some of the important items.

Solving Linear Systems Using Gaussian Elimination

Basic Linear Algebra in MATLAB

Lecture 3: Gaussian Elimination, continued. Lecture 3: Gaussian Elimination, continued

Lecture 03. Math 22 Summer 2017 Section 2 June 26, 2017

Matrix decompositions

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

1. Determine by inspection which of the following sets of vectors is linearly independent. 3 3.

MATH 3511 Lecture 1. Solving Linear Systems 1

Identity Matrix: EDU> eye(3) ans = Matrix of Ones: EDU> ones(2,3) ans =

1 Systems of equations

Linear Algebraic Equations

We see that this is a linear system with 3 equations in 3 unknowns. equation is A x = b, where

Eigenvalues and Eigenvectors

Lecture 9: Elementary Matrices

2.3 Rectangular Components in Three-Dimensional Force Systems

Math 1553, Introduction to Linear Algebra

(Practice)Exam in Linear Algebra

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Math 369 Exam #2 Practice Problem Solutions

Instructions Please answer the five problems on your own paper. These are essay questions: you should write in complete sentences.

Solving Systems of Linear Equations Using Matrices

Transcription:

Linear Algebra Solving Simultaneous Linear Equations in MATLAB Solving SLEs with Matlab Matlab can solve some numerical SLE s A b Five techniques available:. method. method. method 4. method. method Matri Inversion The inverse of a square matri A is defined as A - Matlab can calculate matri inverse with the command, Solving SLE s by Matlab - Inverse Matlab can solve some numerical SLE s using matri inversion A b both sides by A -, A inv(a) - 0 0.0-0.00 0.0-0.00 -.000 0.00 0-0.0-0.00 0.0

Solving SLE s by Matlab Note that not all A matrices have an inverse (and not all SLE s have a unique solution!) SLE s must be for a unique solution to eist If SLE s not linearly independent, then! Matlab SLE Eample # Three simultaneous linear equations: 4 + 6 + + + 8 Equations in matri form: 6 Rank of a Matri The is the number of linearly independent rows (or columns) in the matri Matlab command is For a square matri A of order nn independent equations if consistent equations if Augmented Matri Matlab SLE Eample #: The augmented matri for the system is [ A b] [] b 6 www.engr.usask.ca/classes/ge//notes009s/lectures.ppt

Solving SLE by Matlab s rref Function Matlab s command will convert the augmented matri to its row-reduced echelon form: >> ans 0 0 0 0-0 0 4 Solving Linear Equations Consider the set of equations A b Ais an n m matri, is an m vector and b is an n vector The rank of a matri is the number of independent rows (or columns). Rank can be checked using the MATLAB command rank Equations are consistent if independent if www.engr.usask.ca/classes/ge//notes009s/lectures.ppt Linear Equations, n m Linear Equations, n < m When A is square (i.e., n m) and the equations are independent and consistent, the solution can be found using the operator. MATLAB finds the solution using a LU decomposition of A. >> A [ ; 4 6; 8 0] A 4 6 8 0 >> b [66; 804; ] b 66 804 >> [rank(a) rank([a b])] ans >> When the number of equations is less than the number of unknowns (i.e., n < m), usually an infinite number of solutions eist. \ finds the solution with >> A [ 4; ]; b [4;]; >> A\b

When there are more equations than unknowns (i.e., n > m), usually no solution eists. \ can be used to find Linear Equations, n > m >> A [ -; ; 6 - ]; >> b [; ; -]; >> [rank(a) rank([a b])] ans >> Matlab s linsolve Function Matlab s linsolve function solves finds the solution of a linear system using with row pivoting (if the A matri is square): Equations in matri form: >> 4 8 6 Non-Independent Equations Consider the following linear system with only independent equations: Non-Independent Equations 4 6 4 The rank of [A] will be? The rank of [A b] will be? www.engr.usask.ca/classes/ge//notes009s/lectures.ppt www.engr.usask.ca/classes/ge//notes009s/lectures.ppt

Non-Independent Equations Solve this set of simultaneous linear equations using each of the 4 Matlab techniques:. inverse. rref. \ ( backslash ) 4. linsolve 4 6 4 Condition The solution technique y A b produces the correct answer when Ayb is Ayb is well-conditioned when Eistence: Uniqueness: Stability: is continuous A Ayb is if it is not well-conditioned www.ncsu.edu/crsc/events/ugw0/slides/samuels_inverse.ppt What is an ill-conditioned system? Ill-Conditioned System: A system is ill-conditioned if Ill-conditioned system: 0.8 0. 0.8 0. 0.66 y 0.68 0.66 y 0.06 A y b 0.66 y 0.68 0.66 y 0.066 A y b y y y y www.ncsu.edu/crsc/events/ugw0/slides/samuels_inverse.ppt www.ncsu.edu/crsc/events/ugw0/slides/samuels_inverse.ppt

Symbolic Solution of Simultaneous Linear Equations in Matlab Symbolic Solution of Simultaneous Linear Equations in Matlab Solve: - y + 4z y + 4z + 0 -z + + 4y 0:. clear,. eq'*-. eq'y+4*z 4. eq'-*z+*. [,y,z]solve( ), y, z Note: while the symbols in the equations can be in any order (unlike MATLAB's numerical methods), the results are given in alphabetical order so you must be careful what you put inside the brackets. How do you convert to floating point numeric format? people.clarkson.edu/~wilco/es00/sym.ppt people.clarkson.edu/~wilco/es00/sym.ppt Additional Resources www.mathworks.com/access/helpdesk/help/techdoc/inde.html inv mldivide ( \ ) rref linsolve for more information on solving special cases of SLE s, look at linear systems of equations SLE s from Dynamics Use Matlab to solve the following set of SLE s from Dynamics for a A, a B, a C, T, and T a B + ac A + a 0 0kg a + A T 490N T T 0 0kg a + B T 96N 0kg a + C T 94N Note the units for a s and T s! T A W A 490N B T T W B 96N T C W C 94N

SLE s from Circuits Nine unknowns: i, i i, 6 K V, V, V A B C 00V 0Ω i 00V 0Ω i V A V B 0Ω i V A V C Ω i 4 V B V C i 0Ω i i V A V B V A 0Ω 0Ω 0Ω i V 0 i i 4 Ω i 6 B 40Ω i6 V 0 i + i i i4 i 4 + i i6 i + i C 0Ω V C 40Ω Find all pin reaction forces if P 0lb and Q 960 lb SLE s from Statics 0 in CY in CX in P 0 Multi-force members: B X C X 0 B C Q in 6in 0in in 0in in in A X + C X A + C Y Y Y Y 0 P in Q + in C + in C 0 X Y SLE s in Heat Transfer SLE s in Heat Transfer Governing PDE: PDE solution for each finite element is represented using polynomials. Collection of element solutions leads to a very large set of simultaneous linear equations: What is T(,y), given prescribed conditions on the boundary? www.mece.ualberta.ca/courses/mec6/proe_library/me68_.ppt where K is called STIFFNESS matri, is vector of unknowns at each node, and F is due to applied loads and/or boundary conditions. www.mece.ualberta.ca/courses/mec6/proe_library/me68_.ppt