Engr/Math/Physics 25 MS Excel Tables/Plots Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engineering/Math/Physics 25: Computational Methods 1 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt The 11 MS Excel Chart Types Engineering/Math/Physics 25: Computational Methods 2 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Graph Construction Demo Given Vapor Pressure Data TABLE I: Vapor Pressure Data Vapor pressures (mm Hg) of less than one atmosphere as a function of temperature. (All temperatures are in degrees Celsius) Chemical 1 5 10 20 40 60 100 200 400 760 Sodium, Na 439 511 549 589 633 662 701 758 823 892 oC 1,4-Dioxane C4H8O2 -35.8 -12.8 -1.2 12.0 25.2 33.8 45.1 62.3 81.8 101.1 oC Acetone (CH3)2CO -59.4 -40.5 -31.1 -20.8 -9.4 -2.0 7.7 22.7 39.5 56.5 oC Butyric Acid, C4H8O2 25.5 49.8 61.5 74.0 88.0 96.5 108.0 125.5 144.5 163.5 oC Stannic Chloride, SnCl4 -22.7 -1.0 10.0 22.0 35.2 43.5 54.7 72.0 92.1 113.0 oC http://research.umbc.edu/~lkelly/DAExp.htm Construct a Scatter Chart to Find the Clapeyron Eqn 1 Constants m & b ln Pv m b T for Stannic Chloride Engineering/Math/Physics 25: Computational Methods 3 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt mmHg Chart Construction Result SnCl4Vapor Pressure 7 12% ln(Pv) (ln[Torr]) ln(Pv) = -4.7201(1000/T) + 18.958 2 R = 0.9992 6 10% Fit Error 8% 5 ln(Pv) (ln[Torr]) 6% 4 4% 3 2% 0% 2 -2% 1 -4% 0 -6% 2.5 2.75 3 3.25 3.5 3.75 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 4 Demo_Excel_Table-n-Chart_Build_Fa06.xls Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 Fit Error = (Fit-Actual)/Actual Linear (ln(Pv) (ln[Torr])) SnCl4 Vapor Press by Clapeyron Eqn 7 12% ln(Pv) (ln[torr]) ln(Pv) = -4.7201*(1000/T) + 18.958 R² = 0.9992 Model Error 6 10% Linear (ln(Pv) (ln[torr])) 8% 5 ln(Pv) (ln[Torr] 4 4% 2% 3 0% 2 -2% 1 -4% 0 -6% 2.5 2.75 3 3.25 Engineering/Math/Physics 25: Computational Methods 1000/T 5 (1/K) 3.5 3.75 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 Clapeyron Model Fit Error 6% All Done for Today Excel Plotting HbH Metering Tube P • Orifice Characteristic • 25Jan00 9 90 1-Hole Back Pressure (SQRT{Torr}) 8 1-Hole Back Pressure (Torr) [1-Hole Back Pressure] ( [Torr]) 70 6 60 5 50 4 40 3 PARAMETERS • Exhaust to Atmosphere • 0.312" O.D. Tube • 9.5 mil holes • Rough, 1st-cut Test • Re = 4q/(d) = 1400 @ q = 0.24 slpm 2 0 0.00 6 0.03 0.06 0.09 0.12 0.15 0.18 0.21 MFC Flow, q (slpm) Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 0.24 0.27 30 20 1-Hole Back Pressure, P ([Torr) 7 1 Engineering/Math/Physics 25: Computational Methods 80 P = 30.471q 2 R = 0.9996 Bernoulli Square Law Behavior 10 0 0.30 file = Tube-Test_00.xls Engr/Math/Physics 25 Appendix f x 2 x 7 x 9 x 6 3 2 5 y 3 y 7 y f t Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Pslave1n hx j Pmaster Engineering/Math/Physics 25: Computational Methods 7 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (1) Start • Open File Demo_Excel_TablenChart_Build_0511.xl s Copy from Table from Slide-22 → Paste into Demo Sheet Horizontal table starting in Col-H Copy Table Cells and EDIT → PASTE SPECIAL → transpose • Need Vertical Data Engineering/Math/Physics 25: Computational Methods 8 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (2) Result after Transpose Paste Engineering/Math/Physics 25: Computational Methods 9 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (3) Archive Data • Make Scratch WorkSheet; Xfer horizontal Table to to this sheet Edit Worksheet • Adjust Headings • Delete Cols other Than SnCl4 • Move Remaining to Right Engineering/Math/Physics 25: Computational Methods 10 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (4) Place in cols A & B After Filling A & B • 1000/T; T in Kelvins • Ln(Pv) Formula for Col-B • =LN(E8) Engineering/Math/Physics 25: Computational Methods 11 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (5) Now need to Sort the Data with the indep var (1000/T) in ASCENDING ORDER • DATA → SORT Engineering/Math/Physics 25: Computational Methods 12 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (6) Highlight/Select Data to Plot Invoke Chart Wizard Engineering/Math/Physics 25: Computational Methods 13 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (7) Continue with Chart Wizard Engineering/Math/Physics 25: Computational Methods 14 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (8) Add X-Grid Lines Insert As NEW Sheet • Give Descriptive Name Remove Legend Engineering/Math/Physics 25: Computational Methods 15 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (9) Chart Wizard Result Stannic Chloride (SnCl4) Vapor Pressure (ln[Torr]) 7 Change 6 • X-axis Scale: 2.5-4 • Shorten Title ln(Pv) (ln[Torr]) 5 4 • Clear BackGround • Lager, Sq Data Markers • GridLine & Text Colors 3 2 1 0 0 0.5 1 1.5 2 2.5 3 3.5 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 16 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 4.5 Chart Construction Demo (10) Select Chart Area Then Right-Clik Engineering/Math/Physics 25: Computational Methods 17 Select X-axis, Ther Right-Clik Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (11) Select Grid Lines, Rt-Clik, Chg Colors Engineering/Math/Physics 25: Computational Methods 18 Select Data Series, Rt-Clik, Chg Marker Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (12) Position Labels at Page Edges → Stretch-Out Plot Area Engineering/Math/Physics 25: Computational Methods 19 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (13) Chart Fine-Tuning Result SnCl4Vapor Pressure 7 Add TrendLine to find Clapeyron m &b Constants 6 ln(Pv) (ln[Torr]) 5 4 3 2 1 0 2.5 2.75 3 3.25 3.5 3.75 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 20 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 Chart Construction Demo (14) Select Data Series, Rt-Clik, Add TrendLn Engineering/Math/Physics 25: Computational Methods 21 Select: Linear, Display Parameters Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (15) Fine Tune TrendLine Form & Display SnCl4Vapor Pressure SnCl4Vapor Pressure 8 8 7 7 6 6 5 5 ln(Pv) (ln[Torr]) ln(Pv) (ln[Torr]) ln(Pv) = -4.7201(1000/T) + 18.958 2 R = 0.9992 4 3 4 3 2 2 1 1 0 2.5 2.75 3 3.25 1000/T (1/Kelvin) 3.5 y = -4.7201x + 18.958 R2 = 0.9992 3.75 4 0 2.5 2.75 3 3.25 3.5 1000/T (1/Kelvin) Done with Plot; and have determined m & b by Trendline • Note that the Fit is Excellent; 2 = 99.92% R Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 22 BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 3.75 4 Chart Construction Demo (16) Add Fitted Data to table Calc Error =(G4-E4)/E4 Calc Using m & b Analysis of Fit Characteristics Copy & Paste from Chart Engineering/Math/Physics 25: Computational Methods 23 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Put Fitted Data on Chart • On Table: Select & Copy Data • On chart: EDIT → PASTE SPECIAL → dialog Box above Engineering/Math/Physics 25: Computational Methods 24 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (17) Fine Tune Two-Variable Display SnCl4Vapor Pressure 8 ln(Pv) = -4.7201(1000/T) + 18.958 2 R = 0.9992 7 6 ln(Pv) (ln[Torr]) 5 4 To Make Error Data More Visible Show using SECONDARY Axis at Right 3 2 Error Data Series 1 0 2.5 2.75 3 3.25 3.5 3.75 4 -1 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 25 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (18) SnCl4Vapor Pressure 8 12.0% 7 10.0% ln(Pv) = -4.7201(1000/T) + 18.958 2 R = 0.9992 8.0% 6 ln(Pv) (ln[Torr]) 6.0% 5 4.0% 4 2.0% 3 0.0% 2 -2.0% 1 -4.0% 0 -6.0% 2.5 2.75 3 3.25 3.5 3.75 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 26 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 Chart Construction Demo (19) Fine Tune Two-Axes Display Engineering/Math/Physics 25: Computational Methods 27 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Chart Construction Demo (20) SnCl4Vapor Pressure 7 12% ln(Pv) (ln[Torr]) ln(Pv) = -4.7201(1000/T) + 18.958 2 R = 0.9992 6 10% Fit Error 8% 5 ln(Pv) (ln[Torr]) 6% 4 4% 3 2% 0% 2 -2% 1 -4% 0 -6% 2.5 2.75 3 3.25 3.5 3.75 1000/T (1/Kelvin) Engineering/Math/Physics 25: Computational Methods 28 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt 4 Fit Error = (Fit-Actual)/Actual Linear (ln(Pv) (ln[Torr])) Nice Chart Engineering/Math/Physics 25: Computational Methods 29 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Coefficient of Correlation The coefficient of correlation is an indication of how well the linear relationship determined by the method of least squares fits the data set. The equation for the coefficient of correlation is: R n(xi yi ) (xi )(yi ) n(xi ) (xi ) 2 Engineering/Math/Physics 25: Computational Methods 30 2 n(yi ) (yi )2 2 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Interpretation of R If R is 0, the points are so scattered that the regression line does not help predict y for a given x. If R is +1 (positive slope) or –1 (negative slope), the points actually lie on a straight line so almost perfect predictions of y for a given x can be made using the regression line. Engineering/Math/Physics 25: Computational Methods 31 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Goodness of Fit R Value 0.9 to 1.0 0.7 to 0.9 0.5 to 0.7 0.3 to 0.5 -0.3 to 0.3 -0.5 to -0.3 -0.7 to -0.5 -0.9 to -0.7 -1.0 to -0.9 Engineering/Math/Physics 25: Computational Methods 32 Correlation Very high positive High positive Moderate positive Low positive Little, if any Low negative Moderate negative High negative Very high negative Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt Engineering/Math/Physics 25: Computational Methods 33 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_Lec-29_MS_Excel-2.ppt