1 / 38

EGR 105 Foundations of Engineering I

EGR 105 Foundations of Engineering I. Excel Part III Curve -Fitting, Regression Section 8 Fall 2013. Excel Part II Topics. Data Analysis Concepts Regression Methods Example Function Discovery Regression Tools in Excel Homework Assignment. Analysis of x-y Data.

dagmar
Télécharger la présentation

EGR 105 Foundations of Engineering I

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. EGR 105 Foundations of Engineering I Excel Part III Curve-Fitting, Regression Section 8 Fall 2013

  2. Excel Part II Topics Data Analysis Concepts Regression Methods Example Function Discovery Regression Tools in Excel Homework Assignment

  3. Analysis of x-y Data Independent versus dependent variables y y = f(x)x dependent independent

  4. Common Types of Plots Example: Y=3X2 Cartesian log-log : log y-log x Note! Semi-log : log x log(y) = log(3) + 2*log(x) y = 3x2 Straight Line on log-log Plot!

  5. What About Other Values? Often have a limited set of data What if you want to know… Prediction of what occurred before data Prediction of what will occur after data Many real applications of this… Discuss this in a little while

  6. Finding Other Values Interpolation Data between known points Need assume variation between points May be easier to do for closer points data points

  7. Finding Other Values Extrapolation (requires assumptions) Data beyond the measured range Forecasting (looking ahead) Hindcasting (looking behind) Examples (apply equations or models) Sales Ocean waves Stock market The weather etc.

  8. Stock Market Forecasting – can require complex model(s)

  9. Finding Other Values Regression– curve fitting of data Simple representation of data Understand workings of system Elements of system behavior are important How do they affect the overall system? How important is each one? Can represent these in model(s) Useful for prediction

  10. Excel Part III Topics Data Analysis Concepts Regression Methods Example Function Discovery Regression Tools in Excel Homework Assignment

  11. Something Must Be In There…Somewhere….

  12. Curve-Fitting - Regression Useful for noisy or uncertain data n pairs of data (xi , yi) Choose a functional form y=f(x) polynomial exponential etc. and evaluate parameters for a “close” fit

  13. What Does “Close” Mean? Want a consistent rule to determine Common is the least squares fit (SSE): y (x3,y3) (x4,y4) (x1,y1) (x2,y2) e3 ei= yi – f(xi), i =1,2,…,n x sum squared errors

  14. Quality of the Fit: Notes: is the average y value 0 R2 1 -closer to 1 is a “better” fit y x

  15. Coefficient of Determination R2 = 1.0 All of the data can be explained by the fit R2 = 0.0 None of the data can be explained by the curve fit (Note: R2 = is sometimes reported as a %)

  16. Caution!!! A good fit statistically may not be the correct fit Must always consider the physical phenomenon you are attempting to “model” Does the fit to the data describe reality?

  17. Linear Regression Functional choicey = m x + b slopeintercept Squared errors sum to Set m and b derivatives to zero

  18. Further Regression Possibilities: Could force intercept: y = m x + c Other two parameter ( a and b ) fits: Logarithmic: y = a ln x + b Exponential: y = a e bx Power function: y = a x b Other polynomials with more parameters: Parabola: y = a x2 + bx + c Higher order: y = a xk + bxk-1 + …

  19. Excel Part III Topics Data Analysis Concepts Regression Methods Example Function Discovery Regression Tools in Excel Homework Assignment

  20. Example Function Discovery(How to find the “best” relationship) Look for straight lines on log axes: linear on semilog x y = a ln x linear on semilog y y = ae bx linear on log log y = ax b No rule for 2nd or higher order polynomial fits

  21. Excel Part III Topics Data Analysis Concepts Regression Methods Example Function Discovery Regression Tools in Excel Homework Assignment

  22. Excel’s Regression Tool Highlight your chart On chart menu, select “add trendline” Choose type: Linear, log, polynomial, exponential, power Set options: Forecast = extrapolation Select y intercept (use zero only if it applies) Show R2 value on chart Show equation of fit on chart

  23. Linear & Quartic Curve Fit Example Y X Y Better fit but does it make sense with expected behavior? X

  24. Example Applications Look at some curve fitting examples Examine previous EGR 105 projects Pendulum Elastic bungee cord

  25. Previous EGR 105 Project Discover how a pendulum’s timing is impacted by the length of the string? mass of the bob? Take experimental data Use string, weights, rulers, and watches Analyze data and “discover” relationships

  26. Experimental Setup: Length Mass

  27. One Team’s Results Mass appears to have no impact, but length does

  28. To determine the effect of length, first plot the data

  29. Try a linear fit

  30. Force a zero intercept (why?)

  31. Try a quadratic polynomial fit

  32. Try a logarithmic fit

  33. Try a power function fit

  34. On log-log axes, nice straight line b Power Law Relation:

  35. Question? Which one was the best fit here? Explain why

  36. One More Example Another EGR 105 project Elastic bungee cord models Stretching of an elastic cord Here we have two models to consider Linear elastic (Hooke’s Law) Non-linear elastic (Cubic model)

  37. Elastic Bungee Cord Models Determined by Curve Fitting the Data Linear Model (Hooke’s Law): Nonlinear Cubic Model:     Force (lb) Collected Data    Cubic Fit Better and it Makes Sense with the Physics   Linear Fit 

  38. Homework Assignment #5 See Handout (Excel Part 3) Analysis of stress-strain data Plotting of data Determine equation for best fit to data Regression analysis Linear elastic model Cubic polynomial model Discussion of results Remember to email submit using EGR105_5 in Subject Line!

More Related