1 / 34

Engr/Math/Physics 25

Engr/Math/Physics 25. Chp8 Linear Algebraic Eqns-1. Bruce Mayer, PE Registered Electrical & Mechanical Engineer BMayer@ChabotCollege.edu. Learning Goals. Define Linear Algebraic Equations Solve Systems of Linear Equations by Hand using Gaussian Elimination (Elem. Row Ops) Cramer’s Method

ganya
Download Presentation

Engr/Math/Physics 25

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Engr/Math/Physics 25 Chp8 LinearAlgebraic Eqns-1 Bruce Mayer, PE Registered Electrical & Mechanical EngineerBMayer@ChabotCollege.edu

  2. Learning Goals • Define Linear Algebraic Equations • Solve Systems of Linear Equations by Hand using • Gaussian Elimination (Elem. Row Ops) • Cramer’s Method • Distinguish between Equation System Conditions: Exactly Determined, OverDetermined, UnderDetermined • Use MATLAB to Solve Systems of Eqns

  3. Linear Equations  Example • In Many Engineering Analyses (e.g. ENGR36 & ENGR43) The Engineer Must Solve Several Equations in Several Unknowns; e.g.: • Contains 3 Unknowns (x,y,z) in the 3 Equations

  4. Examine the System of Equations Linear Systems - Characteristics • ALL the Variables are Raised EXACTLY to the Power of ONE (1) • COEFFICIENTS of the Variables are all REAL Numbers • The Eqns Contain No Transcendental Functions (e.g. ln, cos, ew) • We notice These Characteristics that DEFINE Linear Systems

  5. Gaussian Elimination – ERO’s • A “Well Conditioned” System of Eqns can be Solved by Elementary Row Operations (ERO): • Interchanges: The vertical position of two rows can be changed • Scaling: Multiplying a row by a nonzero constant • Replacement: The row can be replaced by the sum of that row and a nonzero multiple of any other row

  6. Let’s Solve The System of Eqns ERO Example - 1 • Next SCALE by using Eqn (1) as the PIVOT To Multiply • (2) by 12/6 • (3) by 12/[−5] • INTERCHANGE, or Swap, positions of Eqns (1) & (2)

  7. The Scaling Operation ERO Example - 2 • Note that the 1st Coeffiecient in the Pivot Eqn is Called the Pivot Value • The Pivot is used to SCALE the Eqns Below it • Next Apply REPLACEMENT by Subtracting Eqs • (2) – (1) • (3) – (1)

  8. The Replacement Operation Yields ERO Example - 3 • Note that the x-variable has been ELIMINATED below the Pivot Row • Next Eliminate in the “y” Column • We can use for the y-Pivot either of −11 or −9.8 • For the best numerical accuracy choose theLARGEST pivot Or

  9. Our Reduced Sys ERO Example - 4 Or • Since |−11| > |−9.8| we do NOT need to interchange (2)↔(3) • Scale by Pivot against Eqn-(3)

  10. Perform Replacement by Subtracting (3) – (2) ERO Example - 5 • The Hard Part is DONE • Find y & x by BACK SUBSTITUTION • From Eqn (2) • Now Easily Find the Value of z from Eqn (3)

  11. BackSub into (1) ERO Example - 6 • x = 2 • y = −3 • z = 5 Q.E.F. • Thus the Solution Set for Our Linear System

  12. Importance of Pivoting • Computers use finite-precision arithmetic • A small error is introduced in each arithmetic operation, AND…error propagates • When the pivot element is very small, then the multipliers will be even smaller • Adding numbers of widely differing magnitude can lead to aloss ofsignificance. • To reduce error, row interchanges are made to maximize the magnitude of the pivot element

  13. Gaussian Elimination Summary • INTERCHANGE Eqns Such that the PIVOT Value has the Greatest Magnitude • SCALE the Eqns below the Pivot Eqn using the Pivot Value ratio’ed against the Corresponding Value below • REPLACE Eqns Below the Pivot by Subtraction to leave ZERO Coefficients Below the Pivot Value

  14. Poorly Conditioned Systems • For Certain Systems Guassian Elimination Can Fail by • NO Solution → Singular System • Numerically Inaccurate Results → ILL-Conditioned System • In a SINGULAR SYSTEM Two or More Eqns are Scalar Multiples of each other • In ILL-Conditioned Systems 2+ Eqns are NEARLY Scalar Multiples of each other

  15. Consider 2-Eqns in 2-Unknowns A Singular (Inconsistent) Sys • Perform Elimination by • Swapping Eqns • Mult (2) by 2/1 • Subtract (2) – (1)

  16. Plot This System on the XY Plane y Singular System - Geometry • The Lines do NOT CROSS to Define a A Solution Point • Singular Systems Have at least Two “PARALLEL” Eqns

  17. ILL-Conditioned Systems • A small deviation in one or more of the CoEfficients causes a LARGE DEVİATİON in the SOLUTİON.

  18. ILL-Conditioned Systems - 2 • Systems in Which a Small Change in a CoEfficient Produces Large Changes in the Solution are said to be STIFF • Essentially the Lines Have very nearly Equal SLOPES Tilt Region • “Tilting” The Equations just a bit Dramatically Shifts the Solution (Crossing Point)

  19. Consider the Electrical Ckt Shown at Right Matrix Methods for LinSys - 1 • The Operation of this Ckt May be Described in Terms of the • Mesh Currents, I1-I4 • Sources: 4 mA, 12 V • Resistors: 1 & 2 kΩ • Notice Mesh Currents I1 &I2are Defined by SOURCES

  20. Using Techniques from ENGR43 find Matrix Methods for LinSys - 3 • Recall Matrix Multiplication to Write the Equation system in Matrix Form

  21. Thus The (linear) Ckt Can be Described by Matrix Methods for LinSys - 3 • This Can Be Written in Std Math Notation • Where • A Coefficient Matrix • m-Rows x n-Colunms • b  Constraint Vector • x  Solution Vector

  22. If we Solve a LinSys by Elimination we may do a Lot of work Before Discovering that the system is Singular or Very-Stiff Determinants Can Alert us ahead of time to these Difficulties Determinants are Defined only for SQUARE Arrays The 2x2 Definition Determinants - 1 • D2 is Sometimes called the “Basic Minor”

  23. Determinants - 2 • Calculating Larger-Dimension DETs becomes very-Tedious very-Quickly • Consider a 3x3 Det • Example

  24. Determinants - 3 • A Determinant, no matter what its size, Returns a SINGLE Value • Matrix vs. Determinant • For Square Matrix A the Notation • MATLAB vs det • The det Calc is quite Painful, but MATLAB’s “det” Fcn Makes it Easy • For the D3ex >> A = [-4,9,6; 7,13,-2; -3,11,5]; >> D3ex = det(A) D3ex = 87 

  25. Determinant Indicator - 1 • The LARGER the Magnitude of the Determinant relative to the Coefficients, The LESS-Stiff the System • If det=0, then the System is SINGULAR

  26. Determinant Indicator - 2 • Consider this System • Check the “Stiffness” • Thus The system appears NON-Stiff • Find Solution by Elimination as

  27. MATLAB has a very nice Utility for Solving Well-Conditioned Linear Systems of the Form MATLAB Left Division • The Syntax is Quite Simple • the hassle is entering the Matrix-A and Vector-b • x = A\b • Well Conditioned → • Square System → No. of Eqns & Unknwns are Equal • det  0

  28. Consider a 750 kg Crate suspended by 3 Ropes or Cables Left-Div Example - 1 • Using Force Mechanics from ENGR36 Find 3 Eqns in 3 Unknowns

  29. The MATLAB Command Window Session Left-Div Example - 2 >> A = [-0.48, 0, 0.5195;... 0.8, 0.8824, 0.7792;... -0.36, 0.4706, -.3506]; >> w = [0; 9.81*750; 0] >> T = A\w T = 1.0e+003 * 2.6254 3.8157 2.4258 • Or • TAB = 2.625 kN • TAC = 3.816 kN • TAD = 2.426 kN

  30. Recall The Matrix Formulation for n-Eqns in n-Unknowns Matrix Inverse - 1 • Note that the IDENTITY Matrix , I, Has Property • In Matrix Land • Use A-1 in Matrix Eqn • To Isolate x, employ the Matrix Inverse A-1 as Defined by

  31. Thus the Matrix Shorthand for the Solution Matrix Inverse - 2 • In addition A-1 is, in general, Less Numerically Accurate Than Pivoted Elimination • However • Determining the Inverse is NOT Trivial (Ask your MTH6 Instructor) is Symbolically Elegant and Will be Useful in that regard

  32. Compare MatInv & LeftDiv % Bruce Mayer, PE % ENGR25 * 21Oct09 % file = Compare_MatInv_LeftDiv_0910 % A = [3 -7 8; 7 6 -5; -9 0 2] b = [13; -29; 37] Ainv = inv(A) xinv = Ainv*b xleft = A\b % % CHECK Both by b = A*x CHKinv = A*xinv CHKleft = A*xleft Time for Live Demo

  33. All Done for Today • Given A, Find A-1 MatrixInversionby Adjoint The “Adjoint” of a matrix is the transpose of the matrix made up of the “CoFactors” of the original matrix.

  34. Engr/Math/Physics 25 Appendix Time For Live Demo Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu

More Related