Skip to main content

3.3b Series labs

Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §3.3.1. Rewritten as original drills. Continues 3.3 Errors with power series.

Eleven checks on the sine recurrence from 3.3: does it converge, to the right answer, for which xx, and what breaks when you form factorials or ask for more digits than the machine has. Coding stubs fail until filled in; write-ups need the listed keywords. Use math.sin only when the prompt says so — as a reference “exact” value, never as the series engine.

Labs​

Activity: Error table

For each xx on the input line, sum the sine series with ε=10−8\varepsilon=10^{-8} (recurrence from 3.3). Print one row per xx:

x N sum rel_err

where rel_err = |sum − math.sin(x)| / |math.sin(x)| (use 1e-30 in the denominator if sin⁡x=0\sin x=0). Format: x with 4 decimals, N as int, sum with 10 significant figures (:.10g), rel_err in scientific notation with 3 digits (:.3e).

Input: space-separated floats. Output: one blank-separated row per xx, same order.

Write-ups​

0/4 solved
3.3b.2

Using “converge”, explain:

For sufficiently small xx (e.g. x≤1x\le 1) with ε=10−8\varepsilon=10^{-8}, does the recurrence converge, and does it converge to the correct sin⁡x\sin x? One word is enough if it is the right keyword.

Minimum 1 words. Your answer must include: “converge”.

0 words/ 1 min

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

Explorers​

Next: 3.4 Specular reflection and Bessel theory.