Chapter 5 Plotting Data Curve Fitting, Good Graphing Practices Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Slides:



Advertisements
Similar presentations
Empirical Model Building I: Objectives: By the end of this class you should be able to: find the equation of the “best fit” line for a linear model explain.
Advertisements

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
EGR 105 Foundations of Engineering I
Excel Part III Curve-Fitting, Regression Section 8 Fall 2013 EGR 105 Foundations of Engineering I.
Engineering experiments involve the measuring of the dependent variable as the independent one has been altered, so as to determine the relationship between.
LSP 120: Quantitative Reasoning and Technological Literacy Section 118 Özlem Elgün.
Engineering Fundamentals and Problem Solving, 6e Chapter 5 Representation of Technical Information.
GG 313 Geological Data Analysis # 18 On Kilo Moana at sea October 25, 2005 Orthogonal Regression: Major axis and RMA Regression.
Copyright (c) Bani K. Mallick1 STAT 651 Lecture #18.
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
1 Simple Linear Regression Chapter Introduction In this chapter we examine the relationship among interval variables via a mathematical equation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 CURVE.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Linear Simultaneous Equations
Physics Graphing Using Excel. Advantages of Graphing with Spreadsheet Programs Can be fast. Handles lots of data and multiple calculations. Precise calculation.
Chapter 5 Plotting Data Types of Graphs, Plotting with Excel Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Non-Linear Simultaneous Equations
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Correlation and Linear Regression
Correlation and Linear Regression
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 13 Linear Regression and Correlation.
Least-Squares Regression
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Linear Regression and Correlation
LINEAR REGRESSION Introduction Section 0 Lecture 1 Slide 1 Lecture 5 Slide 1 INTRODUCTION TO Modern Physics PHYX 2710 Fall 2004 Intermediate 3870 Fall.
© 2005 The McGraw-Hill Companies, Inc., All Rights Reserved. Chapter 12 Describing Data.
Empirical Model Building Ib: Objectives: By the end of this class you should be able to: Determine the coefficients for any of the basic two parameter.
Graphical Analysis. Why Graph Data? Graphical methods Require very little training Easy to use Massive amounts of data can be presented more readily Can.
Introduction to MATLAB for Engineers, Third Edition Chapter 6 Model Building and Regression PowerPoint to accompany Copyright © The McGraw-Hill Companies,
12b. Regression Analysis, Part 2 CSCI N207 Data Analysis Using Spreadsheet Lingma Acheson Department of Computer and Information Science,
Chapter 13 Statistics © 2008 Pearson Addison-Wesley. All rights reserved.
Chapter 6 & 7 Linear Regression & Correlation
Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 6 Finding the Roots of Equations
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Unit One Notes: Graphing How do we graph data?. Name the different types of graphs (charts).
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 13 Linear Regression and Correlation.
GRAPHING IN CHEMISTRY YEAR 11 DP CHEMISTRYR. SLIDER.
CHAPTER 3 Model Fitting. Introduction Possible tasks when analyzing a collection of data points: Fitting a selected model type or types to the data Choosing.
Graphs in Physics PowerPoint #4. A graph is… A convenient way to show data.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
Objective: Understanding and using linear regression Answer the following questions: (c) If one house is larger in size than another, do you think it affects.
Graphical Analysis in Excel EGN 1006 – Introduction to Engineering.
Relationships If we are doing a study which involves more than one variable, how can we tell if there is a relationship between two (or more) of the.
11/20/2015ENGR 111A - Fall MatLab – Palm Chapter 5 Curve Fitting Class 14.1 Palm Chapter:
11/23/2015Slide 1 Using a combination of tables and plots from SPSS plus spreadsheets from Excel, we will show the linkage between correlation and linear.
Newton’s Method, Root Finding with MATLAB and Excel
LSP 120: Quantitative Reasoning and Technological Literacy Topic 1: Introduction to Quantitative Reasoning and Linear Models Lecture Notes 1.3 Prepared.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
1 Data Analysis Linear Regression Data Analysis Linear Regression Ernesto A. Diaz Department of Mathematics Redwood High School.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Data Analysis, Presentation, and Statistics
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
1 Introduction to Data Plots Graphing, Plotting and Modeling Data.
AP PHYSICS 1 SUMMER PACKET Table of Contents 1.What is Physics? 2.Scientific Method 3.Mathematics and Physics 4.Standards of Measurement 5.Metric System.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Applied Numerical Methods With MATLAB ® for Engineers.
Fitting Equations to Data Chapter 7. Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28.
Plotting in Excel Ken youssefi Engineering 10.
Department of Mathematics
Linear Regression.
Fitting Equations to Data
Relationships and Graphing
Bell Ringer Make a scatterplot for the following data.
Lecture 10 2D plotting & curve fitting
Graphing Rules: According to DRTAILSS
Graphing.
Multivariate Analysis Regression
Presentation transcript:

Chapter 5 Plotting Data Curve Fitting, Good Graphing Practices Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Curve Fitting Often, we have data points and we want to find an equation that “fits” the data Simplest equation is that of a straight line Engineering Computation: An Introduction Using MATLAB and Excel

Curve Fitting Example A spring is placed between two flat plates and force is slowly applied to the upper plate, causing the spring to compress. When the force reaches a pre-load value of 25 N, the location of the upper plate is recorded. As the upper plate continues to move, the distance that the top plate moves, d, and the force required to move the plate, F, are recorded. As soon as the upper plate has moved 10 mm, the test is ended. Engineering Computation: An Introduction Using MATLAB and Excel

Curve Fitting Example Data from the test is shown here. The slope of the load-displacement curve is called the spring constant. Engineering Computation: An Introduction Using MATLAB and Excel

Curve Fitting Example Data from a test – how do we find the slope? Engineering Computation: An Introduction Using MATLAB and Excel We could draw in a line by hand and estimate its slope by estimating the coordinates of two points

Curve Fitting Example How do we find the line that best fits the data? Find the equation of the line that minimizes the sum of the squares of the differences between the values predicted from the equation and the actual data values Why do we square the differences? Because we are interested in the magnitudes of the differences. If one point is above the line and other is below it, we don’t want these difference to cancel each other Engineering Computation: An Introduction Using MATLAB and Excel

Curve Fit Parameters In Excel, we can choose to have the equation of the best-fit line (the trendline) displayed in the form where m = the slope of the line andb = the intercept of the line with the y-axis Engineering Computation: An Introduction Using MATLAB and Excel

Equation of Trendline In this example, the slope of the line (the stiffness of the spring) equals 72.3 N/mm When the deflection (x) equals zero, the force (y) equals 23.1 pounds. This is consistent with our nominal pre-load of 25 pounds Engineering Computation: An Introduction Using MATLAB and Excel

Correlation Coefficient The correlation coefficient (R 2 ) is a measure of how well the trendline fits the data A value of one represents a perfect fit In our example, the line fit is very good Engineering Computation: An Introduction Using MATLAB and Excel

Curve Fitting Example Consider these five data points: Engineering Computation: An Introduction Using MATLAB and Excel

Linear Curve Fit Engineering Computation: An Introduction Using MATLAB and Excel Poor Fit

Try Second–Order Polynomial Fit Engineering Computation: An Introduction Using MATLAB and Excel Better, but still not very good

Third-Order Polynomial Fit Engineering Computation: An Introduction Using MATLAB and Excel Perfect Fit! These point were calculated from the equation:

Correlation Coefficient A “good” fit to data is relative In the case of the spring example, the data should fit a mathematical model, and so an R 2 value of close to one is expected For other cases, a much lower R 2 value is expected Consider a comparison of final exam scores in a class vs. homework averages We would expect that students who do well on HW will generally do well on the final exam, but there will be exceptions Engineering Computation: An Introduction Using MATLAB and Excel

Exam vs. HW Example Engineering Computation: An Introduction Using MATLAB and Excel Note the presence of “outliers” – data points that don’t fit the trend However, there is clearly a trend in the data

Exponential and Power Equations Consider this equation: Here is a graph of the equation: Engineering Computation: An Introduction Using MATLAB and Excel

Exponential Equation Engineering Computation: An Introduction Using MATLAB and Excel If we plot the ln(y) instead of y, then we have the equation of a straight line

Exponential Equation This plot is not particularly useful, since it requires us to read the ln of the dependent variable y, instead of y itself Engineering Computation: An Introduction Using MATLAB and Excel

Exponential Equation A better way is to display the y values on a logarithmic scale: Engineering Computation: An Introduction Using MATLAB and Excel

Exponential Equation We call this a semi-log plot since one of the axes is logarithmic Note that we have used a base-10 scale: remember that a logarithm can be converted to a logarithm of another base by multiplying by a constant: Therefore, the equation will produce a straight line on semi-log axes regardless of the base of the logarithmic scale. Base 10 normally used – easiest to read Logarithmic scales can be specified in Excel and MATLAB Engineering Computation: An Introduction Using MATLAB and Excel

Power Equation Consider the equation for the volume of a sphere: Plot: Engineering Computation: An Introduction Using MATLAB and Excel

Power Equations Engineering Computation: An Introduction Using MATLAB and Excel If we plot the log(y) and log(x), then we have the equation of a straight line

Power Equations This is called a log-log plot, since both axes are logarithmic Engineering Computation: An Introduction Using MATLAB and Excel

In-Class Exercise (Problem 5.17) Estimate the area of each quarter-circle by counting squares. For partial squares, estimate to 0.1 square Engineering Computation: An Introduction Using MATLAB and Excel

Example r = 4: Engineering Computation: An Introduction Using MATLAB and Excel 8 complete squares 0.9 square 0.6 square 0.2 square 0.8 square 0.3 square 0.9 square 0.7 square Total = 12.4 squares Therefore, area of complete circle = 49.6 squares

Example Plot area vs. radius Curve fit to estimate equation for area as a function of radius How well does our estimate match the actual equation? Engineering Computation: An Introduction Using MATLAB and Excel

Good Graphing Practices Graphs are an important tool for communicating information Following a few simple rules can greatly improve the quality of your graphs Engineering Computation: An Introduction Using MATLAB and Excel This is a bad graph!

Always Include a Title The title can be above the graph, or below (especially if a figure number is included) Engineering Computation: An Introduction Using MATLAB and Excel

Add Axis Labels, Including Units Size of label font and number font should be large enough to be easily read Engineering Computation: An Introduction Using MATLAB and Excel

Background/Gridlines The background should not be distracting – a plain white background is good Gridlines are very useful, but should allow the data curve(s) to stand out – gray gridlines are a good choice Engineering Computation: An Introduction Using MATLAB and Excel

Data Curves For equations, plot smooth curves with no data markers With multiple curves, color is good, but remember that the graph may be reproduced in black and white Engineering Computation: An Introduction Using MATLAB and Excel

A Good Graph! Engineering Computation: An Introduction Using MATLAB and Excel