{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture9

# lecture9 - Numerical Methods in Engineering ENGR 391 Curve...

This preview shows pages 1–13. Sign up to view the full content.

Numerical Methods in Engineering ENGR 391 Faculty of Engineering and Computer Sciences Concordia University Curve fitting and interpolation Chapter 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Curve fitting 1. Obtain estimates between data points 2. Obtain a simplified version of a complicated function Least Square Regression - desire a curve (equation) to follow the general trend of the data - “best fit” Interpolation - Use with precise data - curves that intersect all of the data points Data usually available at discrete points from measurements, tables of data, etc. We may want to:
Regression Used when there is error associated with data Desire a general trend of the data Least square regression method to determine the best fit of an equation to data simplest approximation ± Straight Line Objective y=a 0 +a 1 x+e Higher order polynomial or linearization of nonlinear relationship

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The upward velocity of a rocket is given as a function of time in Table 1. 901.67 30 602.97 22.5 517.35 20 362.78 15 227.04 10 0 0 v(t) [m/s] t [s] 0 250 500 750 1000 0 10 20 30 40 t [s] v (t) [s]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Least Squares Linear Regression Linear Regression Fitting a straight line to a set of paired observations: (x 1 , y 1 ), (x 2 , y 2 ),…,(x n , y n ). y=a 0 +a 1 x+e a 1 - slope a 0 - intercept e- error, or residual, between the model and the observations Why Least Squares??
Criteria for a “Best” Fit Minimize the sum of the residual errors for all available data: N = total number of points However, this is an inadequate criterion, so is the sum of the absolute values ¦ ¦ ± ± N i i o i N i i r x a a y e S 1 1 1 ) ( ¦ ¦ ± ± N i i i N i i r x a a y e S 1 1 0 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapra & Canele Error positive and negative cancel Anywhere between dashed lines gives the same amount of total error Minimizing each distance (maximum error) for all data points.
Best strategy is to minimize the sum of the squares of the residuals between the measured y and the y calculated with the linear model: Yields a unique line for a given set of data. ¦ ¦ ¦ ± ± ± N i N i i i i i N i i r x a a y y y e S 1 1 2 1 0 2 1 2 ) ( ) model , measured , ( Criteria for a “Best” Fit Best fit

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1. Minimize S r – Differentiate S r w.r.t. each coefficient a i 2. Set each equation equal to zero 3. Solve N equation for a n unknowns ¦ ¦ ¦ ± ± ± N i N i i i i i N i i r x a a y y y e S 1 1 2 1 0 2 1 2 ) ( ) model , measured , ( Linear Least Square Regression
Least-Squares Fit of a Straight Line > @ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ± ± ± ± ± ± ± w w ± ± ± w w 2 1 0 1 0 1 1 1 0 0 0 ) ( 2 0 ) ( 2 i i i i i i i i o i r i o i o r x a x a x y x a a y x x a a y a S x a a y a S ² ³ x a y a x x N y x y x N a i i i i i i 1 0 2 2 1 ± ± ± ¦ ¦ ¦ ¦ ¦ Mean values Solution of these equations: We minimize S r Two equations for your unknowns a 0 and a 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
0 0 0 0 1 0 . . . na a a a a n i ´ ´ ´ ¦ ¦ ¦ ´ n i i n i i y x a na 1 1 1 0 ¦ ¦ ¦ ´ n i i i n i i n i i y x x a x a 1 1 2 1 1 0 2 1 1 2 1 1 1 1 ¸ ¹ · ¨ © § ± ± ¦ ¦ ¦ ¦ ¦ n i i n i i n i i n i i n i i i x x n y x y x n a 2 1 1 2 1 1 1 1 2 0 ¸ ¹ · ¨ © § ± ± ¦ ¦ ¦ ¦ ¦ ¦ n i i n i i n i i i n i i n i i n i i x x n y x x y x a n x x n i i ¦ 1 _ n y y n i i ¦ 1 _ _ 1 _ 0 x
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern