Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W. 13-15 Th. 13-15, F. 13-15.

Slides:



Advertisements
Similar presentations
Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
Advertisements

Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
Matrices: Inverse Matrix
Refresher: Vector and Matrix Algebra Mike Kirkpatrick Department of Chemical Engineering FAMU-FSU College of Engineering.
3_3 An Useful Overview of Matrix Algebra
MF-852 Financial Econometrics
Maths for Computer Graphics
Chapter 2 Basic Linear Algebra
Review of Matrix Algebra
Matrix Commands in Excel Anthony Murphy Nuffield College
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Linear Simultaneous Equations
Pam Perlich Urban Planning 5/6020
Matrix Mathematics in MATLAB and Excel
Finding the Inverse of a Matrix
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Copyright © Cengage Learning. All rights reserved. 7.6 The Inverse of a Square Matrix.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Warm-Up Solving Systems of Equations Learning Targets l Refresher on solving systems of equations l Matrices –Operations –Uses –Reduced Row Echelon.
Excel – Lesson 1 Pasewark & PasewarkMicrosoft Office 2007: Introductory 1 Entering a Formula (continued) Formulas can include more than one operator. The.
Chapter 10 Review: Matrix Algebra
3.5 Solution by Determinants. The Determinant of a Matrix The determinant of a matrix A is denoted by |A|. Determinants exist only for square matrices.
ECON 1150 Matrix Operations Special Matrices
Equation --- An equation is a mathematical statement that asserts the equality of twomathematicalstatement expressions. An equation involves an unknown,
 Row and Reduced Row Echelon  Elementary Matrices.
Rev.S08 MAC 1140 Module 10 System of Equations and Inequalities II.
XP Excel Tutorial 3 Working with Formulas and Functions.
Presentation by: H. Sarper
AGB 260: Agribusiness Information Technology Arrays and Array Formulas.
4.4 & 4.5 Notes Remember: Identity Matrices: If the product of two matrices equal the identity matrix then they are inverses.
Using Matrices to Solve Systems of Equations Matrix Equations l We have solved systems using graphing, but now we learn how to do it using matrices.
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
Lecture 28: Mathematical Insight and Engineering.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
AGB 260: Agribusiness Information Technology Arrays and Array Formulas.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
4.4 Identify and Inverse Matrices Algebra 2. Learning Target I can find and use inverse matrix.
Absolute cell reference
ME 142 Engineering Computation I Matrix Operations in Excel.
PERFORMING CALCULATIONS Microsoft Excel. Excel Formulas A formula is a set of mathematical instructions that can be used in Excel to perform calculations.
ME 142 Engineering Computation I Matrix Operations in Excel.
Introduction to Excel Lecture 3. Excel basics O Excel is a software program that can make number manipulation easy O It is also referred as a spreadsheet.
Matrices. Matrix - a rectangular array of variables or constants in horizontal rows and vertical columns enclosed in brackets. Element - each value in.
Matrix Algebra Basics Chapter 3 Section 5. Algebra.
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
10.4 Matrix Algebra. 1. Matrix Notation A matrix is an array of numbers. Definition Definition: The Dimension of a matrix is m x n “m by n” where m =
Matrices IB Mathematics SL. Matrices Describing Matrices Adding Matrices.
Matrices Introduction.
College Algebra Chapter 6 Matrices and Determinants and Applications
12-4: Matrix Methods for Square Systems
MAT 322: LINEAR ALGEBRA.
AGB 260: Agribusiness Data Literacy
Excel Tutorial 3 Working with Formulas and Functions
CGN 2420 Matrix Operations in Excel
Chapter 7 Matrix Mathematics
Excel Part 3 Working with Formulas and Functions
L9Matrix and linear equation
Matrix Algebra.
Chapter 7: Matrices and Systems of Equations and Inequalities
Dr Huw Owens Room B44 Sackville Street Building Telephone Number 65891
Method 1: Substitution methods
Matrices.
Matrix Algebra.
Excel Tutorial 3 Working with Formulas and Functions
6.3 Using Elimination to Solve Systems
Presentation transcript:

Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F

Outlines 1. Microsoft Excel basic function 2. Matrix (basic theory) 3. Matrix operation in excel 4. The application of Matrix in Chem. Eng

Basic function Using Relative References Cell references are used in formulas, functions, charts, and other Excel commands.formulascharts By default, a spreadsheet cell reference is relative. What this means is that as a formula or function is copied and pasted to other cells, the cell references in the formula or function change to reflect the function's new location.function

Basic function Using Absolute References an absolute cell reference identifies the location a cell or group of cells.cell An absolute cell reference consists of the column letter and row number surrounded by dollar signs ( $ ).columnrow An absolute cell reference is used when you want a cell reference to stay fixed on a specific cell.

Basic function Using Mixed references

Basic function Entering Relative, Absolute, and Mixed References  To enter a relative reference, type the cell reference as it appears in the worksheet. For example, enter B2 for cell B2  To enter an absolute reference, type $ (a dollar sign) before both the row and column references. For example, enter $B$2  To enter a mixed reference, type $ before either the row or column reference. For example, enter $B2 or B$2 or  Select the cell reference you want to change  Press the F4 key to cycle the reference from relative to absolute to mixed and then back to relative

Basic function -Mathematics function - Statistical function - Logical function - etc

Basic function Mathematics functions abs(CELL): Absolute value of CELLAbsolute value sqrt(CELL): Square root of CELL [to do nth roots, use CELL^(1/n)]Square root ln(CELL): Natural log of CELLNatural log log10(CELL): Log of CELL to base 10 log(CELL, NUM): Log of CELL to the base NUM (use for all bases except e and 10) exp(CELL): Exponential(e^x) of CELL. Use since Excel doesn't have a built- in constant "e".Exponential sin(CELL), cos(CELL), tan(CELL): Trigonometric functions sine, cosine, and tangent of CELL. CELL must be in radiansTrigonometric functions asin(CELL), acos(CELL), atan(CELL): Inverse trigonometric functions (returns values in radians)Inverse trigonometric functions sinh(CELL), cosh(CELL), tanh(CELL): Hyperbolic functionsHyperbolic functions asinh(CELL), acosh(CELL), atanh(CELL): Inverse hyperbolic functions

Basic function Statistical functions average(CELL1, CELL2,...) OR average(GROUP): Computes the arithmetic average of all inputs intercept(GROUP1, GROUP2): Calculates the y-intercept (b) of the regression line where y = GROUP1 and x = GROUP2 slope(GROUP1, GROUP2): Calculates the slope (m) of the regression line where y = GROUP1 and x = GROUP2.

“if” function Working with Logical Functions  A logical function is a function that works with values that are either true or false  The IF function is a logical function that returns one value if the statement is true and returns a different value if the statement is false  IF(logical_test, value_if_true, [value_if_false])

“if” function Working with Logical Functions A comparison operator is a symbol that indicates the relationship between two values

“if” function Working with Logical Functions  =IF(A1="YES", "DONE", "RESTART")  =IF(A1="MAXIMUM", MAX(B1:B10), MIN(B1:B10))  =IF(D33>0, $K$10, 0)

“if” function Working with Logical Functions

Matrix (basic theory) Matrix Mathematics  Matrices are very useful in engineering calculations. For example, matrices are used to: - Efficiently store a large number of values -Solve systems of linear simultaneous equations  Several mathematical operations involving matrices are important

Matrix (basic theory) Review: Properties of Matrices An element of a matrix is usually written in lower case, with its row number and column number as subscripts: The dimension (size) of a matrix is defined by the number of rows and number of columns Examples: 3 × 3:2×4:

Matrix (basic theory) Matrix Operations Matrix Addition Multiplication of a Matrix by a Scalar Matrix Multiplication Matrix Transposition Finding the Determinate of a Matrix Matrix Inversion

Matrix (basic theory) Matrix Addition Vectors must be the same size in order to add To add two vectors, add the individual elements: Matrix addition is commutative: A + B = B + A

Matrix (basic theory) Multiplication of Matrices To multiple two matrices together, the matrices must have compatible sizes: This multiplication is possible only if the number of columns in A is the same as the number of rows in B The resultant matrix C will have the same number of rows as A and the same number of columns as B

Matrix (basic theory) Multiplication of Matrices Consider these matrices: Can we find this product? Yes, 3 columns of A = 3 rows of B What will be the size of C? 2 X 2: 2 rows in A, 2 columns in B

Matrix (basic theory) Example – Matrix Multiplication Solution: In general, matrix multiplication is not commutative: AB ≠ BA

Matrix (basic theory) Transpose of a Matrix The transpose of a matrix by switching its row and columns The transpose of a matrix is designated by a superscript T:

Matrix (basic theory) Determinant of a Matrix The determinant of a square matrix is a scalar quantity that has some uses in matrix algebra. Finding the determinate of 2 × 2 and 3 × 3 matrices can be done relatively easily: The determinate is designated as |A| or det(A) 2 × 2:

Matrix (basic theory) Determinant of a Matrix 3 × 3:

Matrix (basic theory) Inverse of Matrix The inverse of a 2X2 matrix is easy to find:

Matrix (basic theory) The identity matrix a square matrix with 1’s as the diagonal elements and 0’s as the other elements Find A -1, check that A A -1 = I

Matrix Operations in Excel Excel has commands for: Multiplication (mmult) Transpose (transpose) Determinate (mdeterm) Inverse (minverse) Important to remember that these commands apply to an array of cells instead of to a single cell When entering the command, you must identify the entire array where the answer will be displayed Using the Enter key with an array command only returns an answer in a single cell. Instead, use Ctrl + Shift + Enter keys with array functions

Matrix Operations in Excel Excel Matrix Multiplication

Matrix Operations in Excel Excel Matrix Multiplication The MMULT function has two arguments: the ranges of cells to be multiplied. Remember that the order of multiplication is important.

Matrix Operations in Excel Excel Transpose

Matrix Operations in Excel Excel Determinate

Matrix Operations in Excel Excel Matrix Inversion Remember that only square matrices can have inverses

Matrix Operations in Excel Excel Matrix Inversion A X A -1 = I, the identity matrix:

The application of Matrix Solving linear simultaneous equation If equations contain only linear terms of the independent variables – that is, only constants multiplied by each variable – and constants, then the equation is linear If the equation contains any terms such as x 2, cos(x), e x, etc., then the equation is non-linear Linear simultaneous equation

The application of Matrix Solution to Simultaneous Equations Graphical solution Substitution method Elimination method

The application of Matrix Equations in Matrix Form The first step in using matrix methods to solve a series of linear simultaneous equations is to write them in matrix form For n simultaneous equations and n unknowns: where A is the coefficient matrix (n × n); X is the matrix of unknowns (n × 1), and C is the constant matrix (n × 1)

The application of Matrix Solution of System of Linear Equations  Multiply both sides of the equation by the inverse of the coefficient matrix. Remember that the order of multiplication is important.  Since the inverse of a matrix times that matrix is equal to the identity matrix,

The application of Matrix Solution of System of Linear Equations  Since the identity matrix times another matrix is equal to that matrix,  Therefore, we can find the unknown variables by multiplying the inverse of the coefficient matrix by the constant matrix

The application of Matrix Example – 3 Equations Write these equations in matrix form:

The application of Matrix Excel Solution Enter coefficient and constant matrices:

The application of Matrix Excel Solution Enter formula to invert A matrix and multiply the result by the C matrix. This can be done in two steps or with nested commands as shown here:

The application of Matrix Chem. Eng Problem Steady state material balances on a separation train Xylene, styrene, toluene and benzene are to be separated with the array of distillation columns that is shown below where F, D, B, D1, B1, D2 and B2 are the molar flow rates in mol/min.

The application of Matrix Chem. Eng Problem Solution Material balances on individual components on the overall separation train yield the equation set

The application of Matrix