Spreadsheet Tools for Engineers Using Excel
Spreadsheet Tools for Engineers Using Excel. CIVE 1331 Fall 2008 Hanadi Rifai. Chapter 1. Engineering Analysis and Spreadsheets. Engineering Analysis and Spreadsheets.
Spreadsheet Tools for Engineers Using Excel
E N D
Presentation Transcript
Spreadsheet Tools for EngineersUsing Excel CIVE 1331 Fall 2008 Hanadi Rifai
Engineering Analysis and Spreadsheets • Engineering analysis is a systematic process for analyzing and understanding problems that arise in the various field of engineering • To carry out this process, we use problem solving techniques • Spreadsheet programs can be used to solve the problem once you have defined it and set it up properly
Spreadsheets allow you to: • Import, export, store, process, and sort data • Display data graphically • Analyze data statistically • Fit algebraic equations through datasets • Solve single and simultaneous algebraic equations • Solve optimization problems
Examples Book Example 1.1
General Problem Solving Techniques • Think about the problem before you solve it • Draw a sketch to visualize it • Understand the overall purpose of the problem and its key points • Ask yourself: what information is known? And what information must be determined? • Ask yourself: what fundamental engineering principles apply?
General Problem Solving Techniques – Cont’d • Think about how you will solve the problem • Develop your solution in an orderly and logical manner • Think about the solution: does it make sense? • Make sure solution is clear and complete Problem solving is a skill that takes time and practice
Engineering Fundamentals • Equilibrium (e.g., force, flux or chemical equilibrium) • Conservation laws (mass, energy) • Rate phenomena
Mathematical Solution Procedures • Data Analysis • Curve-fitting • Interpolation • Solving single algebraic equations • Solving simultaneous algebraic equations • Evaluating integrals • Engineering economic analysis • Optimization techniques
Spreadsheet Basics • basically a table containing numeric or alphanumeric values • Individual elements are called cells • Cells can contain a number or text • A cellreference is its column heading and row number, e.g., B3 • Tabular collection of cells is called a worksheet • Cells contain numbers resulting from formulas
Definitions • Ribbon: upper portion of the window • Title Bar: top line • Office Button: replaced the File Menu • Ribbon Tabs: below title bar, replaced menu headings • Worksheet Tabs: beneath worksheet • Scroll bars: horizontal and vertical • Status bar: bottom line
Skills to learn in Excel • Moving around the worksheet • Entering data • 2, -6, 3.33, 2.55e-12, -7.08e+6, 0.0, 0.004 • $25, 50%, 5/24/2006, 7:20 PM, 19:20:00 • Entering strings or label (text) • Correcting errors • Using formulas and functions • Naming a cell or worksheet • Saving, retrieving and printing worksheets
Operators in Excel • Arithmetic: +, -, *, /, ^, % • String: & • Comparison: >, >=, <, <=, =, <> • Operator precedence: • 1 percentage (%) • 2 exponentiation (^) • 3 Multip/division (* and /) • 4 Add/subtract (+ and -) • 5 concatenation (&) • 6 comparisons (>, <, …) • Operations carried out from left to right
Functions in Excel • Function consists of a: • Function name • Arguments Example: SUM(C1,C2,C3) The function is the sum of cells C1,C2,C3
Examples Book Examples 2.4 &2.5
More skills to learn in Excel • Selecting a block of cells • Clearing a block of cells • Copying to adjacent cells by dragging • Copying to nonadjacent cells • Moving a block of cells • Undoing changes
Copying and Moving Formulas Relative vs. Absolute addressing A1+B1 vs. $A$1+$B$1 Moving a formula will not change cell addresses but copying does C1=A1+B1 If A1 is moved to B5 then C1=B5+B1 If an object cell is moved, the formula is changed to reflect the move
Yet more skills to learn in Excel • Inserting and deleting rows and columns • Inserting or deleting cells • Adjusting column width or row height • Formatting data items • Hyperlinks • Displaying cell formulas
The IF Function • Requires 3 arguments: logical expression, value for true, value for false • =IF(C1>100, “Too Big”, “Ok”) • Nested IF functions: =IF(A3<0, “Ice”, IF(A3<100, “Water”, “Steam”))
Example Book Example 4.2
Examples Book Examples 5.1&5.3
Data Analysis - Statistics • Engineers gather data to measure variability or consistency • Example: diameters of ball bearings off an assembly line • Another example: variation in sizes among customers to determine how many items of each size to manufacture Statistical data analysis tells us about data
Data Characteristics • Mean or average: expected behavior • Median: a value such that half the data values lie above and half lie below 8, 10, 12, 14, 16, 18, 22, 25, 29 5, 8, 12, 16, 18, 22, 27, 29 • Mode: value that occurs the most in a data set 10, 5, 8, 9, 3, 10, 7 Mode is 10 Median is 17
More Data Characteristics • Min and Max: smallest and biggest value in a dataset • Variance: an indication of the degree of spread in the data s2 = 1/(n-1)*(xi-xm)2 where xm is mean and the summation is for all I from 1 to n • The greater the spread in the data, the larger the variance • Standard deviation: square root of the variance
Example Book Example 6.1
Histogram or relative frequency plot • Describes how data are distributed within their range • Cumulative distribution allows us to estimate the likelihood that a data value associated with an item drawn at random is less than or greater than a specified value
How to construct a histogram • Subdivide the range of the data into a series of adjacent equally spaced intervals • 1st interval begins at smallest value • Last interval extends to or beyond the largest data value (the max) • Fixed interval width • Detemine how many values fall in each interval fi = ni/n where ni is the # of points in the ith interval
Examples Book Examples 6.3, 6.5, & 6.6
Fitting Equations to Data • Statistics and Histograms analyze a set of single-value data: x1, x2, etc. • Engineers need to analyze two-value or paired (x,y) data • Different Methods: • Linear Interpolation • Fitting data with a curve
Linear Interpolation y2 P2 y y2-y1 y – y1 = x – x1 x2-x1 P1 y1 x1 x x2
Example Book Example 7.2
Curve Fitting • Fitting a line or curve through pairs of data • Concept is to represent data with an equation (y = f(x)) • Fit does not have to be exact • Goal is to minimize the error somehow between the line and the data (error between yi and y)
Error in Curve Fitting • For each data point Pi = (xi, yi), the error is the difference between yi and F(xi) or the calculated value of yi • ei = yi – f(xi) • Strategy is to pick a function f(xi) that minimizes ei
Straight Line Fit • Method of Least Squares • Y = ax +b • Two unknowns: a and b have to be chosen carefully to minimize the sum of the squares of the errors • Equations 7.7 and 7.8 in book • Two equations in 2 unknowns (a, b)
Examples Book Examples 7.5 & 7.6
Even more skills to learn in Excel • Importing/exporting data from text files • Transferring data from and to Word or PowerPoint • Transferring graphs to Word or PowerPoint
Algebraic Equations • Linear – none of the unknowns are raised to a power or appear as arguments in a trig function, a log function, a square root etc. • Nonlinear – harder to solve
Finding Numerical Solutions Using Excel • Goal Seek • Solver
Examples Book Examples 11.5 & 11.7
n-linear Equations in n unknowns a11x1 + a12x2 +a13x3+….+a1nxn = b1 a21x1 + a22x2 + a23x3+….+a2nxn = b2 …. …. …. an1x1 + an2x2 + an3x3+….+annxn = bn i = row j = column aij’s and b’s are known xi’s are unknown
Matrix • Is a two dimensional array of numbers • Elements characterized by a row number and a column number • A matrix with one column is called a vector • System of equations on previous slide can be written as: AX = B