Phase Portrait Sketcher

A browser tool for sketching qualitative phase portraits of planar flows, the kind drawn in a dynamical systems course. You draw trajectories, equilibria, periodic orbits and inflow/outflow boundaries by hand, as Bézier curves. The tool keeps the picture topologically consistent: trajectories must not cross, attachments must respect the direction of the flow, and so on.

Drawing tools

| Tool | Key | What it does | |---|---|---| | Select / edit | V | Click or drag a rectangle to select; Shift adds to the selection. Drag to move. Corner handles scale uniformly (Shift: free, Alt: about the centre), edge handles stretch one direction, the round handle on top rotates (Shift: 15° steps). | | Pan | H | Drag to pan. Space+drag or the middle mouse button also pans. | | Trajectory (freehand) | T | Draw in the direction of the flow. The stroke is smoothed and converted to cubic Béziers. Ends snap to targets (see Magnet). If an end only fits the other way round, the trajectory is reversed automatically. | | Bézier pen | P | Click for corner points; click-drag to pull out smooth handles. Enter or double-click finishes, Esc cancels. | | Sink | 1 | Filled disc. Can be shown as a focus (cw/ccw spiral). | | Source | 2 | Open disc. Can be shown as a focus. | | Saddle | 3 | Has 4 terminals: two unstable separatrices (pointing out) and two stable ones (pointing in). Drag the diamond handles to rotate it or to change the angle between its eigendirections. | | Saddle-node | 4 | Codimension 1, only when Structurally stable is off. Transversally stable or unstable. Half-filled disc on the node side, with three separatrix terminals plus the node sector. | | Periodic orbit | C | Click for an ellipse, or draw a closed loop. Stable = solid, unstable = dashed. Semi-stable (codim 1) = solid with a dashed shadow on the repelling side. Arrows show the orientation. | | Boundary | B | A transversal the flow crosses in one direction only, shown by small crossing arrows. A closed loop is created as an inflow boundary (trapping region); flip it in the panel. | | Label | L | Click to place text. Inside $…$: _ gives a subscript, ^ a superscript, and \alpha, \Gamma, … give Greek letters. TikZ receives the text verbatim. |

Editing

Magnet (snapping)

A trajectory end within about 14 screen pixels of one of these targets snaps to it:

The ring is green for a valid target and red for an invalid one; the status bar says why.

Consistency checks

The Consistency panel lists:

Refuse crossings (off by default): when on, an edit that introduces a new problem is undone, the offending spot flashes red and the status bar gives the reason. When off, problems are only flagged.

Structurally stable (on by default):

Files and export

Files in this folder