MECH0801 Wk 03 Excel Lec

download MECH0801 Wk 03 Excel Lec

of 31

Transcript of MECH0801 Wk 03 Excel Lec

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    1/31

    MUT/ENGPG-Class

    Dr.Thitaphol Huyanan

    Preliminary Basics II

    MECH-0851FINITE ELEMENTANALYSIS

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    2/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Agenda1

    Solving of Linear Equation System

    Introduction to MS Excel

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    3/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    SolvingofLinearEquationSystem

    2

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    4/31

    Dr.Thitaphol HuyananMUT/ENG - PG

    Class

    Overviews3

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    5/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    4

    A linear equation is an algebraic equation in

    which each term is either a constant or a product of

    a constant times the first power of a variable. The

    linear equation is equivalent to equating the 1st-order polynomial to zero.

    0 1 1 2 2 2 2 1 1 0 1 2 0 20 ( / ) ( / )

    linear equation1 -order polynomialst

    m b

    a a x a x a x a x a y a a x a a

    y x

    This type of equation is called a linear equationsince it represents a straight line in the Cartesian

    coordinates and it can be written in a general form

    as 1 1 2 2a x a x b

    SystemofLinearEquations

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    6/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    SystemofLinearEquations

    (continued)5

    The linear algebraic equation can involve morethan two variables. Thus a general form of any n-variable linear equation can be expressed as

    where each a is coefficient constants, b is constant,and each x is an variable.

    A collection ofn linear equations that

    simultaneously involves the same set ofnvariables is called a system of linear equations orso-called a linear system.

    1 1 2 2 n na x a x a x b

    11 1 12 2 1 1

    21 1 22 2 2 2

    1 1 2 2

    n n

    n n

    n n nn n n

    a x a x a x ba x a x a x b

    a x a x a x b

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    7/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    6

    The linear system ofn simultaneous equations

    with n variables can also be rewritten in a matrix

    form.11 1 12 2 1 1

    21 1 22 2 2 2

    1 1 2 2

    11 11 1 1 1

    21 22 2 2 2

    1 2

    n n

    n n

    nn n nn n

    n

    n

    n nn n nn

    a x a x a x b

    a x a x a x b

    ba x a x a x

    a a a x b

    a a a x b

    x ba a a

    x bA

    A solver that directly uses the above system of

    linear equations to determine values of a series of

    variables simultaneously is called a direct solver.

    SystemofLinearEquations

    (continued)

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    8/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Augmented Matrix7

    A augmented matrixfor a system of equations is

    the matrix of numbers in which each row represents

    those constants from one equation (both the

    coefficients and the constant on the other side ofthe equal sign) and each column represents all the

    coefficients for a same variable.

    The augmented matrix is constructed by

    appending the vector of the constants next to the

    coefficients matrix for the purpose of performing the

    same elementary row operations on each of the

    given matrices.

    augmenting A x b A b

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    9/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Echelon Form8

    In linear algebra, a matrix is in row echelon form if

    All nonzero rows the rows with at least onenonzero element are above any rows of all

    zeroes, The leading coefficient the first nonzero number

    from the left, also called the pivot of thenonzero row is always strictly to the right of theleading coefficient of the rowabove it,

    All entries in a columnbelow a leading entry are zeroes(implied by the first two criteria).

    11 1 1 1

    1

    0

    0

    0 0

    i n

    ii i i

    nn n

    u u u b

    u u b

    u b

    U b

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    10/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Echelon Form (continued)9

    A matrix is in reduced row echelon form (alsocalled row canonical form) if it satisfies theadditional condition which is every leadingcoefficient is one and is the only nonzero entry in itscolumn.

    1

    1 0 0

    0 1 0

    0 0 1

    i

    n

    b

    b

    b

    I b

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    11/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    ElementaryRowOperations10

    Consider 3 linear equations with 3 unknown below,

    Switching Rows : any two equations can be

    interchanged,

    1 2 3

    1 2 3

    1 2 3

    augmenting

    4

    2 3

    3 2

    2 3

    3 4

    4 5 1 2 3 42 3 4 33 4 5 2

    x

    x

    x

    x x

    x x

    x x

    A b

    A bA x b

    1 3

    3 1

    1 2 3

    1 2 3

    1 2 3

    3 2

    2 3

    4

    , 4 5 3 4 5 2

    3 4 2 3 4 3

    2 3 1 2 3 4,

    R R

    R R

    x

    x

    x

    x x

    x x

    x x

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    12/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    ElementaryRowOperations

    (continued)11

    Multiplying A Row with One Scalar: any equationcan be multiplied by a nonzero constant,

    Adding Rows : any equation can be replaced by

    the sum of itself and any multiple of another

    equation.

    2 2

    1 2 3

    1 2 3

    1 2 3

    2

    3 2

    4 64

    2

    4 5 3 4 5 2

    6 8 4 6 8 62 3 1 2

    ,3 4

    R R

    x

    xx

    x x

    x xx x

    2 2 1

    1 2 3

    1 2 3

    1 2 3

    3 2

    8

    4

    4 5 3 4 5 2

    10 13 1 10 13 8

    2 3 1 2 4

    ,

    3

    R R R

    x

    x

    x

    x x

    x x

    x x

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    13/31Dr.Thitaphol Huyanan

    MUT/ENG - PG

    Class

    Direct Solvers12

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    14/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Inverse of Matrix13

    Matrix cannot be divided by another matrix,but analogous to division can be performed by aprocess known as inversion of matrices.

    The inverse of a square matrix is anothersquare matrix of same order, such thatA1A1 1 A A A A I

    The inverse of matrix is formed by dividing

    each member of the adjoint of that matrix by thedeterminant of the same matrix. Therefore

    1 adjoint adj

    det

    A A

    AA A

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    15/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Direct Matrix Inversion14

    Consider the matrix equation of linear system

    , if the matrix is nonsingular ( ) then its

    inverse is existed. Therefore

    A x b

    A det 0A -1A

    , where

    -1 -1 -1

    -1 -1A A x A b I x A b

    x A b A C AT

    1

    1

    T T

    From the given system of equations

    (1) Compute to check as if is

    (2) Compute then obtain from its definition

    (3) Obtain a value of each fromix

    A x b

    A A

    C A C A

    x A b

    non- singular

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    16/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    11 12 1

    -

    th

    i i

    i

    i

    a a b a

    From the given system of equations ,

    (1) Compute to check as if is

    (2) Compute , where is that is replaced its column

    by the constants vector

    A x b

    A A

    A A A

    b

    A

    non singular

    1

    21 22 2 2

    1 2

    1 2

    n

    n

    n n n nn

    i

    i i

    i n

    a a b a

    a a b a

    x x (3) Obtain a value of each fromA

    A

    Cramer's rule15

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    17/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Gauss Elimination16

    |

    |

    From the given system of equations ,

    (1) Compose the

    (2) Forward eliminate the augmented matrix into a

    via a series of row operations(3) Obtain solut

    A x b

    A b

    U b

    augmented matrix

    row

    echelon form

    1

    1( 1)..1

    nn

    nn

    n

    i i ij j

    j iii

    bx

    u

    x b u x i nu

    ion by backward substitution with the

    formula

    , then

    for

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    18/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Gauss-Jordan Elimination17

    |

    |

    From the given system of equations ,

    (1) Compose the

    (2) Forward eliminate the augmented matrix into a

    via a series of row operations(3) Obtai

    A x b

    A b

    I b

    augmented matrix

    reduced

    row echelon form1

    i ix b i n =n solution from for to , or x b

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    19/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    3

    3

    n

    n

    (a) Direct solvers that suits A whose dimension is less or equal

    to three are,

    >

    >(b) Direct solvers that suits A whose dimension is greater than

    three are,

    >

    Matrix Inversion

    Cramer's Rule

    Gauss Eli>

    minationGauss- Jordan Elimination

    Remarks on Direct Solution18

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    20/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    1 2 3

    1 2 3 4

    2 3 4

    3 4

    2 3 21

    4 2 11

    2 3 7

    5 2 11

    x x x

    x x x x

    x x x

    x x

    12

    3

    4

    2 3 1 0 211 4 2 1 110 2 1 3 70 0 5 2 3

    x

    x

    x

    x

    A bx

    1 1 2 14 2 1 3 1 0

    2 1 2 1 3 1 1 2 1 3 0 00 5 2 0 5 2

    2 1 34 1 1 35 33 0

    A

    non - singular

    30.272714.54554.09098.7273

    x

    Matrix InversionCramer's Rule

    Gauss EliminationGauss - Jordan Elimination

    Direct

    Solver

    Remarks on Direct Solution

    (continued)19

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    21/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Introduction to MS Excel20

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    22/31

    Dr.Thitaphol HuyananMUT/ENG - PG

    Class

    Overviews21

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    23/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    22

    Table VS WorkSheet

    Text Number Formula

    Row

    Index

    Column

    Index

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    24/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    MS Excel in Big Picture23

    workbook

    worksheet

    range of cells

    cell

    status bar

    name box formula bar

    command bar

    cursor

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    25/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    WorkBook24

    bookname

    navigation bar selection barscrollbars

    WorkbookCollection

    Workbook

    WorksheetHandling Bars

    WorksheetCollection

    Reference

    name

    stored folder

    navigation bar

    selection bar

    scroll bars

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    26/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    WorkSheet25

    selection tab

    columnindex

    column

    row

    rowindex

    sheetname

    WorksheetCollection

    Worksheet

    Format

    Rows

    Range & Cell

    Collection

    Columns

    Reference

    indexes

    widths

    indexes

    heights

    name

    workbook

    background

    selection tab color

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    27/31

    Dr.Thitaphol HuyananMUT/ENG - PG

    Class

    Cell & Range in MS Excel26

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    28/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Overview27

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    29/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Cell Referring28

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    30/31

    MUT/ENG - PG

    ClassDr.Thitaphol Huyanan

    Types of Recorded Data29

    Constant

    Number :

    Text :

    Formula

    Formulas are equations that perform

    calculations on values in a worksheet. A formula

    starts with an equal sign (=). A formula can alsocontain any or all of the following: functions,

    references, operators, and constants.

  • 7/29/2019 MECH0801 Wk 03 Excel Lec

    31/31

    MUT/ENG - PG

    Questions and Discussion30