CSC212 · 2081 · 5 marks
What is numerical differentiation? The table below gives the values of distance travelled by a vehicle at various time intervals. Estimate the velocity and acceleration at x=4. | Time (x) | 1 | 2 | 4 | 8 | 10 | |---|---|---|---|---|---| | Distance (y) | 0 | 1 | 5 | 21 | 27 |
What is numerical differentiation? The table below gives the values of distance travelled by a vehicle at various time intervals. Estimate the velocity and acceleration at $x=4$.
| Time $(x)$ | 1 | 2 | 4 | 8 | 10 |
|---|---|---|---|---|---|
| Distance $(y)$ | 0 | 1 | 5 | 21 | 27 |
[5]
Numerical Differentiation
Definition
Numerical differentiation is the process of estimating the derivative (rate of change) of a function from a set of tabulated/discrete data values, instead of differentiating a closed-form expression analytically. It is used when the function is either unknown (only data points are given) or too complex to differentiate directly. The derivatives are obtained by differentiating an interpolating polynomial (Newton forward/backward for equal spacing, Newton's divided differences for unequal spacing).
Here velocity $= \dfrac{dy}{dx}$ and acceleration $= \dfrac{d^2y}{dx^2}$.
Given Data
| Time $x$ | 1 | 2 | 4 | 8 | 10 |
|---|---|---|---|---|---|
| Distance $y$ | 0 | 1 | 5 | 21 | 27 |
The nodes are unequally spaced, so I use Newton's Divided Difference interpolation.
Step 1: Divided Difference Table
First DD: $$f[x_0,x_1]=\tfrac{1-0}{2-1}=1,\quad f[x_1,x_2]=\tfrac{5-1}{4-2}=2$$ $$f[x_2,x_3]=\tfrac{21-5}{8-4}=4,\quad f[x_3,x_4]=\tfrac{27-21}{10-8}=3$$
Second DD: $$f[x_0,x_1,x_2]=\tfrac{2-1}{4-1}=\tfrac13,\quad f[x_1,x_2,x_3]=\tfrac{4-2}{8-2}=\tfrac13,\quad f[x_2,x_3,x_4]=\tfrac{3-4}{10-4}=-\tfrac16$$
Third DD: $$f[x_0,x_1,x_2,x_3]=\tfrac{\tfrac13-\tfrac13}{8-1}=0,\quad f[x_1,x_2,x_3,x_4]=\tfrac{-\tfrac16-\tfrac13}{10-2}=\tfrac{-\tfrac12}{8}=-\tfrac1{16}$$
Fourth DD: $$f[x_0,\dots,x_4]=\tfrac{-\tfrac1{16}-0}{10-1}=-\tfrac1{144}$$
Step 2: Newton's Divided Difference Polynomial
$$P(x)=(x-1)+\tfrac13(x-1)(x-2)+0-\tfrac1{144}(x-1)(x-2)(x-4)(x-8)$$
Step 3: Velocity = $P'(4)$
Term 1: $\dfrac{d}{dx}(x-1)=1$
Term 2: $\dfrac13\big[(x-2)+(x-1)\big]=\dfrac13(2x-3)$; at $x=4$: $\dfrac13(5)=\dfrac53$
Term 3: coefficient $0\Rightarrow 0$
Term 4: Let $g(x)=(x-1)(x-2)(x-4)(x-8)$. $$g'(x)=(x-2)(x-4)(x-8)+(x-1)(x-4)(x-8)+(x-1)(x-2)(x-8)+(x-1)(x-2)(x-4)$$ At $x=4$, only the term without $(x-4)$ survives: $$g'(4)=(3)(2)(-4)=-24$$ Contribution $=-\dfrac1{144}(-24)=\dfrac{1}{6}$
Velocity: $$P'(4)=1+\tfrac53+0+\tfrac16=\frac{6+10+1}{6}=\frac{17}{6}\approx 2.833$$
$$\boxed{\text{Velocity}\approx 2.83\ \text{units/time}}$$
Step 4: Acceleration = $P''(4)$
Term 1: second derivative $=0$
Term 2: $\dfrac13(2x-3)\Rightarrow \dfrac13(2)=\dfrac23$
Term 3: $0$
Term 4: Need $g''(4)$ where $g(x)=(x-1)(x-2)(x-4)(x-8)$.
Differentiate $g'(x)$ (sum of four triple products). $g''(x)$ is the sum of all products of two factors, each taken from three of the roots. A cleaner way: expand near the surviving structure. Since terms with $(x-4)$ vanish in first derivative, for $g''$ we differentiate:
$$g'(x)=\underbrace{(x-2)(x-4)(x-8)}{A}+\underbrace{(x-1)(x-4)(x-8)}{B}+\underbrace{(x-1)(x-2)(x-8)}{C}+\underbrace{(x-1)(x-2)(x-4)}{D}$$
At $x=4$:
- $A'=(x-4)(x-8)+(x-2)(x-8)+(x-2)(x-4)$; at 4: $0+(2)(-4)+0=-8$
- $B'=(x-4)(x-8)+(x-1)(x-8)+(x-1)(x-4)$; at 4: $0+(3)(-4)+0=-12$
- $C'=(x-2)(x-8)+(x-1)(x-8)+(x-1)(x-2)$; at 4: $(2)(-4)+(3)(-4)+(3)(2)=-8-12+6=-14$
- $D'=(x-2)(x-4)+(x-1)(x-4)+(x-1)(x-2)$; at 4: $0+0+(3)(2)=6$
$$g''(4)=-8-12-14+6=-28$$
Contribution $=-\dfrac1{144}(-28)=\dfrac{28}{144}=\dfrac{7}{36}$
Acceleration: $$P''(4)=0+\tfrac23+0+\tfrac{7}{36}=\frac{24+7}{36}=\frac{31}{36}\approx 0.861$$
$$\boxed{\text{Acceleration}\approx 0.86\ \text{units/time}^2}$$
Final Results
- Velocity at $x=4$: $\dfrac{17}{6}\approx 2.83$
- Acceleration at $x=4$: $\dfrac{31}{36}\approx 0.86$
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.