# ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.

## Presentation on theme: "ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III."— Presentation transcript:

ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III

Topics Regression Analysis –Linear Regression –Linearized Regression –Polynomial Regression Numerical Integration –Newton Cotes –Trapezoidal Rule –Simpson Rules –Gaussian Quadrature

Topics Numerical Differentiation –Finite Difference Forms ODE – Initial Value Problems –Runge Kutta Methods ODE – Boundary Value Problems –Finite Difference Method

Regression Often we are faced with the problem… what value of y corresponds to x=0.935?

Curve Fitting Question 2 : Is it possible to find a simple and convenient formula that represents data approximately ? e.g. Best Fit ? Approximation

Experimental Measurements Strain Stress

BEST FIT CRITERIA Strain y Stress Error at each Point

Best Fit => Minimize Error Best Strategy

Best Fit => Minimize Error Objective: What are the values of a o and a 1 that minimize ?

Least Square Approximation In our case Since x i and y i are known from given data

Least Square Approximation

2 Eqtns 2 Unknowns

Least Square Approximation

Example

Quantification of Error Average

Quantification of Error Average

Quantification of Error Average

Quantification of Error Standard Deviation Shows Spread Around mean Value

Quantification of Error

“Standard Deviation” for Linear Regression

Quantification of Error Better Representation Less Spread

Quantification of Error Coefficient of Determination Correlation Coefficient

Linearized Regression The Exponential Equation

Linearized Regression The Power Equation

Linearized Regression The Saturation-Growth-Rate Equation

Polynomial Regression A Parabola is Preferable

Polynomial Regression Minimize

Polynomial Regression

3 Eqtns 3 Unknowns

Polynomial Regression Use any of the Methods we Learned

Polynomial Regression With a 0, a 1, a 2 known the Total Error Standard Error Coefficient of Determination

Polynomial Regression For Polynomial of Order m Standard Error Coefficient of Determination

Numerical Integration & Differentiation

Motivation

AREA BETWEEN a AND b

Motivation

Calculate Derivative Given

Motivation Given Calculate

Think as Engineers!

In Summary INTERPOLATE

In Summary Newton-Cotes Formulas Replace a complicated function or tabulated data with an approximating function that is easy to integrate

In Summary Also by piecewise approximation

Closed/Open Forms CLOSEDOPEN

Trapezoidal Rule Linear Interpolation

Trapezoidal Rule Multiple Application

xa=x o x1x1 x2x2 …x n-1 b=x n f(x)f(x 0 )f(x 1 )f(x 2 )f(x n-1 )f(x n )

Simpson’s 3/8 Rule Cubic Interpolation

General Case Gauss Method calculates pairs of wi, xi for the Integration limits -1,1 For Other Integration Limits Use Transformation

Gauss Quadrature For x g =-1, x=a For x g =1, x=b

PointsWeighting Factors wi Function Arguments Error 2W0=1.0X0=-0.577350269 F (4) (  ) W1=1.0X1= 0.577350269 3W0=0.5555556X0=-0.77459669 F (6) (  ) W1=0.8888888X1=0.0 W2=0.5555556X2=0.77459669

Gaussian Points PointsWeighting Factors wi Function Arguments Error 4W 0 =0.3478548X0=-0.861136312 F (8) (  ) W 1 =0.6521452X1=-339981044 W 2 =0.6521452X2=- 339981044 W 3 =0.3478548X3=0.861136312

Gaussian Quadrature Not a good method if function is not available

Fig 23.1 FORWARD FINITE DIFFERENCE

Fig 23.2 BACKWARD FINITE DIFFERENCE

Fig 23.3 CENTERED FINITE DIFFERENCE

Data with Errors

ODE IVP, BVP

Pendulum W=mg Ordinary Differential Equation

ODEs Non Linear Linearization Assume  is small

ODEs Second Order Systems of ODEs

ODE

ODE - OBJECTIVES Undetermined

ODE- Objectives Initial Conditions

ODE-Objectives Given Calculate

Runge-Kutta Methods New Value = Old Value + Slope X Step Size

Runge Kutta Methods Definition of  yields different Runge-Kutta Methods

Euler’s Method Let

Sources of Error Truncation: Caused by discretization Local Truncation Propagated Truncation Roundoff: Limited number of significant digits

Sources of Error Propagated Local

Euler’s Method

Heun’s Method PredictorCorrector 2-Steps

Heun’s Method Predict Predictor-Corrector Solution in 2 steps Let

Heun’s Method Correct Corrector Estimate Let

Error in Heun’s Method

The Mid-Point Method Remember: Definition of  yields different Runge-Kutta Methods

Mid-Point Method Predictor Corrector 2-Steps

Mid-Point Method Predictor Predict Let

Mid-Point Method Corrector Correct Estimate Let

Runge Kutta – 2 nd Order

Runge Kutta – 3rd Order

Runge Kutta – 4th Order

Boundary Value Problems

Fig 23.3 CENTERED FINITE DIFFERENCE

xoxo Boundary Value Problems x1x1 x2x2 x3x3 x n-1 xnxn...

Boundary Value Problems xoxo x1x1 x2x2 x3x3 x n-1 xnxn...

Boundary Value Problems xoxo x1x1 x2x2 x3x3 x n-1 xnxn...

Boundary Value Problems xoxo x1x1 x2x2 x3x3 x n-1 xnxn...

Boundary Value Problems xoxo x1x1 x2x2 x3x3 x n-1 xnxn...

Boundary Value Problems Collect Equations: BOUNDARY CONDITIONS

Example x1x1 x2x2 x3x3 x4x4

Download ppt "ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III."

Similar presentations