NSM UNIT IV PPTs
NSM UNIT IV PPTs
NSM UNIT IV PPTs
Regression Analysis: Introduction to multi regression analysis, Lagrange’s Interpolation, Newton’s Forward interpolation,
Inverse interpolation (Lagrange’s method only)
Unit Objectives:
On completion the students will be able to :
1. To fit the given data in the form of equation.
2. To predict the desired values using interpolation and extrapolation techniques
3. To became familiar with processing/analyzing experimental data to obtain the desired responseand how it is
different from ODE.
Unit Outcomes:
1. Apply and analyze the data by performing curve fit to predict the behavior.
2. Predict the trend and forecast data from existing data.
Reference Books:
T1: Steven C Chapra, Raymond P Canale, Num. Methods for Engineers, 4/e Tata McGraw Hill Editions. [7th Edition]
R1: S. S. Sastry, Introductry Methods of Numerical Analysis Numerical Methods, PHI. [5th Edition]
Outline
• Curve Fitting
Least square technique-
1. Straight line,
2. Power equation
3. Exponential equation
4. Quadratic equation
• Regression Analysis
1. Introduction to multi regression analysis
2. Lagrange‘s Interpolation
3. Newton‘s Forward interpolation
4. inverse interpolation
Least square technique- Straight line
Fig.1
Least square technique- Straight line
X 1 2 3 4 5 6 7
Y 0.5 2.5 2.0 4.0 3.5 6.0 5.5
• The general equation of line is Y = aX+b
• Here, the values of a & b are to be calculated.
The desired equation of straight line are,
Least square technique- Straight line
X Y XY X^2
1 0.5 0.5 1
2 2.5 5 4
3 2 6 9
4 4 16 16
5 3.5 17.5 25
6 6 36 36
7 5.5 38.5 49
∑ 28 24 119.5 140
Where,
Where,
• Then the equation can be converted into straight line equation by taking from
both sides,
• Where,
t, (s) v(t),(m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure 3 Velocity vs. time data for the rocket
example
Example 1
v(t ) = a0 + a1t y
a0 = −100.93 a1 = 30.914
Hence
v(t ) = −100.93 + 30.914t , 15 t 20.
v(16) = −100.93 + 30.914(16) = 393.7 m/s
Example 2
The upward velocity of a rocket is given
as a function of time in Table 1.
Find the velocity at t=16 seconds using
the direct method for quadratic
interpolation.
Table 1 Velocity as a function of time
t, (s) v(t),(m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
f 2 (x )
v(20) = a0 + a1 (20) + a2 (20) = 517.35
2
( x0 , y 0 )
x
550
517.35
500
450
( )
v(16) = 12.05 + 17.733(16) + 0.3766(16)
f x desired
2 350
300
227.04 200
10 12 14 16 18 20
10 x s range x desired 20
Order of Polynomial 1 2
• If available data points are scattered as shown in Fig.2(a), then straight line
is not suitable.
• Fig 2(b) shows a parabola which is more suitable for the given set of data
points.
Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’ that is
not given.
When the points are not equi-spaced, then Lagrange’s or Hermites interpolation
methods are used.
Lagrange's Interpolation and inverse interpolation
where ‘n’ in stands for the nth order polynomial that approximates the function
y=f(x) given at (n+1)data points
as (x0,y0), (x1,y1), …… (xn-1,yn-1), (xn,yn), and
When the values of x are equi-spaced, i.e, when step size h is same for all the values of
x, i.e. then Newton’s forward difference is used.