Universidad Industrial de Santander
Numerical Analysis
Department of Computer Science
Ph.D. Henry Arguello Fuentes Undergraduate Studies
Classwork #4
Numerical Differentiation and Function Approximation
DATE : 19th October 2024
Name: Student ID: Group:
I NDICATIONS
• You could fill this sheet with just the answer to each problem and return it to the professor. However, you have to
present the process on a separate exam sheet.
• Answers with no process are not valid.
• Make all calculations with 5 decimal places of precision.
• It is PROHIBITED to use Large Language Models (LLMs) or share the code with classmates.
1 N UMERICAL D IFFERENTIATION
1.1 (10 points) The following data was collected for the distance traveled versus time for a rocket:
t, [s] 0 25 50 75 100 125
y, [Km] 0 32 58 78 92 100
Use numerical differentiation to estimate the rocket’s velocity
and acceleration at each time ⃗t = [25, 50, 75, 100].
Hint: Use the central-difference formulas of order O h2 .
Process:
⃗v = [ — , , , , , — ] ———————————————-
⃗a = [ — , , , , , — ] ———————————————-
1.2 (10 points) A plane is being tracked by radar, and data is taken every second in polar coordinates θ and r.
t, [s] 200 202 204 206 208 210
θ, [rad] 0.75 0.72 0.70 0.68 0.67 0.66
r, [m] 5120 5370 5560 5800 6030 6240
At 206 seconds, use the centered finite-difference (second-order correct) to find the vector expression for velocity ⃗
v
and acceleration ⃗a. The velocity and acceleration given in polar coordinates are
⃗v = ṙ⃗er + rθ̇⃗eθ and ⃗a = (r̈ − rθ̇2 )⃗er + (rθ̈ + 2ṙθ̇)⃗eθ
Ph.D. Henry Arguello Fuentes Page 1 of 3
In these expressions, ṙ and r̈ are the first and second-time derivatives of the radial distance r, respectively. Similarly,
θ̇ and θ̈ are the first and second-time derivatives of the angular displacement θ. The unit vectors ⃗er and ⃗eθ represent
the radial and tangential directions, respectively.
Hint: The answers must be left in terms of ⃗er and ⃗eθ .
Process:
⃗v = ————————————– ————————————————————————————–
⃗a = ————————————- ———————–.—————————————————————
2 I NTERPOLATION AND P OLYNOMIAL A PPROXIMATION
2
2.1 (5 points) Find the Taylor polynomial of degree N = 4 and N = 6 for f (x) = e−x /2
about x0 = 0
Process:
P4 (x) = ——————————– ————————————————————————————–
P6 (x) =
2.2 (5 points) Compute the divided difference table for the function f (x) = (x + 1)1/2 .
xk f (xk ) 1st divided 2nd divided 3th divided 4th divided
difference difference difference difference
x0 = 8 3.00000
x1 = 9 3.16227
x2 = 10 3.31662
x3 = 11 3.46410
x4 = 12 3.60555
2.3 (5 points) Write down the Newton polynomial P1 (x), P2 (x) and P3 (x) for the function in Exercise 2.2.
P1 (x) = ——————————– —————————————————————————————–
P2 (x) =
P3 (x) =
2
3 C URVE F ITTING
For the following data, find the least-squares curve.
xk −1 0 1 2 3
yk 6.62 3.94 2.17 1.35 0.89
3.1• (5 points) y = f1 (x) = CeAx , by using a change of variables to linearize the data points.
Process:
C= A=
3.2 (5 points) y = f2 (x) = 1/(Ax + B), by using a change of variables to linearize the data points.
Process:
A= B=
3.3 (5 points) Determine E2 (f1 ) and E2 (f2 ), the root-mean-square error between the points, yk , and the obtained func-
tions f1 (xk ) and f2 (xk ).
Process:
E2 (f1 ) = E2 (f2 ) =
What curve fits more the given points?
Ph.D. Henry Arguello Fuentes Page 3 of 3