maths II sutd lecture 2

  • Upload
    gnoppy

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

  • 8/10/2019 maths II sutd lecture 2

    1/36

    Singapore University of

    Technology & Design

    MATH 10.004Elimination & Augmented Form

    Cohort 2

    Meyer, Sections 1.2-1.3

  • 8/10/2019 maths II sutd lecture 2

    2/36

    Elimination Matrices Elimination with Matrices Summary

    LEARNING OBJECTIVES

    After this cohort you will be able to ...

    solve system of linear equations using elimination and back

    substitution.

    express systems in terms of matrices and perform basic

    operations with matrices.

    solve system of linear equations using augmented matrices.

    2

  • 8/10/2019 maths II sutd lecture 2

    3/36

    Elimination Matrices Elimination with Matrices Summary

    ELIMINATION

    Purpose is to provide a systematic way to solve systems of linearequations.

    Commonly credited to Carl Friedrich Gauss, but first appearance

    was in The Nine Chapters on the Mathematical Arts, an early

    Chinese mathematics book composed by several authors and

    completed around the 1st century.

    3

  • 8/10/2019 maths II sutd lecture 2

    4/36

    Elimination Matrices Elimination with Matrices Summary

    ELIMINATION

    Our aim is to simplify equations by performing the following types

    ofrow operations:

    (I) Exchange two equations.

    (II) Multiply an equation by a non-zero constant.

    (III) Add a multiple of one equation to another equation.

    In particular, we want to eliminate variables to allow for easier

    subsitution.

    4

  • 8/10/2019 maths II sutd lecture 2

    5/36

    Elimination Matrices Elimination with Matrices Summary

    EXAMPLE

    Consider the following linear system

    2x1` x2` x3 54x16x2 2

    2x1`7x2`2x3 9

    Well solve it via a series of elimination steps on the next slide.

    5

  • 8/10/2019 maths II sutd lecture 2

    6/36

    Elimination Matrices Elimination with Matrices Summary

    Original system:

    2x1` x2` x3 5 (1)4x16x2 2 (2)

    2x1`7x2`2x3 9 (3)

    We proceed byforward

    elimination:

    (2)-2(1)(2):

    2x1` x2` x3 5

    8x22x3 12

    2x1`7x2`2x3 9

    (3)+(1)(3):

    2x1` x2` x3 5

    8x22x3 12

    8x2`3x3 14

    (3)+(2)(3):

    2x1` x2` x3 5

    8x22x3 12

    1x3 2

    6

    Eli i i M i Eli i i i h M i S

  • 8/10/2019 maths II sutd lecture 2

    7/36

    Elimination Matrices Elimination with Matrices Summary

    We now have the upper triangular system

    2x1` x2` x3 5

    8x2 2x3 12

    1x3 2

    which we may then solve viaback substitution:

    1. From the third equation we havex32.

    2. Pluggingx32 into the second equation, we then have

    x2 14x3` 32 12` 32 1.

    3. Plugging bothx32 andx21 into the first equation gives usx1

    12

    px2`x3q ` 52

    1.

    7

    Eli i ti M t i Eli i ti ith M t i S

  • 8/10/2019 maths II sutd lecture 2

    8/36

    Elimination Matrices Elimination with Matrices Summary

    GAUSS-JORDAN METHOD

    TheGauss-Jordan methodsimplifies back substitution.

    2x1` x2` x3 5

    8x2 2x3 12

    1x3 2

    2x1` x2 3

    x2 1

    x32

    2x1` x2` 3

    8x2 8

    x3 2

    x1 1

    x2 1

    x32

    The leading coefficient in each equation is a 1.

    Every coefficient of the same unknown above these leading

    terms is zero.8

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    9/36

    Elimination Matrices Elimination with Matrices Summary

    ACTIVITY 1: DOCKING A SPACE POD (15 MINUTES)

    You find yourself in deep space piloting a small space pod that you

    would like to dock to the mother ship.

    You are currently stationary and your navigation tools define an

    px, y, zqcoordinate system relative to your current position. Thedocking location is 4, 10, and 17 meters away (in x,y, andz).

    You have 3 thrusters at your control. For each second you fire each

    thruster the pod will move, in thex,y, andzdirections:

    Thruster A: 1, 2, and 3 meters,

    Thruster B: 1, 3, and 6 meters, Thruster C: 2, 6, and 10 meters.

    Assuming a simple additive model of the interaction of the thrusters,

    use elimination to find how many seconds each thruster needs to be

    fired to move the pod to the dock.9

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    10/36

    Elimination Matrices Elimination with Matrices Summary

    ACTIVITY 1: DOCKING A SPACE POD

    Lets1,s2, ands3 be the time that each of the thrusters is fired. Using

    matrix notation, the problem to solve may be written as:

    s1`s2`2s3 4

    2s1`3s2`6s310

    3s1`6s2`10s317or after elimination:

    1. p2q 2p1q p2q

    2. p3q 3p1q p3q

    3. p3q 3p2q p3q

    s1`s2`2s3 4

    s2`

    2s3

    2

    2s3 1

    which through back substitution then gives us the solution s12,s21, ands31{2.

    10

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    11/36

    Elimination Matrices Elimination with Matrices Summary

    MATRICES

    Amatrixis a rectangular array of scalars.

    If the matrix hasmrows andncolumns, we say that the size of

    the matrix ismn.

    The matrix is square ifmn.

    The scalar in theith row andjth column is called thepi,jq-entry ofthe matrix.

    Am n

    a11 . . . a1j . . . a1n...

    ......

    ai1 . . . aij . . . ain...

    ......

    am1 . . . amj . . . amn

    fiffiffiffiffiffiffifl

    11

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    12/36

    Elimination Matrices Elimination with Matrices Summary

    SUM OF MATRICES

    Matrices of the same dimensions can be added.

    IfA

    a11 . . . a1n

    ..

    .

    ..

    .am1 . . . amn

    fiffifl

    andB

    b11 . . . b1n

    ..

    .

    ..

    .bm1 . . . bmn

    fiffifl

    ,

    then

    A`Ba11`b11 . . . a1n` b1n

    .

    ..

    .

    ..am1`bm1 . . . amn` bmn

    fiffifl .

    12

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    13/36

    y

    PRODUCT OF A MATRIX BY A SCALAR

    Matrices can be multiplied by a scalar. If A

    a11 . . . a1n...

    ...

    am1 . . . amn

    fiffifl

    and P R, then

    A

    a11 . . . a1n..

    .

    ..

    .am1 . . . amn

    fiffifl .

    13

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    14/36

    y

    PROPERTIES OF MATRIX OPERATIONS

    Matrices obey the following laws related to addition:

    A`BB`A (the commutative law)

    cpA`Bq cA`cB(the distributive law)

    A` pB`Cq pA`Bq `CA`B`C(the associative law)

    14

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    15/36

    TRANSPOSE

    Given a matrixA, itstransposeAT is obtained by interchanging the

    role of rows and columns. For instance:

    A24

    1 2 7 03 2 1 6

    AT

    42

    1 3

    2 27 1

    0 6

    fiffiffifl .

    pAT

    qT

    A pABqT AT BT

    pAqT AT

    15

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    16/36

    VECTORS AS MATRICES

    Arow vectorof sizenis a 1nmatrix.

    Acolumn vectorof sizemis anm1 matrix.

    Ifvis a column vector, then vT is a row vector.

    16

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    17/36

    PRODUCT OF MATRICES

    Matrices can be multiplied if the number of columns of the first matrix

    is equal to the number of rows of the second. If

    Am n

    a11 . . . a1n

    ......

    am1 . . . amn

    fi

    ffifland B

    n k

    b11 . . . b1k

    ......

    bn1 . . . bnk

    fi

    ffifl,then

    Cm k

    AB

    is such that its genericpi,jq-entry has the form

    cijn

    h1

    aihbhjAi B jApi, :q Bp:,jq.

    17

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    18/36

    SIMPLE MATRIX MULTIPLICATION

    For column vectorsu,v,wandy:

    vTwv1 v2 v3

    w1w2w3

    fifl v1w1`v2w2`v3w3

    uT

    vT

    w

    u1 u2 u3

    v1 v2 v3

    w1w2w3

    fifl

    u1w1`u2w2`u3w3v1w1`v2w2`v3w3

    vT

    w y

    v1 v2 v3

    w1 y1w2 y2w3 y3

    fifl

    v1w1`v2w2`v3w3 v1y1`v2y2`v3y318

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    19/36

    SYSTEM OF LINEAR EQUATIONS

    Alinear systemof mequations innunknowns is written as

    a11x1`a12x2` a1nxnb1

    a21x1`a22x2` a2nxnb2...

    am1x1`am2x2` amnxnbm.

    which is a mathematical way of expressingmlinear equality

    constraints that thenvariablesxi, iP t1, . . . , nu, need to satisfy.

    In matrix notation, we can write this compactly as

    Axb,

    whereA P Rm n,xP Rn, andbP Rm.19

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    20/36

    MATRIX FORM

    We can rewrite the system:

    2x1` x2` x3 5 (4)

    4x16x2 2 (5)

    2x1`7x2`2x3 9 (6)

    as

    Axb,

    where

    A

    2 1 14 6 0

    2 7 2

    fifl , x

    x1x2x3

    fifl , b

    52

    9

    fifl .

    20

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    21/36

    ACTIVITY 2: MATRICES FOR DATA MANAGEMENT (20 MINUTES)

    Create a matrixSthat records the day-end sales formstoresselling the samen items.

    Price information will be stored in a n 1 matrix (vector) calledp.

    What does theith

    row ofStell you? And thejth

    column?

    What does thesijelement in the matrix tell you?

    Find matrix operations to calculate:

    A vector containing number of itemjs sold at each store. A vector containing the total revenue of each store.

    The total revenue from all stores.

    The total revenue of store i.

    21

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    22/36

    ACTIVITY 2: MATRICES FOR DATA MANAGEMENT

    S

    s11 . . . s1n

    ......

    sm1 . . . smn

    fiffifl and p

    p1

    p2...

    pn

    fiffiffiffifl

    Theith row gives the number of each item sold at store i.

    Thejth column gives the number of item js sold at each of thestores.

    The elementsijgives the number of itemjs sold at storei.

    22

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    23/36

    ACTIVITY 2: MATRICES FOR DATA MANAGEMENT

    A vector containing number of item js sold at each store:

    Sej

    s11 . . . s1j . . . s1n...

    ......

    sm1 . . . smj . . . smn

    fiffifl

    0...

    1..

    .0

    fiffiffiffiffiffiffifl

    s1j...

    smj

    fiffifl

    A vector containing the total revenue of each store:

    Sp

    s11 . . . s1n... ...sm1 . . . smn

    fiffiflp1...pn

    fiffifl rev1...

    revm

    fiffifl ,

    where revkis the revenue made from all items at storek.

    23

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    24/36

    ACTIVITY 2: MATRICES FOR DATA MANAGEMENT

    The total revenue from all stores:

    1TmSp

    1 . . . 1

    s11 . . . s1n...

    ...

    sm1 . . . smn

    fiffifl

    p1...

    pn

    fiffifl

    m

    k1

    revk.

    The total revenue of storei:

    eTiSp

    0 . . . 1 . . . 0

    s11 . . . s1n...

    ..

    .si1 . . . sin

    ......

    sm1 . . . smn

    fiffiffiffiffiffiffiflp1...pn

    fiffifl revi.

    24

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    25/36

    ACTIVITY 2B (5 MINUTES)

    Enter these commands into SCILAB, MATLAB, etc and discuss their

    meaning:

    clear all;

    sales=[500 520 128 58; 850 600 54 32]

    prices=[1.55 2.35 1.5 3.5]

    revshop=sales*prices

    revtot=[1 1]*revshop

    revshopfruit=sales(:,1:3)*prices(1:3)revtotfruit=[1 1]*revshopfruit

    25

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    26/36

    ACTIVITY 3(10 MINUTES)

    Consider an electric circuit which takes input voltageVin and currentIinand produces output voltageVout and currentIout.

    For a series circuit:

    V2V1I1R1 andI2I1.

    For a parallel circuit:

    V3V2 andI3I2V2{R2.

    Define a (transfer) matrixA such that:

    V2

    I2

    A1

    V1

    I1

    ,

    V3

    I3

    A2

    V2

    I2

    ,

    V3

    I3

    A3

    V1

    I1

    for the series circuit, parallel circuit, and combined circuit, respectively.

    26

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    27/36

    ACTIVITY 3

    According to Ohms law and Kirchhoffs circuit laws:

    For the series circuit,V2V1I1R1,I2I1:

    The transfer matrix of a series circuit is A1

    1 R10 1

    .

    For the parallel circuit,V3V2,I3I2V2{R2:

    The transfer matrix of a parallel circuit is A2

    1 0

    1{R2 1

    .

    We can use matrix multiplication to find the total transfer function:

    V3

    I3

    A2

    V2

    I2

    A2A1

    loomoonA3V1

    I1

    , A3

    1 R1

    1{R2 1`R1{R2

    27

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    28/36

    AUGMENTED FORM

    Given the equationAxb

    2 1 1

    4 6 02 7 2

    fi

    fl

    x1

    x2

    x3

    fi

    fl

    5

    29

    fi

    fl,

    we callA b

    theaugmented matrixof the system.

    A b

    2 1 1 54 6 0 2

    2 7 2 9

    fifl

    28

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    29/36

    Original system:

    2x1` x2` x3 5 (1)

    4x16x2 2 (2)

    2x1`7x2`2x3 9 (3)

    We proceed byforward

    elimination:

    (2)-2(1)(2):

    2x1` x2` x3 5

    8x22x3 12

    2x1`7x2`2x3 9

    (3)+(1)(3):

    2x1` x2` x3 58x22x3 12

    8x2`3x3 14

    (3)+(2)(3):

    2x1` x2` x3 5

    8x22x3 12

    1x3 2

    29

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    30/36

    Original system:

    2 1 1 54 6 0 22 7 2 9

    fifl

    We proceed byforward

    elimination:

    (2)-2(1)(2):

    2 1 1 50 8 2 12

    2 7 2 9

    fifl

    (3)+(1)(3):

    2 1 1 50 8 2 12

    0 8 3 14

    fifl

    (3)+(2)(3):

    2 1 1 5

    0 8 2 120 0 1 2fifl

    30

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    31/36

    ELIMINATION WITH MATRICES

    Using matrix notation, we started with the original system:

    Ax

    2 1 14 6 0

    2 7 2

    fifl x

    52

    9

    fifl b,

    and through a series of elementary row operations transformed it to

    theequivalent system:

    Ux

    2 1 10 8 2

    0 0 1

    fifl x

    512

    2

    fifl c.

    The Gauss-Jordan method on the augmented matrix works the sameway as before:

    Rx

    1 0 0

    0 1 0

    0 0 1

    fi

    flx

    1

    1

    2

    fi

    fld.

    31

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    32/36

    ACTIVITY 4: AUGMENTED MATRICES (15 MINUTES)

    Solve Activity 1: Docking a Space Pod using augmented matrices.

    Swap rows 2 3 and solve through elimination again.

    Are the final triangular systems the same?

    Are the solutions the same?

    32

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    33/36

    ACTIVITY 4: AUGMENTED MATRICES

    Lets1,s2, ands3 be the time that each of the thrusters is fired. Using

    matrix notation, the problem to solve may be written as:1 1 2 42 3 6 10

    3 6 10 17

    fifl

    1 1 2 40 1 2 2

    0 0 2 1

    fifl

    or after switching rows 2 3:

    1 1 2 4

    3 6 10 17

    2 3 6 10

    fi

    fl

    1 1 2 4

    0 3 4 5

    0 0 23

    13

    fi

    flElimination is not unique!

    Either way substitution then gives us the same solution:

    ps1, s2, s3q p2, 1, 1{2q.

    33

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    34/36

    ACTIVITY 5: PRACTICE (10 MINUTES)

    Using elimination on augmented matrices solve the following system

    of linear equations.

    x1`2x2` 8x37x4 2

    3x1`2x2`12x35x4 6

    x1` x2` x35x4 10

    34

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    35/36

    ACTIVITY 5: PRACTICE

    1 2 8 7 23 2 12 5 6

    1 1 1 5 10

    fifl

    p2q 3p1q p3q ` p1q

    1 2 8 7 20 4 12 16 120 3 9 12 12

    fi

    fl 3p2q 4p3q

    1 2 8 7 20 12 36 48 36

    0 12 36 48 48

    fifl

    p3q ` p2q

    1 2 8 7 20 12 36 48 36

    0 0 0 0 12

    fifl

    This system is inconsistent,

    therefore it has no solution!

    35

    Elimination Matrices Elimination with Matrices Summary

  • 8/10/2019 maths II sutd lecture 2

    36/36

    SUMMARY

    Elimination provides a systematic way to solve systems of linear

    equations.

    Systems of linear equations can be represented by a matrix

    equation.

    Basic definitions of matrices and their properties.

    Augmented form is a compact way to solve linear systems withelimination.

    36