Phase portraits and curvature
The pictures for differential equations and differential geometry (roadmap 13.1 and 13.2): phase portraits with proved equilibria, solutions in time, the moving frame of a curve, and surfaces coloured by curvature.
Phase portraits
For a planar system , , phasePortrait([f, g], { x, y, orbits }) draws:
- arrows of the direction field, all one length so only the direction shows;
- the nullclines (where motion is vertical) and (horizontal), traced by marching squares;
- orbits through the given points, followed forward and backward by Runge–Kutta in floats;
- every equilibrium in the window, found and proved unique in a small box by analytic's
planarSystem(...).equilibria, and labelled by its kind from the certified trace and determinant of the Jacobian: saddle when ; a node or spiral, stable or not, by the sign of and of .
The arrows and orbits are estimated; the equilibria are proved, and fig.equilibria has their boxes. When the search covers the whole window, complete says there are no others.
Solutions in time
solutionFrames(u, times) draws at each time on one window: the heat equation's modes decaying, a wave travelling. Play them with framesSVG.
The moving frame
For a plane curve , the unit tangent is , the normal is turned a quarter turn, and the curvature is . The osculating circle has radius and centre . frameAlongCurve(r, t) gets all of these certified from analytic's curve(...).at(t) and draws them; frameFrames moves the frame along the curve.
Curvature on a surface
curvatureSurface([x, y, z], { u, v }) colours each cell of a parametric surface by its Gaussian curvature , or by the mean curvature: red where it is positive (the surface bends the same way in every direction, like a sphere), blue where it is negative (a saddle), white near zero. On a torus the outside is red and the inside blue, and Gauss–Bonnet says the two cancel: . curveOnSurface lifts a path in to the surface, for a geodesic or the path of a transported vector.
@ratmath/graphics and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math, and SHOW(svg) draws a picture.