0% found this document useful (0 votes)
4 views36 pages

Numerical Methods for Curve Fitting

The document discusses numerical methods for solving transcendental equations, including the Newton-Raphson, False Position, and Bisection methods. It also covers curve fitting techniques, particularly least squares regression, and Gaussian elimination for solving linear equations. Additionally, it explains integration methods such as the Trapezoidal Rule, Simpson’s Rule, and Gaussian Quadrature for approximating integrals.

Uploaded by

harar23373
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views36 pages

Numerical Methods for Curve Fitting

The document discusses numerical methods for solving transcendental equations, including the Newton-Raphson, False Position, and Bisection methods. It also covers curve fitting techniques, particularly least squares regression, and Gaussian elimination for solving linear equations. Additionally, it explains integration methods such as the Trapezoidal Rule, Simpson’s Rule, and Gaussian Quadrature for approximating integrals.

Uploaded by

harar23373
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NUMERICAL METHODS

Roots of Transcendental equations


• An equation or formula involving
transcendental functions.
• Examples of transcendental functions include
the exponential function, the trigonometric
functions, and the inverse functions of both.
Successive approximations
Newton-Raphson method.

False Position Method

Bisection Method
Solutions to TE
• Newton Raphson method

• Regula falsi method


Regula falsi
method
Newton
Raphson
Method
CURVE FITTING

Best-fitting curve to a given set of points by


minimizing the sum of the squares of the offsets of
the points from the curve
the vertical offsets from a
line are almost always
minimized instead of the
perpendicular offsets.

The best fit in the least-squares sense minimizes


the sum of squared residuals, a residual being
the difference between an observed value and
the fitted value provided by a model.
Minimizing the Residual

The best fit is obtained by the values of α and β that


minimize ρ.
Residual Error
Regression (Best Fit) Line
The best fit line associated with the n points
(x1,y1), (x2,y2) ………….., (xn, yn) has the
form
y=mx+b where
Least squares line
Coefficient of
correlation

Goodness of fit

[Link]
The least square Parabola
The least square parabola approximating the set
of points (X1,Y1)…(Xn,Yn) has the equation:
Y = a0 + a1X + a2X2
where the constants a0, a1 and a2 are determined by
solving simultaneously the equations:
Straight Line

Parabola
Gaussian Elimination
Gaussian Elimination
• Solving simultaneous linear equations
• solve a general set of n equations and n
unknowns
Steps to Solve
Gaussian elimination consists of two steps
• 1. Forward Elimination of Unknowns: In this
step, the unknown is eliminated in each
equation starting with the first equation. This
way, the equations are reduced to one
equation and one unknown in each equation.
• 2. Back Substitution: In this step, starting from
the last equation, each of the unknowns is
found.
Gaussian Elimination
• 1. Triangulation
– Upper triangular matrix
• 2. Back Substitution
INTEGRALS
• Trapezoidal Rule
INTEGRALS
• Simpson’s 1/3rd Rule
Gaussian Quadrature
Integration
• Integration is the process of measuring the
area under a function plotted on a graph.
• finding the velocity of a body from
acceleration functions,
• displacement of a body from velocity data

[Link]
Basis of the Gaussian Quadrature Rule
• The two-point Gauss Quadrature Rule is an extension of the
Trapezoidal Rule approximation where the arguments of the
function are not predetermined as a and b but as unknowns x1
and x2. In the two-point Gauss Quadrature Rule, the integral is
approximated as

b
I   f ( x )dx  c1 f ( x1 )  c 2 f ( x 2 )
a
The four unknowns x1, x2, c1 and c2 are found by
assuming that the formula gives exact results for
integrating a general third order polynomial,

 f ( x )dx   a0  a1 x  a 2 x  a3 x dx


b b
2 3

a a
b
 x 2
x x 
3 4
 a0 x  a1  a 2  a3 
 2 3 4 a
 b2  a2   b3  a3   b4  a4 
 a0 b  a   a1    a 2    a3  
 2   3   4 
Basis of the Gaussian
Quadrature Rule

It follows that

   
b
 f ( x )dx  c1 a0  a1 x1  a 2 x1  a3 x1  c2 a0  a1 x2  a 2 x2  a3 x2
2 3 2 3

Equating Equations the two previous two expressions yield

 b2  a2   b3  a3   b4  a4 
a0 b  a   a1    a 2    a3  
 2   3   4 

 c a  a x  a x  a x   c a  a x  a x  a x 
2 3 2 3
1 0 1 1 2 1 3 1 2 0 1 2 2 2 3 2

 a c  c   a c x  c x   a c x  c x   a c x  c x 
2 2 3 3
0 1 2 1 1 1 2 2 2 1 1 2 2 3 1 1 2 2
30
[Link]
Basis of the Gaussian Quadrature Rule
Since the constants a0, a1, a2, a3 are arbitrary

b  a  c1  c2 b2  a2 b3  a3
 c1 x1  c2 x2  c1 x1  c2 x2
2 2

2 3
b4  a4
 c1 x1  c 2 x 2
3 3

 b  a  1  b  a  b  a  1  b  a
x1      x2     
 2  3 2  2  3  2

ba ba
c1  c2 
2 2
31
Gauss Quadrature
Two-point Gaussian Quadrature Rule
Higher Point Gaussian Quadrature
Formulas
b

 f ( x)dx  c f ( x )  c
a
1 1 2 f ( x2 )  c3 f ( x3 )

is called the three-point Gauss Quadrature Rule.


The coefficients c1, c2, and c3, and the functional arguments x1, x2, and x3
are calculated by assuming the formula gives exact expressions for
integrating a fifth order polynomial

 a0  a1 x  a 2 x  a3 x  a 4 x  a5 x dx
b
2 3 4 5

General n-point rules would approximate the integral


b
 f ( x )dx  c1 f ( x1 )  c 2 f ( x 2 )  . . . . . . .  c n f ( x n )
a
33
[Link]
Arguments and Weighing Factors for
n-point Gauss Quadrature Formulas
Table 1: Weighting factors c and function
arguments x used in Gauss Quadrature
In handbooks, coefficients and Formulas.
arguments given for n-point Points Weighting Function
Factors Arguments
Gauss Quadrature Rule are
2 c1 = 1.000000000 x1 = -0.577350269
given for integrals c2 = 1.000000000 x2 = 0.577350269
3 c1 = 0.555555556 x1 = -0.774596669
1 n c2 = 0.888888889 x2 = 0.000000000
 g( x )dx   ci g( xi ) c3 = 0.555555556 x3 = 0.774596669
1 i 1
4 c1 = 0.347854845 x1 = -0.861136312
c2 = 0.652145155 x2 = -0.339981044
as shown in Table 1. c3 = 0.652145155 x3 = 0.339981044
c4 = 0.347854845 x4 = 0.861136312

34
[Link]
Arguments and Weighing Factors
1 b
The table is given for
 g( x )dx integrals, how does one solve  f ( x )dx ?
1 a

The answer lies in that any integral with limits of a , b


can be converted into an integral with limits  1, 1
If x  a, then t  1 ba
Let x  mt  c Such that:
m
If x  b, then t 1 2

ba ba ba ba


Then
c Hence x t dx  dt
2 2 2 2
Substituting our values of x, and dx into the integral gives us

ba baba
b 1


a
f ( x )dx   f 
1 
2
t 
2  2
dt 35
[Link]
Gaussian Quadrature

You might also like