Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Curve 2 shape (required)
-
Default Line Allowed Circle, Line, Parabola, Hyperbola, Wave
About this input
The shape of curve 2: Circle, Line, Parabola, Hyperbola or Wave. The crossings of the two curves are the solutions of the system.
- Curve 2 handle B, y (required)
-
Default 1 Range -5 to 5
About this input
Curve 2, handle B, y coordinate (-5 to 5).
- Curve 2 handle B, x (required)
-
Default 2 Range -5 to 5
About this input
Curve 2, handle B, x coordinate (-5 to 5); handle B means the same as for curve 1.
- Your prediction: Newton steps (required)
-
Default Not yet chosen Allowed Not yet chosen, 1 to 3, 4 to 6, 7 to 10, More than 10
About this input
Challenge 1 only: your prediction of how many Newton steps it takes, 1 to 3, 4 to 6, 7 to 10 or More than 10. Not yet chosen until you predict; the path appears once you do.
- Start point, y (required)
-
Default 1 Range -5 to 5
About this input
The y coordinate of the start point (-5 to 5).
- Start point, x (required)
-
Default 1 Range -5 to 5
About this input
The x coordinate of the point all three methods start from (-5 to 5). Drag the start marker on the canvas.
- Solver tolerance (required)
-
Default 0.0001 Range 1E-08 to 0.01
About this input
The stop test: a method stops when both the mismatch and the last step are below this size (the step relative to the size of the point). Choose 0.01, 0.001, 0.0001, 0.000001 or 0.00000001.
- Curve 2 handle A, y (required)
-
Default -1 Range -5 to 5
About this input
Curve 2, handle A, y coordinate (-5 to 5).
- Curve 1 handle A, y (required)
-
Default 0 Range -5 to 5
About this input
Curve 1, handle A, y coordinate (-5 to 5).
- Curve 1 handle A, x (required)
-
Default 0 Range -5 to 5
About this input
Curve 1, handle A, x coordinate (-5 to 5). Handle A is the centre of a circle, a point on a line, the vertex of a parabola, the centre of a hyperbola (where its asymptotes cross) or a crest of a wave. Drag it on the canvas.
- Challenge number (required)
-
Default 0 Range 0 to 5
About this input
Pick a challenge from 1 to 5, or 0 for none. A challenge fixes its own settings and leaves only some handles or the start to you.
- Curve 1 handle B, x (required)
-
Default 2 Range -5 to 5
About this input
Curve 1, handle B, x coordinate (-5 to 5). Handle B is a point on the rim of a circle, a second point on a line, a point on a parabola or hyperbola, or the next trough of a wave. Drag it on the canvas.
- Curve 2 handle A, x (required)
-
Default -2 Range -5 to 5
About this input
Curve 2, handle A, x coordinate (-5 to 5); handle A means the same as for curve 1.
- Curve 1 shape (required)
-
Default Circle Allowed Circle, Line, Parabola, Hyperbola, Wave
About this input
The shape of curve 1: Circle, Line, Parabola, Hyperbola or Wave. Its two handles keep their places when you switch shape.
- Curve 1 handle B, y (required)
-
Default 0 Range -5 to 5
About this input
Curve 1, handle B, y coordinate (-5 to 5).
Outputs
- Model Status
-
No unit declared
About this output
OK, CHECK: (the results are shown but a method failed or the crossing lies outside the plotted area) or NOT VALID: (an input or a handle position cannot be used; the results are empty), with the reason.
- Damped Newton steps
-
No unit declared
About this output
How many damped Newton steps were taken (0 to 30).
- Model version
-
No unit declared
About this output
The version of this lab's model.
- Jacobian determinant at Newton's last step
-
No unit declared
About this output
The determinant of the Jacobian at Newton's last point. Near zero the two tangent lines are nearly parallel, which is why Newton slows down at a tangency.
- Formula module versions
-
No unit declared
About this output
The formula modules this lab's model uses and their versions.
- Damped Newton crossing, y
-
No unit declared
About this output
The y coordinate of the crossing damped Newton reached. Blank when it did not converge.
- Damped Newton, step by step: the point, the mismatch, the shortened step and its damping factor
-
No unit declared
About this output
Damped Newton step by step: the point, the mismatch, the step length, the damping factor (1, 1/2, 1/4, ...) and a status code. Rows after the stop are blank.
- The two curves as 121 points each (a blank point breaks the line)
-
No unit declared
About this output
The two curves as 121 points each, for drawing. A blank row breaks the line (a hyperbola's two branches, or a curve far outside the area).
- Damped Newton outcome
-
No unit declared
About this output
How damped Newton stopped: Converged, Jacobian singular, Diverged, Stalled (no shortened step reduced the mismatch) or Not converged in 30 steps.
- Damped Newton crossing, x
-
No unit declared
About this output
The x coordinate of the crossing damped Newton reached. Blank when it did not converge.
- Damped Newton final mismatch
-
No unit declared
About this output
The size of the mismatch at damped Newton's last point. Blank when the method diverged.
- Newton's method, step by step: the point, the mismatch, the step, the Jacobian determinant and the status code
-
No unit declared
About this output
Newton's method step by step, k = 0 to 30: the point, the mismatch, the step length, the Jacobian determinant and a status code (0 running, then the code of the stop). Rows after the stop are blank; while challenge 1 waits for a prediction only row 0 is given.
- Solver tolerance used
-
No unit declared
About this output
The solver tolerance the lab used.
- Crossings found by the start grid
-
No unit declared
About this output
How many different crossings inside the plotted area Newton reaches from the 21 x 21 grid of starts (0 to 4). Blank when a curve is a wave.
- Start point, x used
-
No unit declared
About this output
The start x the lab used (a challenge may fix it).
- The two tangent lines at each Newton point, clipped to the plotted area (the next point is where they cross)
-
No unit declared
About this output
For each Newton step, the two tangent lines (each curve's straight-line approximation at the current point) clipped to the plotted area, as two end points each. The next Newton point is where they cross. Blank where a line misses the area.
- Start point, y used
-
No unit declared
About this output
The start y the lab used (a challenge may fix it).
- The crossings the start grid found, left to right
-
No unit declared
About this output
The crossings the start grid found, in order of x: their coordinates and how many grid starts reach each.
- Newton final mismatch
-
No unit declared
About this output
How far from zero the two curve equations are at Newton's last point (the size of the mismatch). Blank when the method diverged.
- Newton outcome
-
No unit declared
About this output
How Newton's method stopped: Converged, Jacobian singular (the two tangent lines are parallel), Diverged, or Not converged in 30 steps.
- Newton crossing, x
-
No unit declared
About this output
The x coordinate of the crossing Newton's method reached. Blank when it did not converge.
- Newton steps
-
No unit declared
About this output
How many Newton steps were taken before the method stopped (0 to 30).
- Newton crossing, y
-
No unit declared
About this output
The y coordinate of the crossing Newton's method reached. Blank when it did not converge.
- Curve 2 shape used
-
No unit declared
About this output
The curve 2 shape the lab used (a challenge may fix it).
- Broyden steps
-
No unit declared
About this output
How many Broyden steps were taken (0 to 30).
- Broyden crossing, y
-
No unit declared
About this output
The y coordinate of the crossing Broyden's method reached. Blank when it did not converge.
- Challenge feedback
-
No unit declared
About this output
The prompt while challenge 1 waits for a prediction, then a hint, or the explanation once met.
- Challenge: the value scored
-
No unit declared
About this output
The value the selected challenge scores: a step count, a distance ratio or a number of crossings (blank while challenge 1 waits for a prediction).
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks.
- Broyden crossing, x
-
No unit declared
About this output
The x coordinate of the crossing Broyden's method reached. Blank when it did not converge.
- Basin map note
-
No unit declared
About this output
A note on the basin map: why it is not shown for a wave, or that some grid starts reach a crossing outside the plotted area or beyond the first four found. Blank otherwise.
- Basin map: which crossing 12 Newton steps reach from each start of the 21 x 21 grid (0 none, 1 to 4 the crossings in the root list, 5 another crossing)
-
No unit declared
About this output
The basin map: for each of 21 x 21 starts from -5 to 5, which crossing 12 Newton steps reach (1 to 4 in order of x, 5 another crossing, 0 none). The first row and column give the start coordinates.
- Broyden's method, step by step: the point, the mismatch and the step
-
No unit declared
About this output
Broyden's method step by step: the point, the mismatch, the step length and a status code. Rows after the stop are blank.
- Broyden final mismatch
-
No unit declared
About this output
The size of the mismatch at Broyden's last point. Blank when the method diverged.
- Broyden outcome
-
No unit declared
About this output
How Broyden's method stopped: Converged, Jacobian estimate singular, Diverged or Not converged in 30 steps.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, else 0.
- Curve 2 handle A, x used
-
No unit declared
About this output
Curve 2 handle A, x, as used.
- Curve 1 shape used
-
No unit declared
About this output
The curve 1 shape the lab used (a challenge may fix it).
- Curve 2 handle A, y used
-
No unit declared
About this output
Curve 2 handle A, y, as used.
- Curve 2 handle B, y used
-
No unit declared
About this output
Curve 2 handle B, y, as used.
- Curve 2 handle B, x used
-
No unit declared
About this output
Curve 2 handle B, x, as used.
- Curve 1 handle B, y used
-
No unit declared
About this output
Curve 1 handle B, y, as used.
- Convergence order
-
No unit declared
About this output
The convergence order read from Newton's last three useful mismatches: about 2 where the curves cross at a clear angle, about 1 where they just touch. Blank when there are too few steps.
- Challenge result
-
No unit declared
About this output
No challenge selected, MET or NOT MET.
- Curve 1 handle A, x used
-
No unit declared
About this output
Curve 1 handle A, x, as used.
- Curve 1 handle B, x used
-
No unit declared
About this output
Curve 1 handle B, x, as used.
- Curve 1 handle A, y used
-
No unit declared
About this output
Curve 1 handle A, y, as used.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab solves two nonlinear equations in two unknowns, F₁(x, y) = 0 and F₂(x, y) = 0, by drawing them. Each equation is a curve in the plane from -5 to 5 in x and y: a circle, a line, a parabola, a hyperbola or a wave, set by two draggable handles. The solutions are the points where the two curves cross. Three methods start from one draggable start point: Newton's method, damped Newton and Broyden's method, each for up to 30 steps. The model returns every step of every method, with the two tangent lines at each Newton step; each method's crossing, step count, outcome and final mismatch; the Jacobian determinant and the observed convergence order; a 21 by 21 basin map of which crossing Newton's method reaches from each start on a grid; and five scored challenges.
It is a lab for learning how Newton's method finds the crossing of two curves: why it is fast where the curves cross at a clear angle and slow where they just touch, why the crossing it finds is not always the nearest one, and how damping keeps it from being thrown far away. It is not a general equation solver. It has two equations only, five curve shapes and no typed formulas, every method has a fixed budget of 30 steps, and the basin map can miss a crossing whose region is smaller than its grid spacing.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the two curves, the paths of the three methods, the tangent lines at each Newton step, the residual chart, the basin map and the crossing markers all come from the model's own results. The page computes no curve, step, crossing or residual itself.
Inputs and units
Every input is a pure number or a choice; the lab has no physical units. Points are (x, y), with x to the right and y upward, in a plotted area from -5 to 5 in each direction.
| Input | Meaning and unit |
|---|---|
| Curve 1 shape | Circle (default), Line, Parabola, Hyperbola or Wave. Its two handles keep their places when you switch shape. |
| Curve 1 handle A, x and y | Each from -5 to 5 (default (0, 0)). Handle A is the centre of a circle, a point on a line, the vertex of a parabola, the centre of a hyperbola (where its asymptotes cross) or a crest of a wave. |
| Curve 1 handle B, x and y | Each from -5 to 5 (default (2, 0)). Handle B is a point on the rim of a circle, a second point on a line, a point on a parabola or hyperbola, or the next trough of a wave. |
| Curve 2 shape | As curve 1 (default Line). |
| Curve 2 handle A and B, x and y | As curve 1, each from -5 to 5 (default (-2, -1) and (2, 1), the line y = x/2). |
| Start point, x and y | Where all three methods start, each from -5 to 5 (default (1, 1)). |
| Solver tolerance | From 1×10⁻⁸ to 0.01 (default 1×10⁻⁴): a method stops when both the mismatch and its last step are below this size, the step relative to the size of the point. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Your prediction: Newton steps | Not yet chosen (the start), 1 to 3, 4 to 6, 7 to 10 or More than 10: your answer for challenge 1. |
Where each input is set:
- On the canvas only: each curve's shape (a row of shape chips for each curve), the two handles of each curve and the start marker. The handles and the start are dragged, or moved with the arrow keys, in steps of 0.05; Enter opens an exact entry. None of these is in the input panel.
- With challenge 1 only: your prediction. It is not in the input panel and appears only in that challenge.
- In the input panel: the solver tolerance, offered as one of five choices, 0.01, 0.001, 0.0001, 0.000001 and 0.00000001 (the model accepts any value from 1×10⁻⁸ to 0.01), and the challenge number.
Every shape uses both of its handles, so no input is ever left unused, and every input is checked on its entered value.
Governing relationships
The curves. With handle A = (a_x, a_y), handle B = (b_x, b_y), d_x = b_x - a_x and d_y = b_y - a_y, each curve is the set of points where its function F is zero:
- Circle: F = (x - a_x)² + (y - a_y)² - r², with r² = d_x² + d_y², so B lies on the rim.
- Line: F = (n_x·(x - a_x) + n_y·(y - a_y))/|B - A|, with (n_x, n_y) = (a_y - b_y, b_x - a_x), so F is the signed distance from the line through A and B.
- Parabola: F = y - a_y - w·(x - a_x)², with w = d_y/d_x², so A is the vertex and B lies on the curve.
- Hyperbola: F = (x - a_x)·(y - a_y) - c, with c = d_x·d_y, so A is where the asymptotes cross and B lies on the curve.
- Wave: F = y - k - h·sin(ω·x + φ), with the middle level k = (a_y + b_y)/2, the height h = (a_y - b_y)/2, ω = π/(b_x - a_x) and φ = π/2 - ω·a_x, so A is a crest and B the next trough.
The model also evaluates each curve's exact slope (the gradient of F), which gives the Jacobian J, the 2 by 2 matrix whose rows are the gradients of F₁ and F₂.
The Newton step. At the point x_k, the Newton step Δ solves J·Δ = -F. The model solves it by Cramer's rule: with det = j₁₁·j₂₂ - j₁₂·j₂₁,
- Δx = (-F₁·j₂₂ + F₂·j₁₂)/det and Δy = (-F₂·j₁₁ + F₁·j₂₁)/det.
Geometrically, each curve's tangent line at x_k is its straight-line approximation F_i + ∇F_i·(p - x_k) = 0, and the next point x_k + Δ is where the two tangent lines cross.
The tests on each step, the same for all three methods, first match wins:
- Diverged: the point is farther than 10,000,000 from the origin (a million times the width of the plotted area). This is checked first, and the curves are not evaluated beyond it.
- Singular: |det| ≤ 1×10⁻¹²·(|j₁₁·j₂₂| + |j₁₂·j₂₁|). The two tangent lines are parallel, or nearly so, and the step cannot be taken. A matrix with a zero row, such as at the centre of a circle, has det = 0 exactly.
- Converged: the step can be taken, the mismatch |F| = √(F₁² + F₂²) is at most the tolerance tol, and the step size |Δ| is at most tol·max(1, |x_k|). The crossing reported is x_k, and the step count is k.
- Not converged in 30 steps: the method is still running at step 30.
- Otherwise the method moves to the next point and continues.
Newton's method takes the full step: the next point is x_k + Δ.
Damped Newton applies the same tests to the full step Δ. When it continues, it tries the step lengths α = 1, 1/2, 1/4, ... down to 1/512 (at most 10 trials) and takes the first trial point x_k + α·Δ that stays within 10,000,000 of the origin and lowers the squared mismatch enough: |F(x_k + α·Δ)|² ≤ (1 - 1×10⁻⁴·α)·|F(x_k)|² (Armijo's sufficient-decrease test). When no trial passes, the run ends Stalled.
Broyden's method starts from the true Jacobian, B₀ = J(x₀), and then never evaluates J again. Each step solves B·Δ = -F with the same tests (its singular outcome reads Jacobian estimate singular) and takes the full step s = Δ. At the new point, with Y the observed change in F from the old point to the new one, it corrects its estimate by the rank-one update B ← B + (Y - B·s)·sᵀ/(sᵀ·s), Broyden's good update, leaving B unchanged when s = 0.
The convergence order. From Newton's mismatches R(k), the model takes the last three successive ones that each are at least 1×10⁻⁸ and strictly falling, and computes p = ln(R(k+1)/R(k)) / ln(R(k)/R(k-1)). It is about 2 where the curves cross at a clear angle (each step roughly doubles the correct digits) and about 1 where they just touch (each step roughly halves the error). It is blank when no such three exist.
The tangent lines. For each Newton step and each curve, the model draws the tangent line through the foot point q = x_k - F_i·∇F_i/|∇F_i|², perpendicular to the gradient, clipped to the plotted area. A line whose gradient is zero, or that misses the area, is blank.
The curve traces. Each curve is sampled at 121 points: a circle all the way round; a line between its ends on the plotted area; a parabola, hyperbola or wave at x = -5, -5 + 1/12, ... up to 5. A point with |y| > 50 is left blank, and a hyperbola is broken where it passes its centre, so its two branches are never joined.
The basin map. The model starts plain Newton from each of the 21 by 21 grid points x, y = -5, -4.5, ..., 5 and takes 12 steps. A start that meets a singular Jacobian or passes 10,000,000 stays where it is. A start has converged when its mismatch after the 12 steps is at most 1×10⁻¹⁰. Reading the grid row by row from the top, the first converged end inside the plotted area is crossing 1, and each later end farther than 1×10⁻⁵ from every crossing already found becomes a new one, up to four. Each grid start is then marked with the crossing it reached (within 1×10⁻⁵), 5 for another crossing (outside the plotted area or beyond the first four), or 0 for none. The crossings are numbered in order of x, with ties within 1×10⁻⁵ broken by y.
Calculation sequence
- The model checks the inputs in the order of the status list under Errors and warnings, on the values entered, the handle geometry of curve 1 and then curve 2 last.
- It fixes the values in use: yours, or in a challenge the challenge's own, except the inputs it leaves to you.
- It derives each curve's parameters from its shape and handles and samples the two curve traces.
- It runs Newton's method, damped Newton and Broyden's method step by step from the start, each until it converges, meets a singular matrix, diverges, stalls (damped Newton only) or reaches 30 steps, and it clips the two tangent lines at each Newton step.
- It reads each method's crossing, step count, outcome, mismatch and, for Newton, the final determinant and the convergence order.
- It runs the 21 by 21 basin map and lists the crossings found.
- It sets the status and, in a challenge, scores it and holds back what the challenge keeps back.
Outputs and interpretation
- Newton's crossing (x and y), Newton steps (0 to 30), how Newton stopped (Converged, Jacobian singular, Diverged, or Not converged in 30 steps) and Newton's mismatch, the size of F at its last point. The crossing is blank unless the method converged; the mismatch is blank when it diverged.
- Damped Newton and Broyden's method: the same four results. Damped Newton can also end Stalled; Broyden's singular outcome reads Jacobian estimate singular.
- Final determinant: the Jacobian determinant at Newton's last point. Near zero the two tangent lines are nearly parallel, which is why Newton slows down at a tangency.
- Convergence order: as above.
- Crossings found by the start grid (0 to 4, inside the plotted area), the list of crossings with their coordinates and how many grid starts reach each, the basin map, and a basin note: The basin map is not shown when a curve is a wave, or Some grid starts reach a crossing outside the plotted area or beyond the first four found; they are coloured as another crossing.
- Settings used: the shapes, handles, start and tolerance the model used (a challenge's own while one is selected), and the model and module versions.
- The steps of each method, from step 0 (the start) to 30: the point, the mismatch, the step length and a status code (0 while running, then 1 converged, 2 not converged at the cap, 3 singular, 4 diverged, 5 stalled), with the Jacobian determinant for Newton and the damping factor (1, 1/2, 1/4, ...) for damped Newton. Rows after the stop are blank.
- The tangent lines: for each Newton step, the end points of each curve's tangent line in the plotted area.
- The curve traces: the 121 points of each curve.
Reading the canvas: the two curves are drawn from the model's points, with their handles and the start marker. The method chips choose which path is shown; all three methods always run. On each Newton frame the two tangent lines are dashed in the curves' colours, and a ring marks the next point, where they cross. A player steps through the frames, and a chart plots the mismatch at each step on a log scale. At Explore the chart and the paths show Newton's method only; from Experiment they show all three methods. At Advanced the basin map is laid under the curves, with each crossing's starts in its own colour, a neutral colour for no crossing in 12 steps and another colour for another crossing, and rings mark the crossings found. The status and the numbers are results, never drawn on the canvas.
What to take from the lab: where the curves cross at a clear angle, Newton's method makes big jumps far away and then, near the crossing, roughly doubles the correct digits at each step. Where they just touch, the two crossings merge, the tangent lines become nearly parallel and the determinant tends to zero, and Newton slows to halving the error each step. Newton follows the tangent lines, not distance, so the region of starts that leads to each crossing is not simply the area closest to it. Damping shortens any step that would make the mismatch grow, so the path cannot be thrown far away. Broyden's method needs the Jacobian only at the start and learns the rest from the changes it sees. A circle and a parabola can cross at most four times.
Challenges
Each challenge fixes both curves, their shapes and the start, with a tolerance of 1×10⁻⁴, and leaves only the inputs it names to you. On the page a challenge's runs wait for you: challenge 1 until you predict, challenges 2 to 5 until you press Run. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met.
- Predict the steps (Explore). The default circle and line, with the start at (-4.5, 0.5). From the marked start, predict how many Newton steps it takes to reach the crossing. Met when the range you chose contains Newton's step count; a run that does not converge counts as More than 10. The value scored is the step count.
- Make Newton slow (Experiment). The circle of radius 2 at the origin and a line, from the start (0.5, 4.5). Drag the line so that Newton's method needs at least 12 steps from the marked start and still reaches a crossing. Met when Newton converges in 12 steps or more. The value scored is the step count.
- Not the closest crossing (Advanced). A circle and a hyperbola. Drag the start to a place from which Newton's method reaches a crossing that is not the closest one: another crossing must be at most 0.8 times as far away. Met when Newton converges to a crossing the start grid found (within 0.01), the grid found at least two crossings, and another crossing is at most 0.8 times as far from the start as the one reached. The value scored is that distance ratio, to 3 decimals.
- Damping to the rescue (Experiment). A wave and a line. Drag the start to a place from which plain Newton fails or leaves the plotted area, while damped Newton reaches a crossing inside it. Met when damped Newton converges inside the plotted area while Newton does not converge or converges outside it. The value scored is damped Newton's step count.
- Four crossings (Advanced). The circle of radius 2 at the origin and a parabola, from the start (1, 1). Drag the parabola's handles until the start grid finds four different crossings with the circle. Met when the grid finds 4. The value scored is the number of crossings found.
Challenge 1 holds back the answer until you predict. While your prediction reads Not yet chosen, every method's crossing, step count, outcome and mismatch, the final determinant, the convergence order and the value scored are blank, as are steps 1 to 30 of every table, and the page asks you to choose your prediction first. The curves, the start, step 0 of each table (with the first tangent lines), the basin map and the status stay. Any prediction reveals everything, met or not. Challenge 3 holds back the basin map's colours and the count of grid starts for each crossing until it is met, because they show which crossing each start reaches; the crossing markers, your own path and the value scored stay. Challenges 2, 4 and 5 hold nothing back. Your prediction changes nothing outside challenge 1.
Validation and status logic
The status reads the first match in the list under Errors and warnings. The NOT VALID checks read the values you entered, inside a challenge too, even for inputs the challenge replaces; the handle geometry is checked for curve 1, then curve 2, by the shape entered. The CHECK items read the run with the values in use. A failure of any method turns the status to CHECK, Newton's first, so no method fails silently. CHECK items apply inside challenges as well: challenge 4 is met while Newton's crossing lies outside the plotted area, which is a CHECK on purpose. A challenge number that is not a whole number from 0 to 5 is NOT VALID.
Assumptions and limitations
- Two equations in two unknowns only, each one of five curve shapes set by two handles; no typed formulas.
- At most 30 steps for each method and at most 10 halvings for each damped step. A point farther than 10,000,000 from the origin counts as diverged.
- A matrix counts as singular when its determinant is at most 1×10⁻¹² of the size of its terms.
- The basin map uses 12 plain Newton steps from starts 0.5 apart. It can miss a crossing whose region of starts is smaller than that spacing, and a crossing where the curves just touch is found only from a start exactly on it. It lists at most four crossings inside the plotted area. It is not shown when a curve is a wave.
- A crossing Newton reaches outside the plotted area is reported, with a CHECK.
- Roots are shown to 6 decimals at every tolerance.
- A value very close to a threshold, such as a determinant ratio near 1×10⁻¹², a mismatch or step near the tolerance, or a grid start's final mismatch near 1×10⁻¹⁰, may fall either side of it. A path that is thrown far away, such as near a line that just misses a circle, carries last-digit differences on from step to step.
Restrictions and non-computing states
Under NOT VALID every result and every table is blank (the tables keep their headings), except the model and module versions, the challenge status (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.
A method that stops early, by converging, meeting a singular matrix, diverging or stalling, leaves the later rows of its table blank. When a curve is a wave, the basin map, the list of crossings and the count of crossings found are blank, and the basin note says why.
In challenge 1, until you predict, and in challenge 3, until it is met, the results listed under Challenges are held back.
Errors and warnings
The status messages, first match wins (curve N is curve 1, then curve 2):
- NOT VALID: each curve shape must be Circle, Line, Parabola, Hyperbola or Wave
- NOT VALID: each handle coordinate must be a number from -5 to 5
- NOT VALID: the start point coordinates must be numbers from -5 to 5
- NOT VALID: the solver tolerance must be a number from 0.00000001 to 0.01
- NOT VALID: the challenge number must be a whole number from 0 to 5
- NOT VALID: the step-count prediction must be 1 to 3, 4 to 6, 7 to 10 or More than 10
- NOT VALID: curve N is a circle whose rim handle sits on its centre; move the rim handle away — the handles are less than 1×10⁻⁶ apart.
- NOT VALID: curve N is a line whose two handles coincide; move them apart — less than 1×10⁻⁶ apart.
- NOT VALID: curve N is a parabola whose width handle is directly above or below its vertex; move it sideways — less than 1×10⁻⁶ apart across.
- NOT VALID: curve N is a hyperbola whose point handle sits on one of its asymptotes; move it off both — less than 1×10⁻⁶ from either asymptote.
- NOT VALID: curve N is a wave whose crest and trough handles are less than 0.45 apart across; move them further apart
- CHECK: Newton's method met a singular Jacobian (the two tangent lines are parallel); try another start
- CHECK: Newton's method diverged from this start
- CHECK: Newton's method did not converge in 30 steps
- CHECK: damped Newton did not converge from this start — damped Newton ended other than Converged.
- CHECK: Broyden's method did not converge from this start — Broyden's method ended other than Converged.
- CHECK: Newton's method converged to a crossing outside the plotted area — x or y of Newton's crossing is beyond 5 in size.
- OK — all three methods converged, and Newton's crossing lies inside the plotted area.
References
This laboratory is an educational model of solving two nonlinear equations in two unknowns. Each equation is a curve (a circle, line, parabola, hyperbola or wave) set by two handles, and the solutions are where the two curves cross. Newton's method solves the 2 by 2 linear system J d = -F for each step by Cramer's rule, so the next point is where the two tangent lines cross; a matrix whose determinant is tiny compared with its entries is treated as singular. Damped Newton halves the step until the squared mismatch falls by a sufficient-decrease (Armijo) factor, and Broyden's good method starts from the true Jacobian and corrects its estimate by a rank-one update from each observed change in the equations. A run stops when the mismatch and the step are both within the tolerance, when the point runs off past 10^7, or after 30 steps. At Advanced, a 21 by 21 basin map shows which crossing 12 Newton steps reach from each start.
Sources and further reading
- Newton's method for systems of nonlinear equations, and secant updates of the Jacobian for such systems: J. E. Dennis Jr. and R. B. Schnabel, Numerical Methods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, chapter 5, Newton's Method for Nonlinear Equations and Unconstrained Minimization, and chapter 8, Secant Methods for Systems of Nonlinear Equations. doi:10.1137/1.9781611971200
- Newton-type methods for nonlinear equations in a general optimization text: J. Nocedal and S. J. Wright, Numerical Optimization, 2nd edition, Springer, 2006, chapter 11, Nonlinear Equations. doi:10.1007/978-0-387-40065-5
- The sufficient-decrease step rule behind the damped Newton run: L. Armijo, "Minimization of functions having Lipschitz continuous first partial derivatives", Pacific Journal of Mathematics 16(1), 1966, pages 1-3. doi:10.2140/pjm.1966.16.1
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; it is not a general equation solver, and real problems need scaling, more unknowns and a tested solver.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.