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 , 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
For each on the input line, sum the sine series with (recurrence from 3.3). Print one row per :
x N sum rel_err
where rel_err = |sum − math.sin(x)| / |math.sin(x)| (use 1e-30 in the denominator if ). 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 , same order.
Write-ups
Using “converge”, explain:
For sufficiently small (e.g. ) with , does the recurrence converge, and does it converge to the correct ? One word is enough if it is the right keyword.
Minimum 1 words. Your answer must include: “converge”.
Meet the writing requirements, then you can open the model answer.