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

PropTypeDefaultDescription
titlestringper method ("Cobweb diagram", "Newton's method", ...)Card title.
methodstring"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.
mapstring"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.
derivativestringnumericalOptional 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.
x0numberper methodStart value x_0 (draggable on the axis). Cobweb, Newton, secant.
x1numberx0 - 15% of the x rangeSecond start value for the secant method (draggable).
interval[number, number]the middle 80% of xRangeStarting 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 fVisible y range.
stepsnumber30Number of steps available (1 to 200).
initialStepsnumber0Steps already drawn when the page loads.
variablestring"x"One-letter variable name used in map and on the axis (e.g. "s" for a generating function).
functionNamestring"g" (cobweb) or "f"Name of the function in labels (e.g. "G").
iterateLabelstringvariable ("m" for bisection)Symbol of the iterates in the table and readouts (e.g. "q" for q_n).
limitLabelstring"x^*" (cobweb) or "p"TeX symbol for the limit / root in the error column (e.g. "q").
digitsnumber6 (10 for Newton and secant)Decimals shown for the iterates.
showFixedPointsbooleantrueMark the fixed points (cobweb) or roots in xRange and list them with the slope there.
showErrorRatiobooleantrueAdd 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).
showTablebooleantrueShow the table of iterates (or brackets).
showTimeSeriesbooleanfalseAdd a small plot of the iterates against n.
tangentAtnumber | nullnullDraw the tangent to the graph at this x and read out its slope (e.g. 1 for G'(1) = mean offspring).
targetnumber | nullestimatedKnown limit / root used for the errors. By default the run is continued and its limit estimated.
editablebooleantrueLet 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.
presetnumber0Index of the preset shown first.
controlsstring[]all controls shownRegistry 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.