Professional Documents
Culture Documents
Curve Fitting - F22
Curve Fitting - F22
FALL 2022
10
11
1
11/3/2022
Introduction
12
Introduction
13
2
11/3/2022
Introduction
First, where the data exhibits a significant degree of error or
“noise”, the strategy is to derive a single curve that represents
the general trend of the data.
Because any individual data
point may be incorrect, we make
no effort to intersect every point.
Rather, the curve is designed
to follow the pattern of the
points taken as a group. One
approach of this nature is called
least-squares regression.
Dr. Asmaa Moddather – Numerical Analysis – Fall 2022
14
Introduction
Second, where the data is known to be
very precise, the basic approach is to
fit a curve or a series of curves that
pass directly through each of the
points. Such data usually originates
from tables. Examples are values for the
density of water or for the heat capacity
of gases as a function of temperature.
15
3
11/3/2022
Noncomputer methods
16
Engineering Practice
17
4
11/3/2022
Engineering Practice
18
Engineering Practice
19
5
11/3/2022
Engineering Practice
20
Curve Fitting
Interpolation
Fourier Approximation
21
6
11/3/2022
Linear Regression
Multiple Regression
Nonlinear Regression
22
23
7
11/3/2022
Linear Regression
24
Linear Regression
25
8
11/3/2022
Linear Regression
26
Linear Regression
27
9
11/3/2022
Linear Regression
e=
Minimum error
28
Linear Regression
One strategy for fitting a “best” line through the data would be to
minimize the sum of the residual errors for all the available data:
-e
+e
Σe = zero !!
29
10
11/3/2022
Linear Regression
One strategy for fitting a “best” line through the data would be to
minimize the sum of the residual errors for all the available data:
30
Linear Regression
One strategy for fitting a “best” line through the data would be to
minimize the sum of the residual errors for all the available data:
31
11
11/3/2022
Linear Regression
How to calculate ao and a1?
One strategy for fitting a “best” line through the data would be to
minimize the sum of the residual errors for all the available data:
32
Linear Regression
33
12
11/3/2022
Linear Regression
34
Linear Regression
Table:
35
13
11/3/2022
Linear Regression
36
Linear Regression
xi yi x2i xiyi
1 0.5 1 0.5
2 2.5 4 5
3 2 9 6
4 4 16 16
5 3.5 25 17.5
6 6 36 36
7 5.5 49 38.5
28 24 140 119.5
37
14
11/3/2022
Linear Regression
Quantification of data spread around regression line:
38
Linear Regression
Quantification of Error reduction:
r: correlation coefficient
39
15
11/3/2022
Linear Regression
40
Linear Regression
7
6 y = 0.8393x + 0.0714
r² = 0.8683
5
4
y
3
2
1
0
0 2 4 6 8
x
41
16
11/3/2022
Linear Regression
42
This is not always the case, and the first step in any
regression analysis should be to plot and visually inspect
the data to ascertain whether a linear model applies.
43
17
11/3/2022
Exponential equation
44
Power equation
45
18
11/3/2022
46
Linear Regression
Table:
47
19
11/3/2022
Linear Regression
48
Linear Regression
49
20
11/3/2022
Polynomial Regression
Convert into
matrix form
50
Polynomial Regression
51
21
11/3/2022
Polynomial Regression
following Table:
52
Polynomial Regression
53
22
11/3/2022
Polynomial Regression
54
Polynomial Regression
55
23
11/3/2022
Polynomial Regression
56
57
24
11/3/2022
58
59
25
11/3/2022
60
61
26
11/3/2022
62
Interpolation
Newton Polynomial
Lagrange Polynomial
Polynomial Coefficient
Inverse Interpolation
Splines
Multidimensional Interpolation
Dr. Asmaa Moddather – Numerical Analysis – Fall 2022
63
27
11/3/2022
Interpolation
64
Interpolation
There is only one straight line
(first-order polynomial) that
connects two points.
65
28
11/3/2022
Newton Polynomial
66
Newton Polynomial
If ln 1 = 0 and ln 6 = 1.791759.
If ln 1 = 0 and ln 4 =1.386294.
(ln 2 = 0.6931472)
67
29
11/3/2022
Newton Polynomial
68
Newton Polynomial
69
30
11/3/2022
Newton Polynomial
70
Newton Polynomial
71
31
11/3/2022
Newton Polynomial
72
Newton Polynomial
(ln 2 = 0.6931472)
73
32
11/3/2022
Newton Polynomial
74
Newton Polynomial
75
33
11/3/2022
Newton Polynomial
76
77
34
11/3/2022
78
Newton Polynomial
If xo = 1, x1 = 4, x2 = 6, x3 = 5
ln 5 = 1.609438.
(ln 2 = 0.6931472)
79
35
11/3/2022
Newton Polynomial
80
Newton Polynomial
81
36
11/3/2022
Newton Polynomial
82
Lagrange Polynomial
83
37
11/3/2022
Lagrange Polynomial
84
Lagrange Polynomial
85
38
11/3/2022
Lagrange Polynomial
86
Excel Trendline
87
39
11/3/2022
Trendline
88
Trendline
89
40
11/3/2022
Toolpack
90
Toolpack
91
41
11/3/2022
Toolpack
92
Toolpack
93
42