Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Start point 1: y (required)
-
Default 1 Range -4 to 4
About this input
The y of start point 1, from -4 to 4. Drag the dot on the plane.
- Start point 2: y (required)
-
Default 4 Range -4 to 4
About this input
The y of start point 2, from -4 to 4. Drag the dot on the plane. Used while at least 2 start points are active.
- Start point 3: y (required)
-
Default -4 Range -4 to 4
About this input
The y of start point 3, from -4 to 4. Drag the dot on the plane. Used while at least 3 start points are active.
- Start point 4: x (required)
-
Default 4 Range -4 to 4
About this input
The x of start point 4, from -4 to 4. Drag the dot on the plane (a popover gives exact entry). Used while at least 4 start points are active.
- Start point 5: x (required)
-
Default 3 Range -4 to 4
About this input
The x of start point 5, from -4 to 4. Drag the dot on the plane (a popover gives exact entry). Used while at least 5 start points are active.
- Start point 6: x (required)
-
Default -3 Range -4 to 4
About this input
The x of start point 6, from -4 to 4. Drag the dot on the plane (a popover gives exact entry). Used while at least 6 start points are active.
- System (required)
-
Default Linear Allowed Linear, Damped pendulum, Van der Pol, Duffing double well, Competing species
About this input
The system that moves the dots: Linear (a 2 by 2 matrix), Damped pendulum, Van der Pol, Duffing double well or Competing species. Chosen with the system chips on the canvas.
- Number of start points (required)
-
Default 4 Range 1 to 6
About this input
How many start points are active, 1 to 6. Tap the empty plane to add a dot; remove one from its menu.
- Van der Pol strength (required)
-
Default 1 Range 0 to 2
About this input
Van der Pol only: the strength mu in y' = -x + mu (1 - x^2) y; from 0 to 2 in steps of 0.1. Set with the parameter knob.
- Start point 4: y (required)
-
Default -1 Range -4 to 4
About this input
The y of start point 4, from -4 to 4. Drag the dot on the plane. Used while at least 4 start points are active.
- Start point 5: y (required)
-
Default -3 Range -4 to 4
About this input
The y of start point 5, from -4 to 4. Drag the dot on the plane. Used while at least 5 start points are active.
- Start point 6: y (required)
-
Default 3 Range -4 to 4
About this input
The y of start point 6, from -4 to 4. Drag the dot on the plane. Used while at least 6 start points are active.
- Your prediction: the type of the middle rest point (required)
-
Default Not yet chosen Allowed Not yet chosen, Saddle, Stable node, Unstable node, Stable spiral, Unstable spiral, Centre
About this input
Challenge 1 only: your prediction of the type of the middle rest point, chosen with a chip beside the trace-determinant map before any path is shown. It starts on Not yet chosen.
- Matrix entry a (top left) (required)
-
Default 1 Range -3 to 3
About this input
Linear system only: the top-left matrix entry a in x' = a x + b y; from -3 to 3 in steps of 0.1. Drag the cell on the matrix board.
- Matrix entry b (top right) (required)
-
Default 2 Range -3 to 3
About this input
Linear system only: the top-right matrix entry b in x' = a x + b y; from -3 to 3 in steps of 0.1.
- Challenge number (required)
-
Default 0 Range 0 to 5
About this input
0 for free play; 1 to 5 load a challenge, whose settings replace yours except the one it leaves to you.
- Double-well damping (required)
-
Default 0.25 Range 0 to 1
About this input
Duffing double well only: the damping delta in y' = x - x^3 - delta y; from 0 to 1 in steps of 0.05. Set with the parameter knob.
- Run time (required)
-
Unit time units Default 4 Range 1 to 20
About this input
How long each path runs, a whole number of time units from 1 to 20. Each path takes 200 equal steps of duration / 200.
- Start point 1: x (required)
-
Default -4 Range -4 to 4
About this input
The x of start point 1, from -4 to 4. Drag the dot on the plane (a popover gives exact entry).
- Start point 2: x (required)
-
Default -1 Range -4 to 4
About this input
The x of start point 2, from -4 to 4. Drag the dot on the plane (a popover gives exact entry). Used while at least 2 start points are active.
- Start point 3: x (required)
-
Default 1 Range -4 to 4
About this input
The x of start point 3, from -4 to 4. Drag the dot on the plane (a popover gives exact entry). Used while at least 3 start points are active.
- Matrix entry c (bottom left) (required)
-
Default 2 Range -3 to 3
About this input
Linear system only: the bottom-left matrix entry c in y' = c x + d y; from -3 to 3 in steps of 0.1.
- Matrix entry d (bottom right) (required)
-
Default -2 Range -3 to 3
About this input
Linear system only: the bottom-right matrix entry d in y' = c x + d y; from -3 to 3 in steps of 0.1.
- Pendulum damping (required)
-
Default 0.5 Range 0 to 3
About this input
Damped pendulum only: the damping beta in y' = -sin x - beta y; from 0 to 3 in steps of 0.05. Set with the parameter knob.
Outputs
- Pendulum damping used
-
No unit declared
About this output
The pendulum damping the lab used (Damped pendulum only).
- Time over the top (pendulum, path 1)
-
Unit time units
About this output
Damped pendulum, path 1: the time at which the pendulum first passes over the top (x = pi or -pi), interpolated between steps. Blank if it never does.
- The paths, frame by frame: time and the x, y of each start point (every second RK4 step)
-
No unit declared
About this output
Every second RK4 step of each path: the time and the x, y of each start point (blank once a path has left the plane or for an inactive start). The canvas draws the paths and plays them from these frames.
- Measured period (Van der Pol, path 1)
-
Unit time units
About this output
Van der Pol, path 1: the time between the last two upward crossings of x = 0 (blank with fewer than two crossings or if the path left the plane).
- Model version
-
No unit declared
About this output
The version of this lab's model.
- Model Status
-
No unit declared
About this output
OK when the inputs were used as entered; CHECK when the results need care (a competing-species start with a negative population, or a time step that is coarse for the motion); NOT VALID with the reason when an input cannot be used.
- The nullclines: where x' = 0 and where y' = 0
-
No unit declared
About this output
The nullclines as 31 points each: where x' = 0 and where y' = 0. A point beyond |y| = 5 is blank.
- Formula module versions
-
No unit declared
About this output
The versions of the formula modules this lab uses.
- Estimated method error at the end (path 1)
-
No unit declared
About this output
An estimate of the method error at the end of path 1: the difference from a run with twice the step, divided by 15 (Richardson). Blank when either run left the plane.
- Number of start points used
-
No unit declared
About this output
The number of start points the lab used (a challenge may fix it).
- Time step h
-
Unit time units
About this output
h = duration / 200, the step of every path.
- Van der Pol strength used
-
No unit declared
About this output
The Van der Pol strength the lab used (Van der Pol only).
- Each path: where it starts, where it ends and what it does
-
No unit declared
About this output
Each active start point: where it starts and ends, the end time and its fate (runs away, settles near a rest point, keeps moving, approaches a line of rest points or does not move).
- Speed at the top (pendulum, path 1)
-
No unit declared
About this output
Damped pendulum, path 1: the speed |y| as it passes over the top, interpolated between steps.
- The separatrices of the saddle: the two outgoing and the two incoming branches
-
No unit declared
About this output
The four branches of the saddle's separatrices: the two outgoing (Out) and the two incoming (In) curves, as x, y points. Blank when the system has no saddle.
- System used
-
No unit declared
About this output
The system the lab used (a challenge may fix it).
- Step ratio (largest h times the local rate)
-
No unit declared
About this output
The time step times the fastest local rate of the motion, the largest over every computed row of every path. Above 2.5 the steps are coarse for the motion (the method is stable up to about 2.785 on the real axis).
- Longest run time inside the step limit
-
Unit time units
About this output
The longest run time for which every computed row would keep its step ratio inside 2.5: the run time times 2.5 divided by the step ratio.
- Challenge result
-
No unit declared
About this output
No challenge selected, MET or NOT MET, scored by the lab.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, otherwise 0.
- Double-well damping used
-
No unit declared
About this output
The double-well damping the lab used (Duffing double well only).
- The direction field: the grid point, a unit arrow and a speed class at each point of the 9 by 9 grid
-
No unit declared
About this output
The arrow at each of the 81 points of the 9 by 9 grid from -4 to 4 (x fastest): the point x and y, its unit direction and a speed class 1 (slow), 2 or 3 (fast). The direction and class are blank at a rest point.
- Challenge feedback
-
No unit declared
About this output
A hint while the challenge is not met, or why the answer works once it is.
- Measured amplitude (Van der Pol, path 1)
-
No unit declared
About this output
Van der Pol, path 1: the largest x over the last measured cycle, refined by a parabola through three steps.
- Challenge: the value scored
-
No unit declared
About this output
The value the challenge scores: the discriminant trace^2 - 4 det for challenge 2, the top speed for challenge 3, the end energy for challenge 4 and the damping for challenge 5 (blank for challenge 1).
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks you to do.
- Run time used
-
Unit time units
About this output
The run time the lab used (a challenge may fix it).
- Matrix entry b used
-
No unit declared
About this output
The matrix entry b the lab used (Linear system only).
- Matrix entry a used
-
No unit declared
About this output
The matrix entry a the lab used (Linear system only).
- Matrix entry d used
-
No unit declared
About this output
The matrix entry d the lab used (Linear system only).
- Matrix entry c used
-
No unit declared
About this output
The matrix entry c the lab used (Linear system only).
- The rest points: type, trace, determinant, eigenvalues and eigenvectors
-
No unit declared
About this output
Each listed rest point: its position, type code and type, the trace and determinant of its Jacobian, both eigenvalues (real and imaginary parts) and the unit eigenvectors (blank for a complex pair or when every direction is an eigenvector).
- Energy drift (conservative cases, path 1)
-
No unit declared
About this output
For the conservative cases (pendulum or double well without damping, Van der Pol with strength 0): how much the energy of path 1 changed from start to end. The exact motion keeps it constant, so this measures the method error.
- Error against the exact solution (linear, path 1)
-
No unit declared
About this output
Linear system only: the difference between path 1 at its last row and the exact solution e^(At) x0, relative to the size of the exact value.
- Type of rest point 1
-
No unit declared
About this output
The type of the first listed rest point (the middle one for every system but the pendulum and competition, where it is the origin): saddle, node, spiral, centre, star, degenerate node or a line of rest points, decided from exact integers.
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 draws the phase portrait of a two-variable system on one plane, x and y from -4 to 4. Five systems are offered, each a fixed form with at most one parameter: a linear system with a 2 by 2 matrix, the damped pendulum, the Van der Pol oscillator, the Duffing double well and a competing-species model. From up to six start points the model computes each path with 200 steps of the classic fourth-order Runge-Kutta method. It returns the rest points with their type, trace, determinant, eigenvalues and eigenvectors, the separatrices of the saddle, a direction field, the nullclines, each path's fate, the pendulum's passage over the top, the Van der Pol period and amplitude, accuracy measures and a step ratio that warns of a coarse step. Five scored challenges go with it.
It is a lab for learning how a plane system moves: why the trace and the determinant of the Jacobian decide whether a rest point is a saddle, a node, a spiral or a centre, why a pendulum goes over the top or swings back, why every Van der Pol path finds the same loop, and how the basins of a double well wind together. It is not a general equation solver. It accepts no typed formulas, its paths are numerical approximations with a fixed step, and it is not meant for analysing real mechanical, electrical or biological systems.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the direction arrows, the paths and their frames, the rest points and their types, the separatrices, the nullclines and the points on the trace-determinant map all come from the model's own tables. The page computes no path, rest point, type, eigenvalue or measure itself.
Inputs and units
x and y are plain plane coordinates and time is in plain time units; the lab has no physical units.
| Input | Meaning and unit |
|---|---|
| System | Linear (default), Damped pendulum, Van der Pol, Duffing double well or Competing species. |
| Matrix entries a, b, c and d | Linear system only, in x′ = a·x + b·y and y′ = c·x + d·y: each from -3 to 3 in steps of 0.1 (defaults 1, 2, 2 and -2). |
| Pendulum damping | Damped pendulum only: β in y′ = -sin x - β·y, from 0 to 3 in steps of 0.05 (default 0.5). |
| Van der Pol strength | Van der Pol only: μ in y′ = -x + μ·(1 - x²)·y, from 0 to 2 in steps of 0.1 (default 1). |
| Double-well damping | Duffing double well only: δ in y′ = x - x³ - δ·y, from 0 to 1 in steps of 0.05 (default 0.25). |
| Run time | T, a whole number of time units from 1 to 20 (default 4). Each path takes 200 equal steps of h = T/200. |
| Number of start points | A whole number from 1 to 6 (default 4): how many start points are active. |
| Start point 1 to 6, x and y | Each from -4 to 4 (defaults (-4, 1), (-1, 4), (1, -4), (4, -1), (3, -3) and (-3, 3)). A start is used while it is active. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Your prediction (challenge 1) | Not yet chosen (the start), Saddle, Stable node, Unstable node, Stable spiral, Unstable spiral or Centre: the type you predict for the middle rest point. |
Where each input is set:
- On the canvas only: the system (chips), the four matrix entries (squares on the matrix board, dragged in steps of 0.1), the parameter of the active system (one knob, with + and - keys), the start points (dots dragged on the plane, with a popover for exact entry), the number of start points (tap the empty plane to add a dot; remove one from its menu) and your prediction in challenge 1 (its buttons appear only in that challenge). None of these is in the input panel.
- In the input panel: the run time and the challenge number.
The model checks an input only when the chosen system reads it and the selected challenge leaves it to you; a matrix entry, a parameter of another system or an inactive start is never checked or read. The page itself refuses a value outside an input's range before the model runs.
Governing relationships
The five systems. With x′ and y′ the rates of change of x and y:
- Linear: x′ = a·x + b·y, y′ = c·x + d·y.
- Damped pendulum: x′ = y, y′ = -sin x - β·y (x is the angle from the bottom, y the angular speed).
- Van der Pol: x′ = y, y′ = -x + μ·(1 - x²)·y.
- Duffing double well: x′ = y, y′ = x - x³ - δ·y.
- Competing species: x′ = x·(3 - x - 2·y), y′ = y·(2 - x - y).
Every parameter is used on its step: an entry within one part in a billion of its 0.1 or 0.05 grid takes the grid value exactly.
The integration. Each path takes 200 steps of the classic fourth-order Runge-Kutta method with h = T/200, and the time of row n is n·h. Each step evaluates the field four times (at the start, twice at the half step, once at the full step) and advances by h/6 times (k₁ + 2·k₂ + 2·k₃ + k₄). A row is computed only while the previous row has |x| ≤ 400 and |y| ≤ 400 (100 times the plane's half-width); once a path passes that limit, every later row is blank. The path is drawn from every second row, 101 frames from t = 0 to T, while every measure reads all 200 rows.
The rest points. Each system has a fixed list of rest points, in closed form:
- Linear: (0, 0).
- Damped pendulum: (0, 0), (π, 0) and (-π, 0).
- Van der Pol: (0, 0).
- Duffing double well: (0, 0), (1, 0) and (-1, 0).
- Competing species: (0, 0), (0, 2), (3, 0) and (1, 1).
The type, from exact whole numbers. At each rest point the Jacobian J holds the four partial derivatives of x′ and y′. Because every parameter sits on its step, the model scales each Jacobian by a whole number (10 for the linear system and Van der Pol, 20 for the pendulum and the double well, 1 for competition) so that its entries are whole numbers. The trace, the determinant and the discriminant trace² - 4·det of the scaled Jacobian are then exact, and the type is read from them, first match wins:
- determinant < 0: Saddle;
- determinant = 0: Every point is a rest point when all four entries are 0, otherwise Zero eigenvalue: a line of rest points;
- trace = 0: Centre;
- discriminant < 0: Stable spiral when the trace is negative, Unstable spiral otherwise;
- discriminant > 0: Stable node when the trace is negative, Unstable node otherwise;
- discriminant = 0: Stable or Unstable star when the off-diagonal entries are both 0, otherwise Stable or Unstable degenerate node, by the sign of the trace.
No tolerance decides a type: a boundary such as a zero discriminant is met exactly or not at all. A trace of 0 in these systems is always a true centre: in the linear system exactly, and in the undamped pendulum, the undamped double well and Van der Pol with strength 0 because an energy is conserved there.
Eigenvalues and eigenvectors. For a 2 by 2 matrix with entries a, b, c, d the model uses the closed form with p = (a + d)/2, m = (a - d)/2 and disc = m² + b·c. With disc > 0 the eigenvalues are p ± √disc; the larger in size is computed directly and the other as det divided by it, which avoids cancellation. With disc < 0 they are the complex pair p ± i·√(-disc). They are listed smaller first. Each real eigenvector has unit length, signed so that its larger component is positive. A repeated eigenvalue with one direction has one eigenvector; a star, the zero matrix and a complex pair have none listed.
The step ratio. At every computed row of every path the model takes the system's Jacobian at that point and its spectral radius ρ (|p| + √disc for real eigenvalues, √det for a complex pair). The step ratio is the largest h·ρ over all those rows. The classic Runge-Kutta method stays stable on a decaying motion while this ratio is at most about 2.785 on the real axis and about 2.828 on the imaginary axis; the model warns above 2.5. The longest stable duration is T·2.5 divided by the step ratio.
Separatrices. The model traces the four branches of one saddle: the pendulum's at (π, 0), the double well's at (0, 0), the competition saddle at (1, 1), and the linear rest point when it is a saddle; Van der Pol has none. For the nonlinear systems each branch starts 0.0004 from the saddle, on either side, along an eigenvector. The two outgoing branches follow the eigenvector of the positive eigenvalue forwards in time (over 40 time units for the pendulum, 25 for the double well, 30 for competition); the two incoming branches follow that of the negative eigenvalue backwards in time (over 12, 15 and 6). Each branch takes 100 Runge-Kutta steps and stops once |x| or |y| passes 5; every fourth row is returned, 26 points a branch. The linear saddle's branches are the straight rays along its eigenvectors, out to a length of 6. The pendulum's mirror saddle at (-π, 0) is not traced.
The direction field. At the 81 whole-number points from -4 to 4 the model computes (x′, y′), returns the unit direction and a speed class from the squared speed s² = x′² + y′²: class 1 when s² ≤ 1, class 2 when s² ≤ 9, class 3 above. At a rest point on the grid the direction and class are blank.
Nullclines. The curves x′ = 0 and y′ = 0, each at 31 values of x from -4 to 4: for the linear system the lines a·x + b·y = 0 and c·x + d·y = 0; for the pendulum, Van der Pol and the double well y = 0 and, in turn, y = -sin x / β, y = x / (μ·(1 - x²)) and y = (x - x³)/δ (none without damping; x = 0 for Van der Pol with μ = 0); for competition y = (3 - x)/2 and y = 2 - x, besides the axes. A point with |y| above 5 is blank.
The fate of each path. First match wins: Runs away when the path passed the 400 limit before its last row; Does not move for the linear zero matrix; Settles near rest point r when the end point lies within 0.05 of listed rest point r; Approaches the line of rest points for a linear system with a line of rest points and a negative trace; otherwise Keeps moving.
Over the top (pendulum, path 1). The first step on which x rises through π or falls through -π. The model interpolates linearly between the two rows to the moment of the crossing, and reads the time and the speed |y| there.
Period and amplitude (Van der Pol, path 1). An upward crossing of x = 0 is a step on which x rises from below 0 to 0 or above, by at least 4×10⁻⁷; its time is interpolated linearly. With at least two crossings, the period is the time between the last two. The amplitude is the largest x between them, refined by the vertex of a parabola through that row and its two neighbours.
Energy (path 1). Pendulum: E = y²/2 - cos x. Double well: E = y²/2 - x²/2 + x⁴/4. Van der Pol: E = (x² + y²)/2. Without damping (β = 0, δ = 0 or μ = 0) the exact motion keeps E constant, so its change from the start to the last row measures the method's error.
Error estimates (path 1). A second run from path 1's start takes 100 steps of 2h. The Richardson estimate is the larger of the end differences in x and in y, divided by 15. For the linear system the exact solution is e^(At)·x₀ = e^(p·t)·(C·x₀ + S·(A - p·I)·x₀), with C = cosh(w·t), S = sinh(w·t)/w and w = √disc for a positive discriminant, C = cos(w·t), S = sin(w·t)/w and w = √(-disc) for a negative one, and C = 1, S = t at zero. The error is the larger difference in x or y at the last row, relative to max(1, the size of the exact x and y).
Calculation sequence
- The model checks the inputs the system reads and the challenge leaves free, in the order of the status list under Errors and warnings, up to the challenge number and your prediction.
- In a challenge, it replaces the inputs the challenge fixes with the challenge's values, and uses every parameter on its step.
- It lists the rest points, builds their whole-number Jacobians, and reads each type, trace, determinant, eigenvalues and eigenvectors.
- It runs each active path for 200 Runge-Kutta steps, row by row, with the stop rule, the 100-step check run of path 1, and the separatrices of the saddle.
- It computes the direction field and the nullclines.
- It reads each path's end and fate, the step ratio, the over-the-top crossing, the period and amplitude, the energy drift and the error estimates from the rows.
- It sets the status and, in a challenge, scores the challenge and withholds what the challenge keeps back.
Outputs and interpretation
- Equilibrium type: the type of the first listed rest point (the origin for every system).
- Step ratio and longest stable duration (time units): how coarse the step is for the fastest motion on any path, and the longest run time that keeps every row inside 2.5. Time step: h = T/200.
- Over-the-top time and speed at the top: pendulum, path 1; blank when it never crosses the top.
- Period and amplitude: Van der Pol, path 1; blank with fewer than two upward crossings or a path that left the plane.
- Energy drift: the conservative cases only. Error estimate (Richardson): blank when either run left the plane. Error against the exact solution: the linear system only, relative.
- Settings used: the system, matrix entries, parameter, run time and number of start points in effect (a challenge may fix them).
- Rest-point table: for each listed rest point, its position, type code and type, trace and determinant, both eigenvalues (real and imaginary parts) and the unit eigenvectors.
- Path summary: for each active start, its start and end point, its end time and its fate.
- Frames, separatrices, direction field and nullclines: the tables the canvas draws.
Reading the canvas: the plane shows the direction arrows, longer for a faster class, and the paths grow from the start dots as the player steps through the 101 frames; a blank row breaks a path. Rest points carry a mark for their type. The trace-determinant map has the parabola det = trace²/4 and the axes as fixed borders, and places each rest point at its trace and determinant. At Explore the lab offers the linear system only, with the rest point's position, type, trace and determinant. Experiment adds the other systems and their knob, the run time, the dashed nullclines, the separatrices, the full rest-point table and the pendulum and Van der Pol measures. Advanced adds the step ratio, the error measures and the settings used.
What to take from the lab: the trace and the determinant place a rest point on the map, and the map's regions are its types; below the parabola the paths slide straight in or out, above it they turn. A saddle's separatrices divide the plane into basins, and in the double well the basins wind together, so a start on the right can end in the left well. The pendulum goes over the top only with enough speed, and critical damping stops it swinging back and forth. Every Van der Pol path, from inside or outside, reaches the same loop, which no rest-point test predicts. In the competition model the start decides which species wins.
Challenges
Selecting a challenge loads its own system, settings and start points and leaves only the inputs it names to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. Challenges 1 and 2 are offered from Explore, challenges 3 to 5 from Experiment.
- Predict the middle rest point (introductory). A linear system with four starts and a run time of 10. Predict the type of the rest point in the middle before you see any paths. Met when your prediction matches the model's type.
- Straight in, no circling (introductory). From the same start, change the matrix so that every path reaches the middle without circling around it. Met when the trace is negative, the determinant positive and the discriminant trace² - 4·det at least 0 (a stable node, degenerate node or star). The value scored is that discriminant.
- Just over the top (intermediate). One pendulum path from x = 0 with damping 0.25 and a run time of 10: choose its starting speed so it passes over the top at a speed of 0.5 or less. Met when it crosses the top and the speed at the top is at most 0.5. The value scored is the speed at the top.
- Trapped in the left well (intermediate). One double-well path with damping 0.25 and a run time of 20: start on the right half of the plane and make the path end trapped in the left well. Met when the start has x above 0, the path stays in range to its last row, and it ends with x below 0 and an energy below 0. The value scored is the energy at the end.
- Critical damping (intermediate). A pendulum with four starts and a run time of 10: find the smallest damping at which it stops swinging back and forth around the bottom. Met when the bottom rest point is a stable degenerate node, the border between a spiral and a node. The value scored is the damping.
Challenge 1 holds back the answer until you predict: while your prediction reads Not yet chosen, the type, the step ratio, the longest stable duration and the two error measures are blank, the rest-point table keeps only the positions, the path summary keeps only the start points, and every frame after the first is blank. The direction arrows stay, because they are what you reason from. Any prediction reveals everything, and MET needs the right one. While challenge 2 is not met, the type and the eigenvalues and eigenvectors are blank; the trace, the determinant and every path stay, since the map point is what you steer by. While challenges 3 and 4 are not met, the separatrices are blank (in challenge 4 the fates too), because they mark the answer's boundary. While challenge 5 is not met, the type and every rest-point column after the position are blank; the paths stay.
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, but only for the inputs the chosen system reads and the selected challenge leaves to you. The two CHECK items read the values in effect after a challenge has fixed its own. A challenge number that is not a whole number from 0 to 5 counts as no challenge selected and reads the challenge NOT VALID message; your prediction is checked only in challenge 1. A path that leaves the plane is not a warning: it is how an unstable system behaves.
Assumptions and limitations
- Five fixed systems with one parameter at most; no typed equations. One plane, x and y from -4 to 4, for every system.
- 200 fixed Runge-Kutta steps a path, drawn at every second step; a path that passes 400 in |x| or |y| stops there.
- The separatrices are traced for one saddle only and are approximate near their seed. Near a separatrix a very small move of a start can change where the path ends.
- The step ratio warns above 2.5. Van der Pol with a strength above about 1.5 and a long run can pass it near the corners of the plane: the motion there is stiff, and a shorter run time clears it.
- The competing-species model has meaning only for populations of 0 or more.
- A path settles near a rest point when its end lies within 0.05 of it; a path that circles a loop or is still on its way reads Keeps moving.
- A value within about 1×10⁻⁹ (relative) of a threshold, such as the step-ratio limit, a crossing of the top, the 0.05 settle distance or a challenge band, may fall either side of it.
Restrictions and non-computing states
Under NOT VALID every result and every table is blank, except the challenge result (No challenge selected, or NOT MET when a challenge is selected), a score of 0, and the goal and not-met hint of a selected challenge.
A path that passes the 400 limit has its rows up to that point and blank rows after it; its fate is Runs away, and path 1's error estimate, period and amplitude need a complete run.
In challenges 1 to 5 the results listed under Challenges stay blank until the challenge allows them.
Errors and warnings
The status messages, first match wins:
- NOT VALID: choose a system from the list
- NOT VALID: each matrix entry must be from −3 to 3 in steps of 0.1 — linear system.
- NOT VALID: the pendulum damping must be from 0 to 3 in steps of 0.05 — damped pendulum.
- NOT VALID: the Van der Pol strength must be from 0 to 2 in steps of 0.1 — Van der Pol.
- NOT VALID: the double-well damping must be from 0 to 1 in steps of 0.05 — Duffing double well.
- NOT VALID: the duration must be a whole number from 1 to 20
- NOT VALID: the number of start points must be a whole number from 1 to 6
- NOT VALID: each start point must lie in the plane, with x and y from −4 to 4 — active start points only.
- NOT VALID: the challenge number must be a whole number from 0 to 5, and the type prediction one of the listed choices — the prediction is checked only in challenge 1.
- CHECK: start point k has a negative population, which this model cannot interpret; drag it into the top-right quarter — competing species; k is the first active start with x or y below 0.
- CHECK: the time step is coarse for this motion (step ratio above 2.5), so the paths lose accuracy; shorten the duration
- OK
References
This laboratory is an educational model of the phase portraits of five two-variable systems on the square from -4 to 4: a linear system with a 2 by 2 matrix, the damped pendulum, the Van der Pol oscillator, the Duffing double well and a competing-species model. Each path is computed by the classical fourth-order Runge-Kutta method in 200 equal steps, and a second run with twice the step gives an estimate of the method error; the linear system is also compared with its exact solution. Rest points are listed in closed form, and the type of each (saddle, node, spiral, centre, degenerate or star) is decided from the trace, determinant and discriminant of its Jacobian, held as exact integers, with eigenvalues and eigenvectors from the 2 by 2 closed form. The separatrices of a saddle are integrated forwards and backwards from a small offset along each eigenvector, and a step ratio warns when the step is coarse for the fastest local rate of change.
Sources and further reading
- Classifying linear systems by trace and determinant, phase portraits, the competing-species model, the pendulum and the Van der Pol oscillator: S. H. Strogatz, Nonlinear Dynamics and Chaos, 3rd edition, Chapman and Hall, 2024, section 5.2, Classification of Linear Systems, sections 6.1, Phase Portraits, 6.4, Rabbits versus Sheep, and 6.7, Pendulum, and section 7.5, Relaxation Oscillations. Publisher's page
- The standard fourth-order Runge-Kutta rule: NIST Digital Library of Mathematical Functions, Release 1.2.8, 2026, section 3.7(v), Runge-Kutta Method. NIST DLMF
- Runge-Kutta methods in depth: J. C. Butcher, Numerical Methods for Ordinary Differential Equations, 3rd edition, Wiley, 2016, chapter 3, Runge-Kutta Methods. doi:10.1002/9781119121534
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; its paths are numerical approximations with a fixed step, and it is not meant for analysing real mechanical, electrical or biological systems.
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.