Engineering Problem Solving and Excel EGN 1006 Introduction to Engineering
Mathematical Solution Procedures Commonly Used in Engineering Analysis Data Analysis Techniques (Statistics) Curve Fitting techniques (Looking at Graphs) Interpolation techniques Single and multiple algebraic equations Evaluating Integrals (Evaluate effects over time) Economic Analysis Optimization (Finding the best solution)
Applicable Engineering Fundamentals Most engineering problems are based upon one of three underlying principles: 1. Equilibrium Force, Flux, and Chemical 2. Conservation Laws Energy and Mass 3. Rate Phenomena How something changes over time.
What is a spreadsheet? A spreadsheet is basically a table containing NUMERICAL and/or ALPHANUMERICAL values. Individual elements are known as CELLS. Each CELL can contain a single value or a STRING (sequence of characters) The cells are arranged in columns and rows are referenced by a CELL ADDRESS ( For example, B3 refers to the cell in COLUMN B, row 3. The collection of cells is referred to as a WORKSHEET. A cell can have a manually entered number or be assigned a FORMULA EVALUATION such as C7 being =(C3+C4+C5)
The Excel Window
Entering Data There are two ways to enter data into Excel A simple numerical value called a number constant. A string, called a text constant. When you are finished entering a number in a cell hit ENTER or click the checkmark.
Using Formulas In Excel, a formula MUST always begin with an equal sign (=), followed by an expression involving: Consider: =(C3+B2+5) Constants C3 & B2 are cell addresses Operators 5 is the numerical constant Cell Addresses The (+) sign is the operator This formula could be entered in D7 where the formula would be applied. Note: Any change in C3 or B2 will automatically change D7!
Arithmetic Operators Operator Purpose Example + Addition A1+B1 - Subtraction A1-B1 * Multiplication A1*B1 / Division A1/B1 ^ Exponentiation A1^3 % Percentage A1%
Operator Preference Since some formulas include more than one operator, the question arises as to which one is carried out first. The order is outlined to the right. If any formula has two operators from the same group, the order is carried out from left to right. Operator Preference Operator 1 % 2 ^ 3 * and / 4 + and - For example, in the formula =(C1/D2*E3), the division would be carried out first then multiplication.
A Simple Spreadsheet Application A small machine shop has the following parts on hand: Item Quantity Screws 6500 Nuts 9000 Bolts 5400 Start by creating a worksheet that includes this information, plus the total number of parts on hand. Answer the questions on the worksheet provided.
Using Functions Excel includes many different functions which can carry out a wide variety of operations. They include: Mathematical and statistical operations Process financial data Process AND return text information Each function has a specific name followed by an ARGUMENT enclosed in parenthesis.
Function Examples =Sum(C1,C2,C3) This will add the numbers in the three cell addresses. The ARGUMENT is inside the parenthesis and separated by commas. =Sum(C1:C50) the use of a COLON indicates a RANGE and will add up ALL cells between the two cell addresses.
Other function examples =SQRT(x) Takes square root of x =Min(x1:x20) Returns the minimum # in the set =Max(x1:x20) Returns the maximum # in the set =Round (x,n) Rounds x to n decimal places =Average (x1:x15) Returns the average Example: =sum(a1, SQRT(A2/2),2*B3+5,D7:D12) This example has FOUR arguments as evidenced by the commas
Example #2 Student Exam Scores Create the following worksheet: See paper worksheet Student Exam 1 Exam 2 Final Exam Overall Score Davis 82 77 94 Graham 66 80 75 Jones 95 100 97 Meyers 47 62 78 Richards 80 58 73 Thomas 74 81 85 Williams 57 62 67
Moving things around! You can: Select and Highlight a block of cells Copy a block of cells Move a clock of cells Delete rows or columns Create grids Change font color, fill in backgrounds, etc Adjust column widths
Creating Graphs The easiest way to create a graph in Excel is to use the Chart Wizard! Follow these steps: Select the block of cells containing the data to be plotted. You may include headings! Click on the CHART WIZARD icon Choose the graph type Type in a title And select Chart on this worksheet or As object in
More on Graphs Graphs done on a SEPARATE sheet can easily be copied or pasted into a WORD document. Graphs embedded into worksheet can be edited even after they have been inserted.
Creating and Editing a Line Graph The voltage within an electronic device varies with time in accordance with the formula: V = 10e 0.5 Prepare an Excel worksheet and line graph (scatter) with the data to the right t Seconds Volts 0 10 1 6.07 2 3.68 3 2.23 4 1.35 5 0.82 6 0.50 7 0.30 8 0.18 9 0.11 10 0.07
Editing the graph Once the graph is embedded into the worksheet, click on the graph until the chart toolbox appears Select the drop down menu to add a title and label each axis with units. Also, choose LEGEND then RIGHT CLICK on the small box and choose CLEAR!
Analyzing Data Engineering analysis usually begins with the analysis of data! Engineers gather data to measure VARIABILITY or CONSISTENCY. Measured Data can tell you a great deal if you know how to interpret the results. Let Excel do the tedious work for you so that you can focus on the interpretation of results.
Data Characteristics There are several commonly used parameters that allow us to draw conclusions about the characteristics of a data set. They are: Mean Median Mode Max Min Variance Standard Deviation
Mean, Median, and Mode Mean is the arithmetic average of a data set. It represents expected behavior. AVERAGE( ) is used in Excel Median the value where half of the data falls above and half the data falls below. MEDIAN ( ) is used in Excel Mode the value that occurs with the greatest frequency with in data set. Mode ( ) is used in Excel. If a tie results it will always list the FIRST frequent number it encounters
Min and Max The min and Max simple represent the extremities of the data set. In Excel,the MIN ( ) and Max ( ) functions return these values. NOTE: The MIN and MAX functions return the values that are the smallest and largest ALGEBRAICALLY. They do not return values in terms of MAGNITUDE. Example: ( -5,-2, 1) ; Min = -5 & Max = 1
Variance The variance provides an indication of the degree of SPREAD in the data. The greater the variance, the greater the spread. It is determined by the following formula: Excel uses the VAR( ) function s s x 2 2 n = 1 ( x n 1 i = 1 = variance x = mean i x) n = # of data values i = individual data value 2
Standard Deviation The standard deviation is simply the square root of the variance. s = s 2 = standard deviation So why bother with the standard deviation? The variance is a much more practical value to have but its UNITS are NOT consistent with the mean, median, or mode. Excel use the stdev ( ) command.
Analyzing a data set A car manufacturer wishes to determine how accurately the cylinders are being machined in several engine blocks. The design specification call for a cylinder diameter of 3.500 inches, with a tolerance of +/- 0.005 inches. See paper worksheet
Histograms Thought the previous statistical characteristics can prove useful in interpreting data, it is often more desirable to the plot the data in a manner that illustrates how the values are distributed within their range. This is called a HISTOGRAM or RELATIVE FREQUENCY plot.
More on Histograms To create a histogram, you must first subdivide the range of the data into a series of adjacent, equally spaced intervals. The first interval must begin at or below the smallest value (the min) and the last interval must extend to or beyond the largest data value (the max). These intervals are called CLASS INTERVALS. Then you determine HOW MANY values fall within each interval
The car manufacturer continued The histogram feature is found under TOOLS then choose DATA ANALYSIS. The choose histogram. There are two things the histogram needs: An INPUT RANGE this comes from your data. Click on the Input range box then click on the first cell of the data, hold, and highlight until the last cell is chosen An OUTPUT RANGE this is the interval bounds. Do the same click and hold To see the chart you must click OUTPUT RANGE under OUTPUT OPTIONS and specify where you want the chart located. Click on the cell where you want it to be placed.
The car manufacturer continued Your histogram should look like this!
Relative Frequency Now we can go back and LOOK AT the percentage of values that fell into each interval. These values were found using the following equation: f f n n i i = = = = n i n relative frequency in the interval number of total number of values in that interval values in data set
Cumulative Distribution A histogram can provide a great graphical illustration of how a data set is distributed. A CUMULATIVE DISTRIBUTION is equally important. It provides us ANOTHER graphical way to view the data.but.it allows us to determine the LIKELIHOOD of a RANDOM VALUE being less than or greater than a specified value. It is almost like a percent chance and is the graphical representation of the calculated relative frequency.
Cumulative Distribution Cont To find the cumulative F = f distribution: 1 1 So basically you just sum up the relative frequency using the interval prior. F F 2 3 = = f f 1 1 + + f f 2 2 + f 3... Create a cumulative distribution column using your relative frequency data.
Plotting the Cumulative Distribution Cut the original histogram and Choose TOOLS then data analysis. This time under OUTPUT OPTIONS click on cumulative distribution and chart output Notice that the calculated CD values will appear!
Fixing The Cumulative Distribution Plot The problem with this type of graph is that the bar graph has GAPS in it. Right Click on one of the bars in the graph Choose FORMAT DATA SERIES Click on OPTIONS Change GAP WIDTH to ZERO!
Drawing inferences A engineer can now look at the cumulative distribution and randomly pull a part off of the manufacturing line. The plot will tell him the % likelihood that an arbitrary cylinder diameter within a randomly selected engine block WILL NOT exceed a certain length. For example, what is the likelihood that a cylinder will NOT exceed 3.503 inches?
Fitting Equations to Data The data an engineer collects could reveal: Spatial profile Time history Cause and effect relationship System output as a function of input Mathematical expressions are then used to CAPTURE the relationship shown in the data
Fitting a straight line to a set of data Data is usually represented by values that show some SCATTER, which is due to fluctuations or errors in measurement. Therefore, we NEVER connect the dots on a graph! We pass the points through an AGGREGATE or TRENDLINE. In science, this is probably referred to as a line of best fit.
Force exerted by a spring Data point # Distance (cm) Force (N) 1 2 2.0 2 4 3.5 3 7 4.5 4 11 8.0 5 17 9.5
Making a Trendline Using the data you just entered into EXCEL, use chart wizard to construct a SCATTER plot. Place in WORKSHEET 2. Add title and units to axes. RIGHT CLICK on one of the data points (all should highlight) and choose trendline. Since this plot looks linear, choose LINEAR. The choose OPTIONS and click on ADD equation to chart and ADD R value.
Regression Statistics Excel can also provide a great deal of built in statistics. But they may prove MORE than what you need. Choose TOOLS then DATA ANALYSIS Choose Regression Highlight the appropriate cells and where to place the stats.
Assessing Quality using r 2 The r 2 value helps and engineer assess the QUALITY of the curve fit. Any number close to 1.0 is a good fit. You can think of this value as a %fit. A 1.0 would represent 100%. If the r 2 value is too low, right click on the trendline and change the type to LOGARITHMIC or other type of curve fit. The largest r 2 value is the one that fits the data the best.
The OTHER fitting functions Exponential Logarithmic Power Function Polynomial ( NOTE: By INCREASING the order, you can increase your r 2 value)