Chapter 3. Interpolation and Curve Fitting
1. Polynomials and Interpolation
In many engineering situations, data are available at discrete points,
it is required to fit a smooth and continuous function to this data.
Usually a polynomial, a trigonometric o
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43078)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43091)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
Assignment #1
(September 22, 2008)
ME3905 Numerical Methods
(Deadline for submission: 03 October 2008, 5:30pm)
1. What are the three major conservation equations used to formulate mathematical
models? Give an example in each case.
2. Find the root of the
Assignment #2
(October 10, 2008)
ME3905 Numerical Methods
(Deadline for submission: 24 October 2008, 5:30pm)
1. The orientation of a rigid bar OP shown in Figure 1
can be represented by the coordinates of its end point
P (x, y, z). The rotation of OP abou
Assignment #1
(Sep. 14, 2016)
ME46002 Numerical Methods for Engineers
(Deadline for submission: Sept. 28, 2016, 9:20 pm)
(25 marks each) Find the root(s) of the equations f(x)=0
(i)
f ( x ) = sin( x ) x 3 = 0
by using the bisection method with a = 0.75 an
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43078)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
2. Least-Square Regression
xi
yi
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0
16
25
36
60
84
110
120
130
144
200
196
240
256
289
324
280
Linear Regression
Regression is the method of obtaining the best fit to a given
set of data.
Let the data points be (
4.2 Numerical Integration
Newton-Cotes formulas
b
I =
for integration
b
f ( x ) dx
a
f n ( x ) dx
a
where
fn (x)
is
polynomial
f n ( x ) = a 0 + a 1 x + L + a n 1 x n 1 + a n x n
Trapezoidal Rule
f(b)
f(x)
y
f(a)
b
x
a
b
By Newton-Cotes formula
b
I =
b
f
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43078)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hon
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43091)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
Lecture Notes
ME3905, Mechanical Engineering, PolyU
2008/2009
Chapter 4
Numerical Differentiation and Integration
4.1 Numerical Differentiation
Taylors Expansion
f ( x i + 1 ) = f ( x i ) + f ( x i )( x i + 1 x i ) +
where
f ( x i ) =
df
dx
at
f ( x i )
(
Solution:
Q1:
Use Gaussian elimination
1 2 4 1
2 8 6 4
A=
3 10 8 8
4 2 10 6
sh is
ar stu
ed d
vi y re
aC s
o
ou urc
rs e
eH w
er as
o.
co
m
is change into upper triangular matrix
1
1 2 4
0 4 2 2
with factors 2, 3, 1, 4, 1, 2 for eliminations in each r
Midterm Test: umerical Methods (ME 3905)
Student ame _
Student ID _
Question 1.
(a) Determine the root of an equation f ( x ) = 0.1 -
[3 - sin(x)]ln( 1 + x)
=0 .
(x + 2) 2
using bisection method with two initial guesses of a=0 and b=0.5. Perform the
sh is
Assignment 1
Q1
Three conservation equations are usually used.
1. Conservation of mass;
2 Conservation of momentum and
3. Conservation of energy:
Examples are:
Q2. (i)
f(x)=
1.5 x
1
0.65 x
0.65 tan 1 ( ) +
=0
2
x
(1 + x )
1 + x2
a
b
c
f(a)
f(b)
f(c)
f(a)
The Hong Kong Polytechnic University
Programme
:
BEng(Hons) in Mechanical Engineering (43091)
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
The Hong Kong Polytechnic University
Lecture Notes
ME46002, Mechanical Engineering, PolyU
2016/2017
Chapter 1: Computer Solution of onlinear Equations
umerical methods
Finding the roots of the equation f(x)=0 by numerical method
Two basic methods for finding the roots (zeros of a constraint)
ME46002 Chapter 4: Tutorial questions
Question 1:
For a set of four data points
i
xi
f(xi)
0
1
1
1
2.2
2.4
2
2.8
3.2
3
3.5
4.1
(a) Employ Newtons divided difference interpolating polynomial f3(x) to fit the data
f 3 ( x ) = a0 + a1 ( x x0 ) + a 2 ( x x0 )
ME3905 Revision Questions
Chapter 1
1.
2.
3.
4.
5.
6.
7.
What is the bi-section method for solving equation?
Tutorial question #1(a).
What are the drawbacks of bi-section methods?
What is Newton-Raphson method for solving equation?
Tutorial question #1(c)
Example /exercise question EX1
1. Problem 5.15 of textbook [1] (Chapra & Canale)
bisection method.
(see No.11-12 PPT slides for solution)
Example /exercise question EX2
EX3.
Locate the first nontrivial root of sin(x)=x3, where x is in radians. Use a
graph
Question #1.
(i) Use central difference approximations to estimate the 1st derivative of
y=ex at x=2 for h=0.1.
(ii) Employ the following formulas to estimate the 1st derivative of y=f(x)=ex
at x=2 for h=0.1.
f ( x) =
'
f ( x 2h ) 8 f ( x h ) + 8 f ( x +