Finite Difference Applications and Worked Problems, PHYS 216 HW 2 – Study Notes

Source: Lecture 3, Experimental Physics and Engineering Lab (Texas A&M University)

Tags: finite difference worked examples, solar car average speed, velocity from position data, acceleration from position, shear stress, Newton's viscosity, polynomial derivative error, PHYS 216, ENGR 216


TL;DR

This set of notes walks through the four core problem types from HW 2: computing time intervals, distances and speeds from a driving log; estimating velocity and acceleration from discrete position data; applying Newton's viscosity law with finite differences; and comparing the accuracy of forward, backward and centered methods against a known analytic derivative.


Key Terms

Time interval (Δt)

The elapsed time between two consecutive clock readings, converted to consistent units (e.g. decimal hours) before doing any arithmetic.

Average speed

Distance travelled during an interval divided by the duration of that interval. For discrete data: v_avg = Δx / Δt.

Shear stress (τ)

Force per unit area acting tangentially along a surface. In fluid mechanics, τ = μ(du/dy) from Newton's viscosity law.

Dynamic viscosity (μ)

A fluid property that quantifies its resistance to shear deformation. For air near standard conditions, μ ≈ 1.8 × 10⁻⁵ Ns/m².


Core Content

Problem 1 – Solar Car Test Run (Speed from Odometer Data)

The setup: a table of clock times (hr:min:sec) and odometer readings (mi) at seven checkpoints.

Clock time

0:00:00

0:58:42

2:03:54

2:56:24

3:45:23

4:12:00

5:34:13

Odometer (mi)

100.0

157.6

218.7

263.5

315.8

340.3

422.4

How to compute each row:

  • Time interval (hr): Convert each pair of consecutive clock times to decimal hours, then subtract.

    • Example: 0:58:42 = 58/60 + 42/3600 = 0.9783 hr. So the first interval is 0.9783 − 0 = 0.9783 hr.

  • Distance (mi): Subtract consecutive odometer readings.

    • Example: 157.6 − 100.0 = 57.6 mi.

  • Average speed (mph): Divide distance by time interval.

    • Example: 57.6 / 0.9783 ≈ 58.9 mph.

The overall average speed is the average of the individual average speeds (not total distance over total time, which would give a different answer). The problem specifically asks for "the average of the averages."

Clock-time conversion reminder:

To convert hr:min:sec to decimal hours: hours + minutes/60 + seconds/3600.


Problem 2 – Velocity and Acceleration of a Moving Ball

Given data:

t (s)

0.0

1.0

2.0

3.0

4.0

5.0

6.0

7.0

8.0

x (m)

0.00

0.687

1.48

2.11

2.32

2.41

2.45

2.21

1.42

Calculate velocity and acceleration at t = 2, 3, 4, 5, 6 using all three methods. Here Δt = 1.0 s throughout, which keeps the arithmetic clean.

Worked example for velocity at t = 2 s:

  • Forward: v(2) ≈ [x(3) − x(2)] / Δt = (2.11 − 1.48) / 1.0 = 0.63 m/s

  • Backward: v(2) ≈ [x(2) − x(1)] / Δt = (1.48 − 0.687) / 1.0 = 0.793 m/s

  • Centered: v(2) ≈ [x(3) − x(1)] / (2Δt) = (2.11 − 0.687) / 2.0 = 0.7115 m/s

Worked example for acceleration at t = 2 s:

  • Forward: a(2) ≈ [v_fwd(3) − v_fwd(2)] / Δt (using forward velocities)

  • Backward: a(2) ≈ [v_bwd(2) − v_bwd(1)] / Δt (using backward velocities)

  • Centered: a(2) ≈ [x(3) − 2x(2) + x(1)] / (Δt)² = (2.11 − 2(1.48) + 0.687) / 1.0 = −0.163 m/s²

The negative acceleration values at later times indicate the ball is decelerating.

Velocity results (all methods, m/s):

t (s)

Forward

Backward

Centered

2

0.630

0.793

0.7115

3

0.210

0.630

0.420

4

0.090

0.210

0.150

5

0.040

0.090

0.065

6

−0.240

0.040

−0.100

Key observation: the ball speeds up initially, then slows and eventually reverses direction. The centered values sit between the forward and backward estimates at each point.


Problem 3 – Shear Stress via Newton's Viscosity Law

Given data:

y (m)

0.000

0.00200

0.00600

0.0120

0.0180

0.0240

u (m/s)

0.000

0.287

0.899

1.915

3.048

4.299

μ = 1.8 × 10⁻⁵ Ns/m²

The task: use the second-order centered first finite difference to find τ = μ(du/dy) at y = 0.006, 0.012 and 0.018.

Critical detail: the y-values are not equally spaced. For the centered difference at y = 0.006:

  • Points used: y = 0.002 and y = 0.012

  • Δy = 0.012 − 0.002 = 0.010 m

  • du/dy ≈ [u(0.012) − u(0.002)] / (0.012 − 0.002) = (1.915 − 0.287) / 0.010 = 162.8 /s

  • τ = μ × du/dy = 1.8 × 10⁻⁵ × 162.8 ≈ 2.93 × 10⁻³ N/m²

At y = 0.012:

  • du/dy ≈ [u(0.018) − u(0.006)] / (0.018 − 0.006) = (3.048 − 0.899) / 0.012 = 179.1 /s

  • τ = 1.8 × 10⁻⁵ × 179.1 ≈ 3.22 × 10⁻³ N/m²

At y = 0.018:

  • du/dy ≈ [u(0.024) − u(0.012)] / (0.024 − 0.012) = (4.299 − 1.915) / 0.012 = 198.7 /s

  • τ = 1.8 × 10⁻⁵ × 198.7 ≈ 3.58 × 10⁻³ N/m²

On higher-order differences: higher-order finite difference methods would use more data points and could provide better accuracy, especially where the velocity profile has curvature. With only six data points, though, the benefit is limited by the sparse data.


Problem 4 – Polynomial Derivative and Error Comparison

Given: f(x) = x⁴ + 2x³ + 3x² + 4x + 5

The analytic derivative is f′(x) = 4x³ + 6x² + 6x + 4, so f′(0.5) = 4(0.125) + 6(0.25) + 6(0.5) + 4 = 0.5 + 1.5 + 3.0 + 4.0 = 9.0.

With Δx = 0.25:

  • f(0.5) = 0.0625 + 0.25 + 0.75 + 2.0 + 5 = 8.0625

  • f(0.75) = 0.3164 + 0.8438 + 1.6875 + 3.0 + 5 = 10.8477

  • f(0.25) = 0.0039 + 0.0313 + 0.1875 + 1.0 + 5 = 6.2227

Forward difference:

f′(0.5) ≈ [f(0.75) − f(0.5)] / 0.25 = (10.8477 − 8.0625) / 0.25 = 11.141

Percent error: |9 − 11.141| / 9 × 100% ≈ 23.8%

Backward difference:

f′(0.5) ≈ [f(0.5) − f(0.25)] / 0.25 = (8.0625 − 6.2227) / 0.25 = 7.359

Percent error: |9 − 7.359| / 9 × 100% ≈ 18.2%

Centered difference:

f′(0.5) ≈ [f(0.75) − f(0.25)] / (2 × 0.25) = (10.8477 − 6.2227) / 0.50 = 9.250

Percent error: |9 − 9.250| / 9 × 100% ≈ 2.78%

The centered method has dramatically lower error (roughly 2.8% vs. 18–24%), confirming its second-order advantage.

Finding Δx for equal accuracy: to get the forward or backward method's percent error below 2.78% (matching the centered result at Δx = 0.25), you need a step size smaller than 0.25. Because the forward/backward error is O(Δx) while the centered error is O(Δx²), the forward/backward methods need a much finer grid to compete. The hint confirms: the required Δx will be less than 0.25.


Formulas / Diagrams

Clock time to decimal hours

decimal hours = hours + minutes/60 + seconds/3600

Average speed

v_avg = Δ(distance) / Δ(time)

Centered second derivative (equal spacing)

f″(x) ≈ [f(x+Δx) − 2f(x) + f(x−Δx)] / (Δx)²

Newton's viscosity law

τ = μ (du/dy)


Why It Matters / Exam Flags

⚠️ Problem 1 asks for the "average of the averages," not total distance over total time. These give different numbers. Read carefully.

⚠️ In Problem 2, the centered velocity at t = 2 uses data from t = 1 and t = 3 (not t = 2 itself). The centre point drops out of the numerator.

⚠️ In Problem 3, the y-spacing is uneven. The denominator in the centered difference is (y_{i+1} − y_{i−1}), not a fixed Δy.

⚠️ Problem 4 demonstrates the core lesson: centered differences are an order of magnitude more accurate than forward or backward for the same step size. This is the kind of conceptual understanding that gets tested.

⚠️ Whenever computing f(x) for a polynomial, be methodical about each term. Arithmetic slips here cascade into wrong percent errors.


Practice Q&A

Q: A car's odometer reads 218.7 mi at clock time 2:03:54 and 263.5 mi at 2:56:24. What is the average speed for this interval?

A: Time interval = (2 + 56/60 + 24/3600) − (2 + 3/60 + 54/3600) = 2.9400 − 2.0650 = 0.8750 hr. Distance = 263.5 − 218.7 = 44.8 mi. Average speed = 44.8 / 0.8750 ≈ 51.2 mph.

Q: Given position data at t = 3, 4, 5, what is the centered finite difference estimate of velocity at t = 4 if x(3) = 2.11, x(5) = 2.41, and Δt = 1?

A: v(4) ≈ [x(5) − x(3)] / (2Δt) = (2.41 − 2.11) / 2.0 = 0.15 m/s.

Q: Why does the centered difference at Δx = 0.25 give roughly 2.8% error while forward gives roughly 24% for the polynomial in Problem 4?

A: The centered method's truncation error scales as Δx², while forward's scales as Δx. At Δx = 0.25, the centered error term is proportional to 0.0625 while the forward error term is proportional to 0.25, roughly a factor of 4 difference in the error coefficient, compounded by different constant prefactors from the higher-order Taylor terms.

Q: In Problem 3, why does Δy in the centered difference denominator change depending on which point you evaluate?

A: The data points in y are not equally spaced. The centered formula uses the two surrounding points, so the effective spacing is y_{i+1} − y_{i−1}, which varies across the table.

Q: If you wanted the forward difference to achieve ≤ 2.78% error for f′(0.5) of the polynomial in Problem 4, would you need a larger or smaller Δx than 0.25?

A: Smaller. Forward differences are only first-order accurate, so you need a finer step size to reduce the error below what the centered method achieves at Δx = 0.25.


Related Terms / Search Tags

finite difference worked examples, solar car speed calculation, velocity from position table, acceleration from discrete data, Newton's viscosity law finite difference, shear stress calculation, polynomial derivative numerical estimate, forward vs backward vs centered accuracy, percent error comparison, unequal spacing finite difference, PHYS 216 HW 2, ENGR 216, Texas A&M experimental physics, average of averages, clock time conversion to decimal