Cobweb Explorer
The learner drags a start value and steps (or plays) an iteration on the graph: the cobweb of x_{n+1} = g(x_n) against the diagonal, Newton tangent steps, secant lines or bisection brackets, while a table lists the iterates, their errors and the error ratios, and the fixed points or roots are marked with their slopes (attracting or repelling). Parameter sliders, a typed-in map and example presets let them compare cases.
Used in: Mathematical Analysis, Single Variable Calculus, Introduction to Probability Theory
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | per method ("Cobweb diagram", "Newton's method", ...) | Card title. |
| method | string | "cobweb" | cobweb: iterate x_{n+1} = map(x_n) against the diagonal y = x. newton: tangent steps to a root of map. secant: secant-line steps from x0 and x1. bisection: halve the bracket interval, keeping the sign change. |
| map | string | "r*x*(1 - x)" (cobweb) or "x^3 - x - 1" | The function, in the variable `variable` and the parameter names: g for a cobweb, f for the root-finding methods. A leading "y =" or "G(s) =" is ignored. Supports + - * / ^, implicit multiplication, sin cos tan asin acos atan sinh cosh tanh sqrt exp ln log (natural) log10 log2 abs floor ceil min max, pi, e. |
| derivative | string | numerical | Optional exact derivative of map (Newton steps, slopes). Otherwise a central difference is used. |
| parameters | {name, min, max, initial?, step?, label?, description?}[] | [] (r for the default map) | Named parameters of map, each with a slider. |
| x0 | number | per method | Start value x_0 (draggable on the axis). Cobweb, Newton, secant. |
| x1 | number | x0 - 15% of the x range | Second start value for the secant method (draggable). |
| interval | [number, number] | the middle 80% of xRange | Starting bracket [a, b] for bisection (both ends draggable); f(a) and f(b) must differ in sign. |
| xRange | [number, number] | [0, 1] (cobweb) or [-2, 2] | Visible x range; also where fixed points or roots are searched. |
| yRange | [number, number] | xRange (cobweb) or fitted to f | Visible y range. |
| steps | number | 30 | Number of steps available (1 to 200). |
| initialSteps | number | 0 | Steps already drawn when the page loads. |
| variable | string | "x" | One-letter variable name used in map and on the axis (e.g. "s" for a generating function). |
| functionName | string | "g" (cobweb) or "f" | Name of the function in labels (e.g. "G"). |
| iterateLabel | string | variable ("m" for bisection) | Symbol of the iterates in the table and readouts (e.g. "q" for q_n). |
| limitLabel | string | "x^*" (cobweb) or "p" | TeX symbol for the limit / root in the error column (e.g. "q"). |
| digits | number | 6 (10 for Newton and secant) | Decimals shown for the iterates. |
| showFixedPoints | boolean | true | Mark the fixed points (cobweb) or roots in xRange and list them with the slope there. |
| showErrorRatio | boolean | true | Add the error-ratio column: e_n/e_{n-1} (cobweb, tends to g'(x*)), e_n/e_{n-1}^2 (Newton), e_n/(e_{n-1}e_{n-2}) (secant). |
| showTable | boolean | true | Show the table of iterates (or brackets). |
| showTimeSeries | boolean | false | Add a small plot of the iterates against n. |
| tangentAt | number | null | null | Draw the tangent to the graph at this x and read out its slope (e.g. 1 for G'(1) = mean offspring). |
| target | number | null | estimated | Known limit / root used for the errors. By default the run is continued and its limit estimated. |
| editable | boolean | true | Let the learner type a new map. |
| presets | {label, map?, derivative?, parameters?, x0?, x1?, interval?, tangentAt?, target?}[] | [] | Examples the learner can switch between (a dropdown when there are two or more); each overrides the matching props. |
| preset | number | 0 | Index of the preset shown first. |
| controls | string[] | all controls shown | Registry ids of the hideable readouts to show (see `controls` in this file): the slope / attracting-repelling readout, the error column with its caption, and the error-ratio column. Core controls (the iteration itself and the fixed-point or root marks) always show. Absent = everything. Fitted per page by component_scopes.py, not by hand. |
PreviousNext