Skip to main content

5.1b Differentiation labs

Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §5.1. Rewritten as original drills. Continues 5.1 Differentiation algorithms.

Implement the two stencils, check the parabola identities, and compare absolute errors on sin⁡t\sin t. Stubs fail until filled in.

Formula refresh​

Warm up: pick the matching equation among lookalikes (same walk as the theory lesson).

Labs​

Activity: Forward difference

Given tt, hh, and coefficients for y(t)=a+bt2y(t)=a+b t^{2}, print the forward-difference estimate of y′(t)y'(t) with 6 decimals.

Input: a b t h.

Write-ups​

0/3 solved
5.1b.W1

Using “cancel”, “epsilon”, and “h”, explain:

Why can making hh extremely small make a numerical derivative worse?

Minimum 3 words. Your answer must include: “cancel”, “epsilon”, “h”.

0 words/ 3 min

Meet the writing requirements, then you can open the model answer.

Explorers​

Figure 5.1 — forward vs central chords.

Next: 5.2 Extrapolated difference.