Вы находитесь на странице: 1из 25

Introduction & Basic Engineering Calculations using Microsoft Excel 2007

Presented by: AZIZUL AZRI BIN MUSTAFFA


B.Sc.(Chem.Eng.)(Hons.), M.Sc.(Chem.Eng.)(UTM)

and ZAKI YAMANI ZAKARIA


B.Sc.(Chem.Eng.)(Hons.)(Bradford), M.Sc.(Chem.Eng.)(UTM)

9/22/2008 ENGINEERING THE RESOURCES

ATTENTION

Please pay your attention to the lecture being given No internet during this class Fill in the attendance fast without delay

9/22/2008

ENGINEERING THE RESOURCES

SURVEY
Do you know what is Microsoft Excel? Do you have any basics with this software? What do you usually use this software for?

9/22/2008

ENGINEERING THE RESOURCES

ADVANTAGES
Managing data and organizing lists by creating tables and forms Manipulating data using functions Creating graphs and charts Database management Statistical analysis Financial analysis Programming using Visual Basic (VBA)
9/22/2008 ENGINEERING THE RESOURCES 4

INTRODUCTION
SPREADSHEET Rectangular grid composed of addressable units called cells Cell is addressed by referencing its column letter and row number A cell may contain numerical data, textual data or formulas

9/22/2008

ENGINEERING THE RESOURCES

INTRODUCTION (contd)

Column C

Cell C8

Row 8

9/22/2008

ENGINEERING THE RESOURCES

HOW TO START
First click the button on the right bottom corner of your desktop interface Then click the button Next click on the Microsoft Office icon and click on Microsoft Office Excel 2007 icon

9/22/2008

ENGINEERING THE RESOURCES

HOW TO START (contd)


Then this Microsoft Excel interface will appear in a few seconds

9/22/2008

ENGINEERING THE RESOURCES

THE EXCEL SCREEN


Tab list Commands that displays a different ribbon, Quick access toolbar Title bar name of the programsimilar to a menu Displays the and current workbook Minimize application button A toolbar that you customize Application close button Formula bar
to hold commonly used commands

Office button
This button leads to lots of options for working with your documents

When you enter information or formulas into Excel, they appear in this line

Clicking this button closes Excel

Ribbon

Main location to find Excels commands. Clicking an item in the Tab List changes the ribbon that is displayed

Name box
Displays the active cell address or the name of the selected cell, range or object

Window close button Maximize/Restore button Clicking this button closes the active workbook window Minimize window button

Vertical scrollbar Active cell indicator Column letters Row The dark outline indicates the currently active cell Letters range from A to IXFD. You can click a Numbers range numbers from 1 to 1,048, 576. You can click a column heading to select entire column
Row number to select entire row

Cells Sheet tab scroll button Status bar


Displays various messages

Horizontal scrollbar

Sheet tabs
Represents a different sheet in the workbook

Page view buttons

Zoom control
9

Change the way the worksheet is displayed

9/22/2008

ENGINEERING THE RESOURCES

TAB LISTS & RIBBONS


HOME: This tab contains the basic Clipboard command, formatting commands, style commands, commands to insert and delete rows or columns, plus an assortment of worksheet editing commands

INSERT: Select this tab when you need to insert something in a worksheet a table, a diagram, a chart, a symbol and so on.

9/22/2008

ENGINEERING THE RESOURCES

10

TAB LISTS &RIBBONS (contd)


PAGE LAYOUT: This tab contains commands that affect the overall appearance of your worksheet including settings that deal with printing

FORMULAS: Use this tab to insert a formula, name a range, access the formula auditing tools or control how Excel performs calculations

9/22/2008

ENGINEERING THE RESOURCES

11

TAB LISTS &RIBBONS (contd)


DATA: Excels data-related commands are on this tab

REVIEW: This tab contains tools to check spelling, translate words, add comments, or protect sheets

VIEW: Contains commands that control various aspects of how a sheet is viewed.

9/22/2008

ENGINEERING THE RESOURCES

12

POINTERS
There are many types of pointers in Excel and each of them have different functions o This pointer is to select and activate cells

o These pointers are to adjust the width and height of the cells manually

9/22/2008

ENGINEERING THE RESOURCES

13

POINTERS (contd)
o This pointer is to adjust the text or formula that has been typed in certain cells.

o The function of this pointer is to copy the content of the active cell so that the other cells beside the active cell will be inserted with the information from the active cell

9/22/2008

ENGINEERING THE RESOURCES

14

POINTERS (contd)
o This pointer is to transfer the content of any cell to any new location.

9/22/2008

ENGINEERING THE RESOURCES

15

FORMULAS & FUNCTIONS


The ability to manipulate formulas, arrays and mathematical functions is the most important feature of Excel for engineers To test and refine potential solutions to a problem To solve mathematical problems Use values stored in various cells to calculate new values The formulas used to calculate the new values must refer to the values in other cells
9/22/2008 ENGINEERING THE RESOURCES 16

FORMULAS & FUNCTIONS (contd)


A formula can consist of any of these elements Mathematical operators, such as + (for addition) and * (for multiplication) Cell references (including name cells and ranges) Values or text Worksheet functions (such as SUM or AVERAGE) NOTE: Formulas always begin with the equal sign so that Excel can distinguish the from text
9/22/2008 ENGINEERING THE RESOURCES 17

FORMULAS & FUNCTIONS (contd)


Operators Used in Formulas
Operator + * / ^ & = > < >= <= <>
9/22/2008

Name Addition Subtraction Multiplication Division Exponentiation Concatenation Logical comparison (equal to) Logical comparison (greater than) Logical comparison (less than) Logical comparison (greater than or equal to) Logical comparison (less than or equal to) Logical comparison (not equal to)
ENGINEERING THE RESOURCES 18

FORMULAS & FUNCTIONS (contd) Exercise 1

Please calculate the area and perimeter of a square given the length and width using formula
9/22/2008 ENGINEERING THE RESOURCES 19

Using Cell References in Formulas


Relative: The row and column references can change Absolute: The row and column references do not change Mixed: Either the row or column reference is relative, and the other is absolute

9/22/2008

ENGINEERING THE RESOURCES

20

Using Cell References in Formulas (contd) (cont Using mixed cell reference (C3 = $B3*C$2)

9/22/2008

ENGINEERING THE RESOURCES

22

P=

RT

FORMULAS & FUNCTIONS (contd) Exercise 2


Calculate the pressure (atm) of a gas at various temperatures (550, 560, 570, 580, 590, 600, 610 Kelvin) and molar volumes (0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.40, 0.45, 0.50 L/mol) assuming that the gas is in ideal condition, Given, R = 0.082058 L.atm/(mol.K)

. P =_____ V

RT

9/22/2008

ENGINEERING THE RESOURCES

23

FORMULAS & FUNCTIONS (contd)


FUNCTIONS: Enable you to greatly enhance the power of your formulas and perform calculations that are difficult if you use only the operators discussed previously Example: AVERAGE, SUM, TAN, SIN etc

9/22/2008

ENGINEERING THE RESOURCES

24

FORMULAS & FUNCTIONS (contd)


HOW to use the function?

Click the function icon and select the function that you want to use
9/22/2008 ENGINEERING THE RESOURCES 25

FORMULAS & FUNCTIONS (contd)


Exercise 3 Calculate Sum, Average, Count, Min and Max using FUNCTION

9/22/2008

ENGINEERING THE RESOURCES

26

FORMULAS & FUNCTIONS (contd)


Exercise 4
A chemical reaction is in the form of A Product, starting with pure A in the reactor and keeping the reactor constant at 45OC. After 2 minutes a sample was drawn from the reactor and analyzed to determine X, the percentage of the A that has reacted. 10 run were successfully done. Please estimate the true value of X.
Reactor Sample tap

Analyzer X (% conversion)

V-1

Run 1 2 3 4 5 6 7 8 9 10 X (%) 67.1 73.1 69.6 67.4 71.0 68.2 69.4 68.2 68.7 70.2

9/22/2008

ENGINEERING THE RESOURCES

27

(cont FORMULAS & FUNCTIONS (contd)


Range, Sample Variance and Standard Deviation are used to express the extent to which values of a random variable scatter about their mean value Refer page 18 (2.5d and Figure 2.5-1 of Felder book for details
Example The volumetric flow rate of a process fluid, V is measured 5 times, with the following results:

Measurement 1 2 3 4 5 3/s) V (cm 232 248 227 241 239


Calculate the sample mean, sample variance and sample standard deviation
9/22/2008 ENGINEERING THE RESOURCES 28

(cont FORMULAS & FUNCTIONS (contd)

9/22/2008

ENGINEERING THE RESOURCES

29

(cont FORMULAS & FUNCTIONS (contd)

9/22/2008

ENGINEERING THE RESOURCES

30

CHARTS & GRAPHS


CHART: Visual representation of numerical values Useful for summarizing a series of numbers and their relationships Can spot trends and patterns of data Must have data/numbers before creating charts Data-stored in the cells in the worksheet
9/22/2008 ENGINEERING THE RESOURCES 31

CHARTS & GRAPHS (contd)


CREATING A CHART Make sure that your data is appropriate for a chart Select the range that contains your data Select a chart type by clicking a chart icon in the INSERT CHARTS

9/22/2008

ENGINEERING THE RESOURCES

32

CHARTS & GRAPHS (contd)


Exercise 5

9/22/2008

ENGINEERING THE RESOURCES

33

CURVE FITTING a straight line


In mathematical equation, you will encounter with a dependant variable and an independent variable The independent variable is a variable whose value determines the value of the dependent variables. Independent variable is plotted on the X axis, and the dependent variable is plotted on the Y-axis. Other variables may also be present in equations. These may be constants or other variables. They may be given to you or you may be required to obtain them by performing curve fitting.

9/22/2008

ENGINEERING THE RESOURCES

34

CURVE FITTING a straight line


Example
Equation y = mx + C (straight line equation) y = dependent variable x = independent variable m and C = constants Data set and graph:

9/22/2008

ENGINEERING THE RESOURCES

35

(cont CURVE FITTING a straight line (contd)


When the dependent and independent variables are plotted as shown in graph, m and C values are obtained by adding a best fit line through the data points. m is the slope of the equation, and C is the y-intercept. Adding a best-fit line in Excel can be done by using the Add Trendline. Step 1 (Add data set in Excel)

9/22/2008

ENGINEERING THE RESOURCES

36

(cont CURVE FITTING a straight line (contd)


Step 2 (Make a graph from the given data use XY scatter)

9/22/2008

ENGINEERING THE RESOURCES

37

(cont CURVE FITTING a straight line (contd)


Step 3 (Add trendline & select linear trend/regression type)

Put a check on Display equation on Chart and Display R squared value

on chart
9/22/2008 ENGINEERING THE RESOURCES 38

(cont CURVE FITTING a straight line (contd)

Best fit equation

The equation displayed for the best-fit line shows m (slope) to be 2 and C (y-intercept) to be 50.

9/22/2008

ENGINEERING THE RESOURCES

39

Curve Fitting - LINEST Function


To calculate the statistics that describe a linear trend matching known data points, by fitting a straight line using the least squares method (without creating a graph) Step 1 (Highlight both cell D5 & E5)

9/22/2008

ENGINEERING THE RESOURCES

40

(cont Curve Fitting - LINEST Function (contd)

Step 2 (Insert =LINEST(B2:B7,A2:7,1))

9/22/2008

ENGINEERING THE RESOURCES

41

(cont Curve Fitting - LINEST Function (contd)

Step 3 (Press Ctrl + Shift + Enter)

9/22/2008

ENGINEERING THE RESOURCES

42

CURVE FITTING a straight line


Exercise 6
Fitting a straight line to Flow meter Calibration Data
Rotameter calibration data (flow rate vs rotameter reading are as follows: Flowrate, V Rotameter reading,
(L/min) 20.0 52.1 84.6 118.3 151.0 R 10 30 50 70 90

a) Draw a calibration curve and determine an equation for V (R) b) Calculate the flow rate that corresponds to a rotameter reading of 36 c) Determine the constants using the LINEST function
9/22/2008 ENGINEERING THE RESOURCES 43

CURVE FITTING Nonlinear Data


If the data is not linear and we wish to linearize it Calculate the f(y) and g(x) for each tabulated (x,y) Plot f(y) versus g(x) If the plotted points fall on straight line, the equation fits the data Several examples plot that yields straight lines (1) y = ax2 + b (2) y 2 = a/x + b (3) sin (y) = a(x2 - 4) Plot Plot Plot

y versus x 2 y 2 versus 1/x sin (y) versus (x2 - 4)

9/22/2008

ENGINEERING THE RESOURCES

44

(cont CURVE FITTING Nonlinear Data (contd)

Other two nonlinear function that normally occur are exponential function y = aebx or y = a exp (bx) power law y = axb

y = a exp (bx) => ln y = ln a + bx semilog plot Plot ln y versus x. Slope = b, intercept = ln a Both ln y vs x plotted on rectangular graph and y vs x plotted on semilog graph should yield a straight line y = axb => ln y = ln a + b ln x log plot Plot ln y versus ln x. Slope = b, intercept = ln a Both ln y vs ln x plotted on rectangular graph and y vs x plotted on log graph should yield a straight line

*Drawing using semilog and log plot can save time and work
9/22/2008 ENGINEERING THE RESOURCES 45

The Method of Least Squares


1 n xi n i =1

sx=

s xx =

1 n 2 xi n i =1

sy=

1 n yi n i =1

s xy =

1 n xi yi n i =1

Slope:

a=

s xy s x s y s xx ( s x ) 2 s xx s y s xy s x s xx ( s x ) 2

Intercept:

b=

See page 608 Example A.1-1. Redo the calculation in excel. A.1-

9/22/2008

ENGINEERING THE RESOURCES

46

FINDING ROOTS
2x2 5x 12 = 0
How to find the roots of x using Excel?

Trial and error method by guessing x value


9/22/2008 ENGINEERING THE RESOURCES 47

FINDING ROOTS Using Goal Seek (1)

1st Root

9/22/2008

ENGINEERING THE RESOURCES

48

FINDING ROOTS Using Goal Seek (2)


Guess another x-value to find the next root. x-

2nd Root

9/22/2008

ENGINEERING THE RESOURCES

49

FINDING ROOTS Using Goal Seek (3) Exercise 7 Solve the root for the quadratic equation given using goal seek function in Excel a) b) c) d) e)
9/22/2008

x2 + 3x 10 = 0 6x2 + 1x 2 = 0 x2 10x + 9 = 0 3x2 2x + 9 = 0 2x2 5x + 1 = 0


ENGINEERING THE RESOURCES 50

THANK YOU
LETS DISCUSS, DO SOME EXERCISES AND YOU CAN EVEN EXPLORE EXCEL MORE BY YOURSELF GOOD LUCK !!

9/22/2008

ENGINEERING THE RESOURCES

51

Вам также может понравиться