1 / 47

ME 232

ME 232. Week 6 Notes. ME 232 Week 6 Notes. Curve Fitting Finite Statistics Least Squares Linear Regression Polynomial Regression EXCEL’s TRENDLINE Command Linear Interpolation EXCEL Interpolation Functions HLOOKUP VLOOKUP. Finite Statistics. Finite Statistics. Finite Statistics.

cruz-ware
Télécharger la présentation

ME 232

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ME 232 Week 6 Notes

  2. ME 232 Week 6 Notes • Curve Fitting • Finite Statistics • Least Squares Linear Regression • Polynomial Regression • EXCEL’s TRENDLINE Command • Linear Interpolation • EXCEL Interpolation Functions • HLOOKUP • VLOOKUP

  3. Finite Statistics

  4. Finite Statistics

  5. Finite Statistics

  6. A 2-sided confidence interval. s = true standard deviation, m = true mean

  7. Comparison of the Normal (Gaussian Bell Curve) distribution good for n = ∞ against the finite t distribution valid for n ≤ 30

  8. Linear Regression • Curve fitting technique • Derives a curve that minimizes the discrepancy between the actual data points and the curve fit itself • Least-Squares Linear Regression seeks to minimize the residual, e

  9. Plot showing the definition of the residual,

  10. Linear Regression

  11. Linear Regression

  12. Linear Regression

  13. Linear Regression Regression data showing (a) the spread of the data about the mean, and (b) the spread of the data about the best-fit line. Note the reduction in spread in going from (a) to (b), as indicated by the bell-shaped curves, which represent the improvement due to Linear Regression

  14. Linear Regression Examples of Linear Regression with (a) small and (b) large residual errors.

  15. Linear Regression

  16. Linear Regression

  17. Linear Regression

  18. Linearization of Nonlinear Relationships

  19. Linearization of Nonlinear Relationships

  20. Linearization of Nonlinear Relationships

  21. Linearization of Nonlinear Relationships

  22. Polynomial Regression • As just seen, some engineering models are inherently non-linear • We just used 3 simple examples to show how transformations can be used to map non-linear models into linear ones • An alternative to using transformations as just outlined is to fit polynomial models to the data using polynomial regression • The Least-Squares procedure is readily extended to higher-order polynomials as follows

  23. Polynomial Regression

  24. Polynomial Regression

  25. Pseudo code for Polynomial Regression

  26. EXCEL’s Trendline Command EXCEL  Insert  Trendline

  27. e.g. Fit the following data using EXCEL’s Trendline command: 1. Input the data into a sheet and plot it as follows:

  28. 2. Click on one of the data markers to highlight the data set as shown:

  29. 3. Right click on the highlighted data point to invoke the Trendline menu:

  30. 4. Select Logarithmic from the menu choices:

  31. 5. Hit OK and view the chart, now it has a Logarithmic fit overlaid onto the raw data points

  32. 6. Place your mouse on the Trendline fit and click the Right mouse button, select Format Trendline

  33. 7. Under the Options tab, click Display equation on chart and Display R-squared value on chart as shown below:

  34. 8. Hit OK, now right click on the data label and format it as shown below:

  35. Linear Interpolation • Frequently we must estimate intermediate values between precise data points • The simplest form of interpolation is to connect two data points with a straight line • This technique is called Linear Interpolation

  36. Graphical depiction of linear interpolation. The shaded areas indicate the similar triangles used in the derivation of the linear interpolation formula.

  37. Linear Interpolation Linear-Interpolation Formula The smaller the interval between the data points, the better the approximation

  38. EXCEL’S HLOOKUP / VLOOKUP FUNCTIONS HLOOKUP( lookup_value, table_array, column_index_num, range_lookup) VLOOKUP( lookup_value, table_array, row_index_num, range_lookup) lookup_value = value that is desired, to be determined table_array = range reference or name of table containing data col_index_num / row_index_num = col/row of the table from which the value is to be returned range_lookup = TRUE/FALSE, specifying whether or not there was a match or not

  39. EXCEL’S MATCH / INDEX FUNCTIONS MATCH( lookup_value, lookup_array, match_type) Returns the relative position of a lookup value in an array. Use 1 for match_type when the table is sorted in ascending order and you wish to find the largest value that is less than or equal to lookup_value. Use 0 when your need an exact match; the table need not be sorted. Use -1 when the table is sorted in descending order and you want to find the smallest value that is greater than or equal to lookup_value INDEX( array, row_num, column_num) The INDEX function returns an element from an array thus INDEX(A1:C10,2,3) returns the value at the intersection of row 2 and column 3 of the table A1:C10.

  40. Table Lookup and Interpolation e.g. Steam Tables • Tables of T,p, density, enthalpy, and entropy of saturated steam and water, superheated steam, and compressed liquid water • Saturated steam and water is a mixture of steam and water at a T and p where they both co-exist in equilibrium. The water is said to be “saturated with heat”, i.e. any addition of more heat will boil off the liquid into steam • The saturation line on a graph of p vs. T divides the graph into all water and all steam regions as shown on the next chart

  41. Table Lookup and Interpolation e.g. Steam Tables (continued) • Superheated steam data points are those T,p points above the saturation line in the direction of increasing temperature • Compressed liquid data points are those T,p points above the saturation line in the direction of increasing pressure • Steam tables are used by engineers who design and operate energy transportation and conversion equipment which employs steam as the working fluid • Engineers use the steam tables to compute the properties of hot, pressurized water and steam

  42. Table Lookup and Interpolation e.g. Steam Tables (continued) • For instance, in a pressurized water reactor, if the pressure drops to the saturation line, the water flashes into steam • The T and p in the reactor then move along the saturation line until either the pressure is increased to the point that the water stops boiling into steam, or all of the water is boiled away (a bad thing) • Luckily, this is a self-quenching process. As the pressure decreases, the enthalpy (the heat-carrying capacity), also decreases causing the water temperature in the boiler to increase, because the heat flow from the heat generation region has been decreased

  43. Table Lookup and Interpolation e.g. Steam Tables (continued) • Increasing the temperature increases the pressure and quenches the process • Typically, it is not a good idea to let your cooling water boil away inside a pressurized reactor, so (T,p) of about (600 F, 2250 psi) is a good operating rule of thumb, as it is safely away from the saturation line In the next example, we build a worksheet that calculates the saturate pressure for a given temperature.

More Related