matplotlib 3.5.1

_integrate_rk12(x0, y0, dmap, f, maxlength)

This method is also referred to as the improved Euler's method, or Heun's method. This method is favored over higher-order methods because:

  1. To get decent looking trajectories and to sample every mask cell on the trajectory we need a small timestep, so a lower order solver doesn't hurt us unless the data is very high resolution. In fact, for cases where the user inputs data smaller or of similar grid size to the mask grid, the higher order corrections are negligible because of the very fast linear interpolation used in interpgrid .

  2. For high resolution input data (i.e. beyond the mask resolution), we must reduce the timestep. Therefore, an adaptive timestep is more suited to the problem as this would be very hard to judge automatically otherwise.

This integrator is about 1.5 - 2x as fast as RK4 and RK45 solvers (using similar Python implementations) in most setups.

2nd-order Runge-Kutta algorithm with adaptive step size.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/streamplot.py#511
type: <class 'function'>
Commit: