Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002.

Slides:



Advertisements
Similar presentations
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Advertisements

Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Linear Systems of Equations
Solving Linear Systems (Numerical Recipes, Chap 2)
Simultaneous Linear Equations
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
CISE301_Topic3KFUPM1 SE301: Numerical Methods Topic 3: Solution of Systems of Linear Equations Lectures 12-17: KFUPM Read Chapter 9 of the textbook.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Chapter 2 Matrices Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
Numerical Algorithms Matrix multiplication
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Lecture 11 - LU Decomposition
Solving Systems of Linear Equations Part Pivot a Matrix 2. Gaussian Elimination Method 3. Infinitely Many Solutions 4. Inconsistent System 5. Geometric.
Linear Algebraic Equations
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
Math for CSLecture 21 Solution of Linear Systems of Equations Consistency Rank Geometric Interpretation Gaussian Elimination Lecture 2. Contents.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
10.1 Gaussian Elimination Method
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Part 31 Chapter.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Linear Algebraic Equations ~ Gauss Elimination Chapter.
SYSTEMS OF LINEAR EQUATIONS
Major: All Engineering Majors Author(s): Autar Kaw
Chapter 1 – Linear Equations
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Square n-by-n Matrix.
Sec 3.1 Introduction to Linear System Sec 3.2 Matrices and Gaussian Elemination The graph is a line in xy-plane The graph is a line in xyz-plane.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
MATH 175: Numerical Analysis II Lecturer: Jomar Fajardo Rabajante 2 nd Sem AY IMSP, UPLB.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Chemical Engineering Majors Author(s): Autar Kaw
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
Lesson 3 CSPP58001.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
Matrices and Systems of Equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Lecture 10 - Nonlinear gradient techniques and LU Decomposition CVEN 302 June 24, 2002.
Lecture 17 - Approximation Methods CVEN 302 July 17, 2002.
RECOGNIZING INCONSISTENT LINEAR SYSTEMS. What is an Inconsistent Linear System?  An inconsistent linear system is a system of equations that has no solutions.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Linear Algebra Engineering Mathematics-I. Linear Systems in Two Unknowns Engineering Mathematics-I.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
1 Numerical Methods Solution of Systems of Linear Equations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9.
Simultaneous Linear Equations
Linear independence and matrix rank
Linear Algebra Lecture 4.
Chapter 10: Solving Linear Systems of Equations
Metode Eliminasi Pertemuan – 4, 5, 6 Mata Kuliah : Analisis Numerik
Numerical Analysis Lecture14.
CSE 541 – Numerical Methods
Linear Systems Numerical Methods.
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Pivoting, Perturbation Analysis, Scaling and Equilibration
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002

Lecture’s Goals Introduction of Solving Equations of 1 Variable –Newton’s Method –Muller’s Method –Fixed Point Iteration

Lecture’s Goals Introduction to Systems of Equations Discuss how to solve systems –Gaussian Elimination –Gaussian Elimination with Pivoting –Tridiagonal Solver Problems with the technique Examples

Newton’s Method Do while |x 2 - x 1 | >= tolerance value 1 or |f(x 2 )|>= tolerance value 2 or f’(x 1 ) ~= 0 Set x 2 = x 1 - f(x 1 )/f’(x 1 ) Set x 1 = x 2 ; END loop

Newton’s Method Same example problem f(x) = x 5 + x 3 + 4x 2 - 3x - 2 and f’(x) = 5x 4 + 3x 2 + 8x - 3 roots are between (-1.7,-1.3), (-1,0), & (0.5,1.5)

Newton’s Method x 1 f(x 1 ) f’(x 1 ) f(x 1 )/f’(x 1 ) x etc. etc. etc. etc. etc.

Muller’s Method Muller’s method is an interpolation method that uses quadratic interpolation rather than linear. A second degree polynomial is used to fit three points in the vicinity of the root.

Muller’s Method Do while |x 2 - x 1 | >= tolerance value 1 or |f(x 3 )| >= tolerance value 2 c1 = (f(x 2 )-f(x 1 ))/(x 2 - x 1 ) c2 = (f(x 3 )-f(x 2 ))/(x 3 - x 2 ) d1 = (c2-c1)/(x 3 - x 1 ) s = c2 + d1 *(x 3 - x 2 ) x 4 = x 3 - 2*f(x 3 )/ [s + sign(s)*sqrt( s^2 -4*f(x 3 )*d1] Set x 1 = x 2 ; Set x 2 = x 3 ; Set x 3 = x 4 ; END loop

Muller’s Method This method uses a Newton form of an interpolating polynomials.

Example Problem f(x) = x 5 + x 3 + 4x 2 - 3x - 2 The roots are around (-2,-1),(-1,0) and (0,1) Look at (1,0) choice three points, 1.5, 0.5, 0.25

Muller’s Method x 1 f(x 1 ) x 2 f(x 2 ) x 3 f(x 3 ) c 1 c 2 d 1 s 1 x etc. etc. etc. etc. etc. etc. etc. etc. etc. etc. etc.

Fixed-Point Iteration Method The method uses an iterative scheme to find the root. The equation is rewritten to obtain new equation in terms of x. f(x) = a 3 x 3 + a 2 x 2 + a 1 x + a 0 = 0 g(x) = - [( a 3 /a 1 ) x 3 + (a 2 /a 1 ) x 2 + (a 0 /a 1 ) ]

Fixed-Point Iteration Method Problem is that the method only converge for a small range. | g’(x) | < 0.5

Fixed-Point Iteration Method Rewrite f(x) -> g(x) IF | g’(x) |< 0.5 Do while |x k+1 - x k | >= tolerance value x k+1 = g(x k ); k = k+1; END loop ENDIF

Fixed Point Iteration From the book: f(x) = 5x 3 -10x + 3 g(x) = 0.5x g’(x) = 1.5x 2 for 0.1<x<0.5 | g’(x)| < 0.5

Fixed Point Iteration Method The program “demoFixedPoint” test the convergence of the point. The program is limited to small range of values demoFixed(0.1,0.0,0.5)

Systems of Equations

Simple Linear Oscillator The spring-mass system can be described with a series of equations to model the physical behavior. The displacement of the masses are given as “u”, k represents the stiffness of the springs and M represents the mass of each member.

Simple Linear Oscillator The free body diagrams of components of the spring mass system can be represented. Using the equilibrium equations, the static behavior of the model can be determined.

Simple Oscillator The equations can be written from the free body diagrams. The matrix and vectors can be obtained from the equations.

Simple 3-D frame A force is applied to the apex of a simple 3-D frame. We would like to determine the forces in each of the members of the frame. With a FBD, the static equilibrium equations can be derived.

Simple 3-D Frame The set of 3 equilibrium equations and 3 unknowns can be obtained from the FBD of the frame. Place the equations in a matrix format.

Simple 3-D Frame The frame is represented as a matrix with 3 unknowns. The forces are normalized with respect to the applied force, F.

Basic Principles The general description of a set of linear equations in the matrix form: [A]{x} = {b} –[A] ( m x n ) matrix –{x} ( n x 1 ) vector –{b} (m x 1 ) vector

Description of the linear set of equations Write the equations in natural form Identify unknowns and order them Isolate unknowns Write equations in matrix form

Types of Matrix Formulation ( m x n ) Array If m = n The solution of [A]{x} ={b} with n unknowns and m equations If m > n The system is overdetermined system (Least Square Problems) If m < n The system is underdetermined system (Optimization Problems)

Matrix Representation

Consistency [A]{x} = {b} The problem is consistent, if a solution exists for the problem. The problem is inconsistent, if there is no solution for the problem.

Rank of Matrix If rank(A) = n and is consistent, A has an unique solution exists If rank(A) = n and is inconsistent, A has no solution exists If rank(A) < n and system is consistent, A has an infinite number of solutions Rank of a matrix is the number of linearly independent column vectors in the matrix. For n x n matrix, A:

Matrix For an n x n system, rank(A) = n automatically guarantees that the system is consistent. The columns of A are linearly independent The rows of A are linearly independent rank(A) = n det(A) ~= 0 A -1 exists; The solution to [A]{x} ={b} exist and is unique.

Matrix Definition Consider y = -2.0 x + 6 y = 0.5 x unknowns x, y and rank is 2 Consider y = -2 x + 6 y = -2 x unknowns x, y and rank is 1 and is inconsistent

Gaussian Elimination Gaussian elimination is a fundamental procedure for solving “linear” sets of equation general it is applied to a square matrix.

Gaussian Elimination There are two phases to the solving technique Elimination --- use row operations to convert the matrix into an upper diagonal matrix. (The elimination phase, which takes the the most effort and most susceptible to corruption by round off) Back substitution -- Solve x using a back substitution.

Gaussian Elimination Algorithm [A]{x} ={b} Augment the n x n coefficient matrix with the vector of right hand sides to form a n x (n+1) Interchange rows if necessary to make the value a 11 with the largest magnitude of any coefficient in the first row Create zero in 2 nd through n th row in first row by subtracting a i1 / a 11 times first row from i th row

Gaussian Elimination Algorithm Repeat (2) & (3) for second through the (n-1) th rows, putting the largest magnitude coefficient in the diagonal by interchanging rows (consider only row j to n ) and then subtract times the j th row from the i th row so as to create zeros in all positions of j th column below the diagonal at conclusion of this step the system is upper triangular Solve for n from n th equation x n = a n,n+1 / a nn Solve for x n-1, x n-2,...x 1 from the (n-1) th through the first x i =(a i,n+1 -  j =i+1,n a j1 x j ) / a ii

Example 1 X 1 + 3X 2 = 5 2X 1 + 4X 2 = 6

Example 2 -3X 1 + 2X 2 - X 3 = -1 6X 1 - 6X 2 + 7X 3 = -7 3X 1 - 4X 2 + 4X 3 = -6

Computer Program The program GEdemo(A,b) does the Gaussian elimination for a square matrix (nxn). It does not do any pivoting and works for only one {b} vector.

Test the Program Example 1 Example 2 New Matrix 2X 1 + 4X X X 4 = - 4 1X 1 + 2X 2 + 4X X 4 = 5 - 3X 1 - 3X 2 + 8X 3 - 2X 4 = 7 - X 1 + X 2 + 6X 3 - 3X 4 = 7

Problem with Gaussian Elimination The problem can occur when a zero appears in the diagonal and makes a simple Gaussian elimination impossible. Pivoting changes the matrix so that it will become diagonally dominate and reduce the round-off and truncation errors in the solving the matrix.

Computer Program GEPivotdemo(A,b) is a program, which will do a Gaussian elimination on matrix A with pivoting technique to make matrix diagonally dominate. The program is modification to handle a single value of {b}

Question? How would you modify the programs to handle multiple inputs? What is diagonal matrix, upper triangular matrix, and lower triangular matrix? Can you do a column exchange and how would you handle the problem if it works?

Question? What happens with the following example? X X 2 = X X 2 = 0.1 What happens is the second equation becomes: X X 2 = -2000

Gaussian Elimination If the diagonal is not dominate the problem can have round off error and truncation errors. The scaling will result in problems

Summary Newton’s - need to know f(x) and f’(x) and an initial guess. Muller’s method -need to know the f(x) and 3 values. Fixed Point method looking at a point a iterate.

Summary Matrix properties; consistency, rank, diagonally dominate, upper triangular, lower triangular Gaussian elimination is a method to solve for a set of linear equations Non-pivoting problems Setting up the system of linear equations to avoid problems

Homework Check the Homework webpage