Presentation is loading. Please wait.

Presentation is loading. Please wait.

WELCOME EF 105 Fall 2006. EF 105 Computer Methods in Engineering Problem Solving Week07: Trig Review and Charts Use of EXCEL.

Similar presentations


Presentation on theme: "WELCOME EF 105 Fall 2006. EF 105 Computer Methods in Engineering Problem Solving Week07: Trig Review and Charts Use of EXCEL."— Presentation transcript:

1 WELCOME EF 105 Fall 2006

2 EF 105 Computer Methods in Engineering Problem Solving Week07: Trig Review and Charts Use of EXCEL

3 Learning Objectives Learn more about functions Learn how to use Trigonometry functions Learn to use tables and graphs as problem solving tools Learn and apply different types of graphs and scales Prepare graphs in Excel Be able to edit graphs

4 Use Excel’s functions Functions TAKE arguments Functions RETURN values You can easily calculate the sum, average, count, etc. of a large number of cells by using a function. A function is a predefined, or built-in, formula for a commonly used calculation. Each Excel function has a name and syntax. The syntax specifies the order in which you must enter the different parts of the function and the location in which you must insert commas, parentheses, and other punctuation Arguments are numbers, text, or cell references used by the function to calculate a value Some arguments are optional

5 Work with the Insert Function button Excel supplies more than 350 functions organized into 10 categories: Database, Date and Time, Engineering, Financial, Information, Logical, Lookup, Math, Text and Data, and Statistical functions You can use the Insert Function button on the Formula bar to select from a list of functions. A series of dialog boxes will assist you in filling in the arguments of the function and this process also enforces the use of proper syntax.

6 Anatomy of Excel Functions =FUNCTION(argument1,argument2,..,argumentN,…) optionalMandatory 1..N-1 Name

7 Define functions, and functions within functions The SUM function is a very commonly used math function in Excel. A basic formula example to add up a small number of cells is =A1+A2+A3+A4, but that method would be cumbersome if there were 100 cells to add up. Use Excel's SUM function to total the values in a range of cells like this: SUM(A1:A100). You can also use functions within functions. Consider the expression =ROUND(AVERAGE(A1:A100),1). This expression would first compute the average of all the values from cell A1 through A100 and then round that result to 1 digit to the right of the decimal point

8 Open the Insert Function dialog box To get help from Excel to insert a function, first click the cell in which you wish to insert the function. Click the Insert Function button. This action will open the Insert Function dialog box. If you do not see the Insert Function button, you may need to select the appropriate toolbar or add the button to an existing toolbar.

9 Examine the Insert Function dialog box This dialog box appears when you click the Insert Function button. It can assist you in defining your function.

10 Use the Insert Function dialog box to enter function arguments This figure depicts how you would enter argument values for the PMT function using the Insert Function dialog box.

11 Recognize optional arguments In the preceding figure, note how rate and nper are arguments for each function. For some of the functions, the final two arguments of each function are in brackets. These represent optional arguments, meaning if you do not enter anything, the default values for these arguments will be used. For example, note the PMT function has fv and type as its final two arguments, which are optional. The assumed values, if no others are supplied, are 0 for both Arguments without brackets do not have default values, so you must supply values or cell references in order for the function to be able to return a value.

12 Create logical functions A function that determines whether a condition is true or false is called a logical function. Excel supports several logical functions such as AND, FALSE, IF, NOT, OR and TRUE. A very common function is the IF function, which uses a logical test to determine whether an expression is true or false, and then returns one value if true or another value if false. The logical test is constructed using a comparison operator that compares two expressions to determine if they are equal, not equal, if one is greater than the other, and so forth. The comparison operators are =, >, >=, You can also make comparisons with text strings. You must enclose text strings within quotation marks.

13 Using the If function The arguments for the IF function are: IF(logical_test,value_if_true,value_if_false) For example, the function =IF(A1=10,20,30) tests whether the value in cell A1 is equal to 10 If it is, the function returns the value 20, otherwise the function returns the value 30 Cell A1 could be empty or contain anything else besides the value 10 and the logical test would be false; therefore, the function returns the value 30 To insert an IF function, click the Insert Function button and search for the IF function, then click OK. When the Function Arguments dialog box appears, simply fill in the arguments.

14 The TODAY and Now functions The TODAY and NOW functions always display the current date and time. You will not normally see the time portion unless you have formatted the cell to display it. If you use the TODAY or NOW function in a cell, the date in the cell is updated to reflect the current date and time of your computer each time you open the workbook. Let’s open your saved workbooks from last class and add a logical and a date function!

15 Use a formula to enter the date If you wanted a fixed date to remain in a cell, you would enter that date. If you wanted the date in this cell to always reflect the current date and time when you opened the workbook, you would use the expression =NOW() or =TODAY() as shown in the formula bar in the figure.

16 TRIGONOMETRY FUNCTIONS When solving trigonometric expressions like sine, cosine and tangent, it is very important to realize that Excel uses radians, not degrees to perform these calculations! If the angle is in degrees you must first convert it to radians. There are two easy ways to do this. 1.Recall that  = 180°. Therefore, if the angle is in degrees, multiply it by  /180° to convert it to radians. With Excel, this conversion can be written PI( )/180. For example, to convert 45° to radians, the Excel expression would be 45*PI( )/180 which equals 0.7854 radians. 2.Excel has a built-in function known as RADIANS(angle) where angle is the angle in degrees you wish to convert to radians. For example, the Excel expression used to convert 270° to radians would be RADIANS(270) which equals 4.712389 radians

17 TRIGONOMETRY FUNCTIONS You can use the DEGREES(angle) function to convert radians into degrees. For example, DEGREES(PI( ) ) equals 180. Excel uses several built-in trig functions. Those that you will use most often are displayed in the table below. Note that the arguments for the SIN( ), COS( ) and TAN( ) functions are, by default, radians. Also, the functions ASIN( ), ACOS( ) and ATAN( ) return values in terms of radians. (When working with degrees, you will need to properly use the DEGREES( ) and RADIANS( ) functions to convert to the correct unit.)

18 TRIGONOMETRY FUNCTIONS

19 TRIGONOMETRY FUNCTIONS: Example 1 Say, for instance, we want to know the height of the tree in the figure. We know that if we stand 76 m from the base of the tree (x = 76 m) the line of sight to the top of the tree is 32° with respect to the horizon (  = 32°). We know that Solving for the height of the tree, h, we find (Make these on a “TRIG” sheet of your workbook.)

20 TRIGONOMETRY FUNCTIONS: Example 2 In this next example, we wish to know the launch angle, , of the water ski ramp shown. We are given that A = 3.5 m, B = 10.2 m and  = 45.0°. To find , we can use the Law of Sines which, in this case can be written We can rewrite this equation as  using the equation The screen shot below shows how we used Excel to determine that the launch angle of the ramp is 14.04°.

21 TRIGONOMETRY FUNCTIONS: Example #3 In our final trigonometry example, we will use Excel to examine the trig identity Notice in the screen shot below that this identity holds true when  is given in radians and degrees. Note the units for the angle  are placed in different cells than the numbers. If we place the numbers and the units in the same cell, Excel will not be able to decipher the number and therefore we will not be able to reference the cells for use in any equation!

22 Proper Use of Tables & Graphs Engineers record and present data in two primary formats: Tables and Graphs (Make these on a “TCG” sheet of your workbook.)

23 Tables Tables should always have: Title Column headings with brief descriptive name, symbol and appropriate units. Numerical data in the table should be written to the proper number of significant digits. The decimal points in a column should be aligned. Tables should always be referenced and discussed (at least briefly) in the body of the text of the document containing the table.

24 Table Example

25 Exercise Enter the following table in Excel (Label a sheet in the workbook you’ve been using in class.) You can make your tables look nice by formatting text and borders

26 Graphs Proper graphing of data involves several steps: Select appropriate graph type Select scale and gradation of axes, and completely label axes Plot data points, then plot or fit curves Add titles, notes, and or legend

27 Graphs - Types 1. Pie Chart 2. Bar Graph

28 Graphs - Types 4. Line Graph Body Temperature ( 0 C Speed (m/s) Distance (m) 3. 3-D Graph

29 Graphs Each graph must include: A descriptive title which provides a clear and concise statement of the information being presented A legend defining point symbols or line types used for curves needs to be included Labeled axes Graphs should always be referenced/discussed in the body of the text of the document containing the table.

30 Titles and Legends Each graph must be identified with a descriptive title The title should include clear and concise statement of the information being presented A legend defining point symbols or line types used for curves needs to be included

31 Axis Labels Each axis must be labeled The axis label should contain the name of the variable and its units. The units can be enclosed in parentheses, or separated from the label by a comma. Length (km)

32 Gradation Scale gradations should be selected so that the smallest division of the axis is an integer power of 10 times 1, 2, or 5. Exception is units of time. Scale Graduations, Smallest Division=1 Acceptable Scale Graduations, Smallest Division=3.33 Not Acceptable

33 Data Points and Curves Data Points are plotted using symbols The symbol size must be large enough to easily distinguish them A different symbol is used for each data set Data Points are often connected with lines A different line style is often used for each data set

34 Example Velocity of Three Runners During a 5 km Race

35 Building a Graph In Excel Select the data that you want to include in the chart by dragging through it with the mouse. Then click the Chart Wizard

36 Choose XY (Scatter), with data connected by lines if desired. Click “Next” Building the Graph

37 Make sure that the series is listed in columns, since your data is presented in columns. Click the Series tab to enter a name for the data set, if desired. Choose “Next”

38 Building the Graph Fill in Title and Axis information “Next”

39 Building a Chart Select “As new sheet” to create the chart on it’s own sheet in your Excel file, or “As object in” to create the chart on an existing sheet “Finish”

40 Creating a Secondary Axis This is useful when the data sets cover very different ranges. Right click on the line (data series) on the chart that you want to associate with a secondary axis. Select “format data series” Select the Axis tab, then “Plot series on secondary axis” as shown. “OK”

41 Editing/Adding Labels Now you can go back to the “chart options” to add labels Click the chart in a blank area, then either right click and select chart options or choose chart options from the “Chart” menu Fill in or edit the axes labels, title, etc. Click “OK”

42 Result

43 A Baseball Problem A runner is on 3 rd base, 90 ft from home plate. He can run with an average speed of 27 ft/s. A ball is hit to the center fielder who catches it 310 ft from home plate. The center fielder can throw the ball no faster than 110 ft/s. The runner tags up and runs for home plate.  Can the center fielder throw him out? To do so, he must get the ball to the catcher at an appropriate height before the runner can get to home plate.  If so, at what angle and what velocity does he need to throw the ball in order to put the runner out? (Make these on a “Baseball” sheet of your workbook.)

44 Graphic Translation Runner 90 ft Center Fielder 310 ft  V0V0

45 Solving with Excel-Iteration Method Open an Excel spreadsheet and create column heads like the example. Rows 1 - 6 are for constants. Remember to use the $ notation when reference absolute address

46 Solutions - Building a Table Rows 7 and above can be used to calculate the x and y positions at different times t using the formula for projectile motion. For example, under x(t) in Cell B8 enter the formula: = $B$4*cos($C$2)*A8 What formula would be entered for y(t) (height)and r(t) (runner position)? Is there an easy way to enter the values for time beginning in Cell A8?

47 Solution - iterations Notice how changing Cell B2 effects the rest of the spreadsheet, especially x(t) and y(t) columns. By watching the results in those columns, you can get arbitrarily close to 310 and 0. Also Cell B4 can be changed for even finer tuning.

48 Solution - Using a Chart Another way to solve this problem is with a graph. This method will use the data generated on the previous slides but will use a chart to show the result. The next slide shows a completed chart. Notice that the line shows the ball position reaches 310 ft before the runner has traveled 90 ft.

49

50 Building a Chart (Step 1) Select the data that you want to include in the chart by dragging through it with the mouse.

51 Building a Chart (Step 2) click the chart wizard.

52 Choose XY (Scatter) Then choose “Next” Building a Chart (Step 3)

53 Building a Chart (Step 4) Make sure that the series is listed in columns. Choose “Next”

54 Building a Chart (Step 5) Fill in Title and Axis information “Next”

55 Building a Chart (Step 6) Choose “As new sheet”, then “Finish”

56 Building a Chart (Step 7) Creating a Secondary axis. Right click on the data series that you want to associate with a secondary axis. Right click and choose “format data series. Select “Plot series on secondary axis”

57 Building a Chart (Step 8) Select “Chart”, then “Chart Options” Fill in the title for secondary value (Y) axis. Click “OK” This should complete the chart.

58 Using Solver Select and copy the first 8 rows of the first 4 columns of the spread sheet. Remember that Row 8 contains the formulas for calculating the x, y and r positions.

59 Using Solver Select another worksheet from the bottom of the spreadsheet Right click on its label and rename if desired. Select Cell A1 Paste.

60 Using Solver Pull down Tools, then select solver. Set Target Cell Desired Value Manipulated Cells Constraints Select Solve

61 Using Solver Solver arrives at a solution that is within the constraints.  = 28.31 degrees V 0 = 110 ft/s t = 3.20 seconds. The ball is at home plate two feet off the ground while the runner is still 3.58 feet away.

62 Helpful Hint Note that any cell can be assigned a name. This can be done by first clicking on the cell (say B4) and then typing the name in the name box (above the column A label). This can be very useful when that cell is used as an absolute address.

63 Helpful Hint The name can then be used when typing formulas. This creates a formula that looks more like the actual equation making it easier to type and to verify. In this example the cell names, Vo_solver, theta_solver, and time were used instead of $B$4, $C$2, $A$8.

64 Next, 1. Do the Tutorial, Part 2 on your own 2. Solve the following on your own: A. What is the length of horizontal base of the triangle? (cm) B. What is the area of this triangle? (sq. cm)


Download ppt "WELCOME EF 105 Fall 2006. EF 105 Computer Methods in Engineering Problem Solving Week07: Trig Review and Charts Use of EXCEL."

Similar presentations


Ads by Google