You are on page 1of 12

Ministry of Higher Education and

Scientific Research
Karbala University
College of Engineering
Petroleum Engineering Department

Supervised By :
Dr. Caesar Muslim

Written By :
sajjad kareem hashim
1
introduction
Curve fitting describes techniques to fit curves at points between
the discrete values to obtain intermediateestimates.
• Two general approaches for curve fitting:
a) Least –Squares Regression Squares Regression - to fits the shape
or to fits the shape or
general trend by sketch a best line of the data without
necessarily matching the individual points (figure
PT5.1, pg 426).
- 2 types of fitting:
i) Linear Regression
ii) Polynomial Regression

2
a) least-squares regression - did not attempt to connect the
point, but characterized the general upward trend of the data
with a straight line
b) Linear interpolation - Used straightline segments or linear
interpolation to connect the points. Very common practice in
engineering. If the values are close to being linear, such
approximation provides estimates that are adequate for many
engineering calculations. However, if the data is widely spaced,
significant errors can be introduced by such linear interpolation.
c) Curvilinear interpolation – Used curves to try to capture
suggested by the data.
Our goal here to develop systematic and objective method deriving
such curves.

3
a) Least-square Regression
: i) Linear Regression
• Is used to minimize the discrepancy/differences between the
data points and the curve plotted. Sometimes, polynomial
interpolation is inappropriate and may yield unsatisfactory
results when
used to predict

intermediate values see Fig(a).

4
Fig. (a): shows 7 experimentally derived data points exhibiting
significant variability. Data exhibiting significant error.

Curve Fitting
 Linear Regression is fitting a ‘best’ straight line through the points.
 The mathematical expression for the straight line is:
y = a0+a1x+e
where,
a1- slope
a - intercept 0
e - error, or residual, between the model
and the observations
 Rearranging the eq. above as:
e = y - a0 - a1x
 Thus, the error or residual, is the discrepancy between the true value y
and the approximate value, a0+a1x, predicted by the linear equation.

5
Least-squares fit for a straight line
• To determine values for a o and a 1,
i) differentiate equation 17.3 with respect to each coefficient,
ii) ii) setting the derivations equal to zero (minimize Sr),
iii) iii) set Σao = n.ao to give equations 17.4 and 17.5, called as normal
equations, (refer text book) which can be solved simultaneously for a 1
and a o ;

----- Eq 17.6

----- Eq 17.7

Example 1

6
 Linearization of Nonlinear Relationships
7
• Linear regression provides a powerful technique for fitting the
best line to data, where the relationship between the dependent
and independent variables is linear.
• But, this is not always the case, thus first step in any regression
analysis should be to plot and visually inspect whether the data is
a linear model or not.

Figure 17.8:
a) data is ill-suited for linear regression,
b) parabola is preferable.

 Nonlinear Relationships
8
• Linear regression is predicated on the fact that the relationship
between the dependent and independent variables is linear - this
is not always the case. Nonlinear Relationships
• Three common examples are:

Linearization of Nonlinear Relationships


• One option for finding the coefficients for a nonlinear fit is to linearize it.
For the three common models, this may involve taking logarithms or inversion:

 Linearization of Nonlinear Relationships


9
• After linearization, Linear regression can be applied to
determine the linear relation.
• For example, the linearized exponential equation:

10
Example 2

Fit an exponential model 𝒚 = 𝒂 𝒆𝒃𝒙 to

x 0.4 0.8 1.2 1.6 2.0 2.3

y 750 1000 1400 2000 2700 3750

Solution
• Linearized the model into;
ln y = ln a + bx
y = a0 + a1x

11
references
Numerical Analysis
1-N I N T H E D I T I O N/Richard L. Burden/Youngstown State University
/J. Douglas Faires/Youngstown State University
2- Introduction to Numerical Analysis for Engineering, Henrik Schmidt
Massachusetts Institute of Technology
3- Numerical methods, John D. Fenton University of Karlsruhe
4-

12

You might also like