fhat. Workspace

Family-trained explicit Runge–Kutta

Recent

More accurate fixed steps for a family of differential equations.

errordepends on usecostdepends on useexplicit

Guo et al. 2022Also known as RK-NN, learned Runge–Kutta

Full skillv0.1.0

Use with your agent

Use the fhat method "learned-rk" (https://fhat.dev/methods/learned-rk/SKILL.md) for this problem. Check first whether it applies.

1. What this solves

If you solve many related differential equations, you can pay once to tune an integrator and reuse it on each new solve. The aim is to reduce error at your fixed step size while keeping the same number of evaluations per step as an ordinary integrator.

For initial-value problems y′=f(y)y'=f(y), Guo et al. fit the entries of one explicit Runge–Kutta (RK) tableau across a distribution of tasks (f,y0)(f,y_0) and step sizes. Their training architecture is called RK-NN. Deployment uses the fitted tableau and evaluates the given ff of each new task.

Earlier work optimized classical RK coefficients or learned them with neural networks. This skill covers the variant Guo et al. developed for a distribution of ODE tasks, with a Taylor-derivative penalty whose targets can be computed from the RHS without trajectory labels. See the paper's §5 and the sources below.

2. When to use

  • You can sample the smooth, non-stiff right-hand sides and initial states you will actually solve. For example, one model with a distribution of rate constants and initial loads can define a family. Sharing a state dimension or a field of application is insufficient evidence for transfer.
  • You know the fixed deployment step size or range, can supply accurate one-step targets or Taylor derivatives, and can test held-out equations and complete trajectories. Cover the states visited during the rollout, especially if trajectories move far from their starts.
  • The volume of reuse justifies reference solves, differentiation, fitting and validation. Compare with a classical solver at the same stage count and step size. If both meet the tolerance, compare total cost to meet it, including training. A learned method with the same number of stages has the same number of RHS calls per step.
  • The authors measured per-epoch work growing between O(d)O(d) and O(d2)O(d^2) on their two examples. They reported 187–201 epochs for the linear family and 1,506–2,336 for the nonlinear family across the tested dimensions. Use these as examples of training cost. Time your own RHS, target generation and differentiation. See Remark 1 and SM5, Fig. 16 and Table 2.

3. When not to use (and what to use instead)

Situation Use instead
One-off solve, unrelated ODEs, or no reliable reference data rk4 on a trusted fixed grid, or explicit-midpoint when limited to two stages.
Changed equations, parameters, initial states or step sizes without validation Use a classical solver until the new regime has been checked, or retrain on a representative family. A fitted tableau can give higher error than a classical tableau of the same order and stage count. See §§4.1, 4.2 and 4.4 (Figs. 2, 3 and 6–8) and SM2–SM3.
Stiff dynamics at the required step Use backward-euler for strongly decaying modes when first-order accuracy suffices, or an implicit stiff solver such as Radau IIA or BDF. A finite-stage explicit tableau has a polynomial stability function and conditional stability.
The solver must choose steps from an error tolerance, locate events or supply dense output dormand-prince-rk45 for non-stiff ODEs.
A general order guarantee or long-term preservation of Hamiltonian structure is required Use a classical tableau of proven order, or stormer-verlet or implicit-midpoint for suitable Hamiltonian problems.

4. Algorithm

Equation and figure numbers here refer to arXiv v3.

  1. Choose the training distribution. Sample a right-hand side ff, a starting state yy, and a positive step hh from the intended regime. For one deployment step, use that value for the finite-step term. Keep tasks for validation and final testing separate from fitting.

  2. Build one shared explicit tableau. Use ss stages and a strictly lower-triangular matrix A=(aij)A=(a_{ij}). Train its entries and unconstrained output logits ziz_i. With m=max⁡jzjm=\max_j z_j, set

    bi=exp⁡(zi−m)∑jexp⁡(zj−m).b_i=\frac{\exp(z_i-m)}{\sum_j\exp(z_j-m)}.

    For each sample evaluate the stages in order and take the weighted step.

    Ki=f(y+h∑j<iaijKj),Φh(y)=y+h∑i=1sbiKi.K_i=f\left(y+h\sum_{j<i}a_{ij}K_j\right),\qquad \Phi_h(y)=y+h\sum_{i=1}^s b_iK_i.

    This is Eq. (11) and §3.1. Here KiK_i is an unscaled derivative. The paper also writes increments ki=hKik_i=hK_i. Use one convention throughout. The softmax gives positive weights and ∑ibi=1\sum_i b_i=1, making the method consistent (Proposition 3.1). For smooth problems this guarantees at least first-order classical convergence under the usual finite-time stability assumptions. Stage entries can be negative. The softmax permits weights near zero but excludes exact zero and negative weights.

  3. Form a batch objective. Let YhY_h be the exact or accurate reference one-step state and BhB_h the one-step state of a classical RK baseline from the same yy. Section 3.2 uses an RK method of the target order for this scaling, for example RK3 when p=3p=3. Implement Eqs. (13)–(16) and Algorithm 1 with a Euclidean norm in both terms. Write e(h)=Yh−Φh(y)e(h)=Y_h-\Phi_h(y) for the one-step error and e(k)(0)e^{(k)}(0) for its kkth derivative in hh at h=0h=0.

    Lh=∥e(h)∥22∥Yh−Bh∥22,R=∑k=1p∥e(k)(0)∥22.L_h=\frac{\|e(h)\|_2^2}{\|Y_h-B_h\|_2^2},\qquad R=\sum_{k=1}^p\|e^{(k)}(0)\|_2^2.

    The reference follows the scaled loss in Eq. (14), interpreting its unspecified norm as Euclidean. Figure 9a discusses an unscaled MSE diagnostic. The authors' research code uses coordinatewise scaling and also normalizes the Taylor residuals. The reference exposes optional weights as an implementation choice. Minimize the sample mean of wLLh+wRRw_LL_h+w_RR, defaulting to wL=wR=1w_L=w_R=1, and skip any term with zero weight. Compute a ratio per task before averaging. Check that the baseline error is resolved above reference-target uncertainty and floating-point resolution.

    Obtain exact flow derivatives recursively by D1=fD_1=f, Dk+1(y)=JDk(y)f(y)D_{k+1}(y)=J_{D_k}(y)f(y), where JDkJ_{D_k} is the Jacobian. You can equivalently expand the flow as a power series. Set its constant term to the starting state and solve for each next coefficient from the ODE.

    [hk+1]Y(h)=[hk]f(Y(h))k+1.[h^{k+1}]Y(h)=\frac{[h^k]f(Y(h))}{k+1}.

    Evaluate the same RK stages with hh as a truncated series, then multiply each order-kk coefficient of both series by k!k! to get the derivatives used in RR. The paper also allows a sufficiently accurate Taylor surrogate for the finite-step target (Eq. (15)).

  4. Fit and freeze. The paper uses Adam. Algorithm 1 stops when the mean scaled one-step error γ\gamma falls below ϵ\epsilon or the iteration budget runs out. Monitor order residuals and held-out rollouts before choosing a checkpoint. Export A,bA,b, and run the ordinary explicit RK step at the fixed deployment hh. Use the same tableau across all tasks and steps.

Order at steps smaller than the training range. An explicit method with ss stages reaches classical order ss for s≤4s\le4, order 4 with five stages and order 5 with six. A higher pp is reachable only through special structure of the family, as in the two-stage square example below. Neither term of the paper's loss holds any order exactly. The finite-step term rewards accuracy at the training steps, not at smaller ones. When pp is out of reach, the unweighted Eq. (16) penalty lets the optimizer give up the lower orders to shrink the largest, top-order residual. The fitted tableau then matches the derivative orders only approximately, so its error stops falling like hph^p at small steps. With the finite-step term this happens even when pp is reachable. verify/check_order_target.py shows it on a pendulum family with three stages. Errors are on new tasks from the same family, relative to RK3.

Setting h=0.05, 0.025h=0.05,\ 0.025 (training range) h=5×10−4h=5\times10^{-4}
Taylor term only (wL=0w_L=0), p=4p=4, as in Eq. (16) 11–126 times worse over 10510^5 times worse, first order
Paper's full objective, p=4p=4, h∈(0.01,0.1)h\in(0.01,0.1), RK4 scaling baseline 0.75–0.94 about 400–600 times worse, first order
Paper's full objective, reachable p=3p=3, RK3 scaling baseline 0.44–0.92 530–801 times worse, first order
Any of these with keep_order=3 0.25–1.00 0.34–1.00, third order

With keep_order=3 the error is never more than 0.2% above RK3's at any tested step. The unconstrained full-objective fits in the table stop at the iteration cap or when no step helps, and the reference says so.

The reference train(..., keep_order=q) is an addition to the paper's method. It holds the classical order conditions up to order qq (at most 4) exactly, to rounding, throughout the fit, and optimizes the loss along the set of tableaus that keep order qq on every ODE. Use it whenever you need the order at steps smaller than those trained on. It is preferable to large order_weights, which hold the conditions only approximately and lose the order at small enough steps. Its limits:

  • Results depend on the starting tableau. Start from several classical tableaus with the stage count, such as RK3, Ralston's third-order method or RK4, and keep the best held-out result. The logits for given weights are zi=log⁡biz_i=\log b_i.
  • With the paper's scaled loss, the loss can be far more sensitive across the constraint set than along it, beyond what the finite-difference Jacobian resolves. The fit then stops early and says it did not converge, as for some fits in verify/check_order_target.py. Its tableau still keeps order qq and is usable, but other starts may do better.
  • Keep the states at ordinary magnitudes by nondimensionalizing them. Eq. (16) mixes derivatives of different orders, so the fitted tableau depends on the units.

After training, the reference warns heuristically when the fitted tableau matches a derivative order up to min⁡(p,reachable order)\min(p,\text{reachable order}) only approximately on the training tasks. This means a relative derivative error above 10−810^{-8}. It checks up to the reachable order when the Taylor term is off. It also warns when the fit did not converge. order_residuals reports the residual of each order relative to the size of the derivative. These warnings do not replace measurements. In every case, compare held-out rollouts with a classical tableau of the same stage count, including steps smaller than the training range. Keep the classical tableau unless the fitted one is better.

Order and the two-stage reproduction. Softmax imposes the first-order condition. The penalty encourages local derivative matching on the sampled family. Exact matching through derivative pp across the relevant states yields local error O(hp+1)O(h^{p+1}) and, on stable finite-time rollouts, global error O(hp)O(h^p). Small residuals can still cause lower-order terms to dominate at small hh. Generic order two requires bTc=1/2b^T c=1/2 with c=A1c=A\mathbf1. Generic order three also requires ∑ibici2=1/3\sum_i b_i c_i^2=1/3 and bTAc=1/6b^T A c=1/6.

For f(y)=−ay2f(y)=-a y^2, a>0a>0, the paper samples aa uniformly in (0.1,0.5)(0.1,0.5) and y0y_0 uniformly in (1,3)(1,3) (Eq. (18)). Section 4.3 obtains special conditions 2a21b2=12a_{21}b_2=1 and a212b2=1a_{21}^2 b_2=1, along with b1+b2=1b_1+b_2=1 (Eq. (23)). They give a21=2a_{21}=2, b=(3/4,1/4)b=(3/4,1/4) (Eq. (24)). This tableau is third order on that family and second order on general smooth ODEs. Heun is the same-stage comparison in Fig. 4, with a21=1a_{21}=1, b=(1/2,1/2)b=(1/2,1/2) (Eq. (25)). The square example only activates the Taylor penalty, so it needs neither finite-step targets nor a scaling baseline.

Eq. (11) also implies that every three-stage explicit tableau with exact scalar linear order three has the same amplification polynomial as RK3. Its cubic coefficient is 1/61/6. From the rounded linear-family weights in Table 1, the fitted cubic coefficient is about 0.16570.1657. This calculation is consistent with the change in slope at small steps in Fig. 2a. Check both the polynomial coefficients and observed convergence slope.

5. Parameters

Parameter How to choose it
Stage count ss Set the RHS evaluation budget per step. Compare against a classical method with the same budget.
Step size hh Train and validate at the intended step size or over the intended range. Include endpoints and a smaller-step sweep.
Order target pp and loss weights Set pp from the desired accuracy and test if the family and stage count can achieve it. Whenever you need the order at steps smaller than those trained on, use keep_order with that order: with the finite-step term always, and with the Taylor term alone when pp exceeds the order the stages reach in general. Check order_residuals and the slope at small steps after training. The illustrative square fit uses p=3p=3 and the Taylor penalty alone.
Training states and targets Use states and rates with the deployment scales, including trajectory regions that are hard to integrate. Check target accuracy and the resolution of the baseline error.

6. Applying it to your own code

Train against several tasks and use the resulting coefficients as constants. Store the stage rows in evaluation order and keep the start state unchanged while forming all stages. The compact representation has row lengths 0,1,…,s−10,1,\ldots,s-1. In a nonautonomous problem, augment the state with t′=1t'=1 (§2.1) so that stage times are t+ciht+c_i h. Include the time distribution in training and validation.

Differentiate through the stage evaluations during training. The reference train accepts a batch of rhs and state pairs. For an active finite-step term, each task also supplies h, target and baseline. It takes compact initial rows and output logits, computes both derivative sets, and returns (A, b, loss). It uses damped Gauss–Newton with finite differences in coefficient parameter space. Without max_iters it iterates until the gradient (along the constraint set under keep_order) is small relative to the loss, up to MAX_ITERS (2000), and warns if it stops before that. max_iters sets another cap, and 0 only evaluates the starting tableau. The keyword keep_order holds classical order conditions exactly by constrained Gauss–Newton steps, and order_weights scales each derivative order's residual. A RuntimeWarning reports derivative orders up to min⁡(p,reachable order)\min(p,\text{reachable order}) that the fitted tableau matches only approximately on the training tasks. The time-step derivatives come from series arithmetic at zero. For smooth Python RHSs the series supports arithmetic, division with a nonzero constant denominator, integer powers, and the supplied sin, cos and exp functions. Use equivalent differentiable primitives in your own numerical framework for other operations.

At inference only the RHS and the tableau are needed. Export at full precision and check consistency and order residuals after export.

When you write code using this method, add the comment learned-rk v0.1.0, Guo et al. 2022.

7. Verification

  1. Check your implementation. Keep checks/check_port.py beside checks/cases.json. In your working directory expose step, objective, rk_derivatives, flow_derivatives, train and order_conditions from port_adapter.py and run python /path/to/learned-rk/checks/check_port.py. Show the user the output. The JSON specifies the same interfaces for other languages. It tests the fixed step, loss, both derivative calculations, the classical order conditions, initial softmax, a small fit with both terms active and a keep_order=3 fit on Duffing oscillators. A port that fits without the constraint and projects at the end fails that case. Because the keep_order optimum is a flat valley, that case compares the loss and checks the conditions of your tableau, not its coefficients. The fit case leaves the iteration count to your optimizer and checks only the result: Gauss–Newton needs tens of iterations, Adam can need thousands. Validate coefficient and loss tolerances in double precision.
  2. Check your problem. Compare held-out rollout errors at the same hh and stage count, including difficult tasks and the tails of the distribution. Step halve at a common physical end time and inspect the trajectory errors and observed order. For linear decay y′=λyy'=\lambda y, check that the amplification factor satisfies ∣1+zbT(I−zA)−11∣≤1|1+z b^T(I-zA)^{-1}\mathbf 1|\leq1 over the relevant z=hλz=h\lambda. Validate representative nonlinear rollouts as well. Use a classical baseline when the fitted tableau misses the required error or stability target.

8. Failure signatures

Symptom Likely cause
Constant RHS drifts at the wrong rate Output weights do not sum to one, or hh was applied incorrectly.
Loss explodes or becomes nonfinite for tiny steps The baseline error is zero or indistinguishable from roundoff.
Good finite-step fit and a lower slope under refinement The Taylor derivatives were mismatched or the penalty only made their residuals small on training samples.
Training lowered the loss, but the fitted tableau is worse than the classical one of the same stage count at small steps, and its slope dropped No order was held exactly. The finite-step term rewards only the training steps, and with an out-of-reach target the unweighted penalty trades the lower orders for the top one. The reference warns about it. Use keep_order.
The RHS raises TypeError: must be real number, not Series The RHS calls a function that does not accept the series used for the hh derivatives, such as math.sin. Use the series sin, cos and exp from reference/taylor_series.py, or your framework's differentiable functions.
Error or growth spikes on new tasks or larger steps The deployment family or stability regime differs from the validated range.
A transferred tableau gives more error at the same cost The cancellation that helped on the training family can increase the leading error on other RHSs. For y′=sin⁡yy'=\sin y, the square-family tableau gave about 3.54 times Heun's error at the same stage count.
One-step error looks good but trajectories drift Visited states or the rollout horizon are poorly represented in training and validation.

9. Files and commands

Run from this skill folder. All shipped scripts use the standard library.

File Use
reference/learned_rk.py Explicit step, batch objective and closed-form square-family comparison.
reference/train_rk.py, reference/taylor_series.py Training from raw tasks, derivatives at zero and series operations.
examples/fit_square.py uv run --offline examples/fit_square.py uses the general trainer to fit the Taylor penalty and compares two new tasks with Heun. Expected output is in examples/fit_square.expected.txt.
checks/cases.json, checks/check_port.py Fixed cases and property checks for your port. Run the checker from your adapter's directory as above.
checks/make_cases.py uv run --offline checks/make_cases.py prints the fixtures generated from the reference.
verify/check_cases.py uv run --offline verify/check_cases.py checks fixture freshness, an independent optimum and deliberate porting errors.
verify/check_paper.py uv run --offline verify/check_paper.py checks the closed-form tableau from Eqs. (23)–(24) and the order shown in Fig. 4 on new tasks. It also checks transfer to linear decay and a nonlinear sine RHS.
verify/check_order_target.py uv run --offline verify/check_order_target.py shows, on a pendulum family, the Taylor term only with p=4p=4 and the paper's full objective with p=4p=4 and with the reachable p=3p=3. The fits without keep_order warn and lose order at small steps. With keep_order=3, each fit keeps third order and stays within 0.2% of RK3's error or below at every tested step, from RK3 or from a random start. A four-stage keep_order=4 fit from RK4 moves away from RK4 and lowers the loss.

The square-family scripts check the reported tableau and its accuracy. The example uses the reference optimizer, and the paper used Adam. In the authors' research code listed in meta.yaml, the checkpoint at results/Nonlinear/rk2_taylor3.h5 stores a stage kernel and two output logits. Reading the kernel and applying softmax to the logits gave the Eq. (24) tableau within 1.4×10−151.4\times10^{-15} per coefficient.

10. Sources

  • Y. Guo, F. Dietrich, T. Bertalan, D. T. Doncevic, M. Dahmen, I. G. Kevrekidis and Q. Li. Personalized Algorithm Generation: A Case Study in Learning ODE Integrators. SIAM Journal on Scientific Computing 44(4), A1911–A1933 (2022). Published article
  • The open manuscript supplies the equation, section and figure numbering used here. arXiv:2105.01303v3
  • Earlier neural approaches fitted RK coefficients for targeted IVPs. Tsitouras 2002, Anastassi 2014, Dehghanpour et al. 2015
  • Earlier classical RK design includes Fehlberg and Dormand–Prince. Optimal deterministic algorithm generation addresses the broader problem of optimizing a parameterized algorithm. Fehlberg 1964, Dormand & Prince 1980, Mitsos et al. 2018
@article{guo2022personalized,
  author = {Guo, Yue and Dietrich, Felix and Bertalan, Tom and Doncevic, Danimir T. and Dahmen, Manuel and Kevrekidis, Ioannis G. and Li, Qianxiao},
  title = {Personalized Algorithm Generation: A Case Study in Learning {ODE} Integrators},
  journal = {SIAM Journal on Scientific Computing},
  year = {2022},
  volume = {44},
  number = {4},
  pages = {A1911--A1933},
  doi = {10.1137/21M1418629},
}

Evidence

Output of the verification scripts, run on the reference implementation of version 0.1.0 when this page was built.

Passed verify/check_cases.py: Verifies fixed step, loss, derivative, order-condition and training cases (including keep_order), checks the fitted tableau against an independent optimum and the order conditions against the checker's rooted-tree sums, accepts an independent first-order port that sets its own iteration count, and detects thirteen deliberate porting errors, including fitting without keep_order and projecting at the end.
PASS stored fixtures match make_cases.py
PASS two-stage square tableau
PASS three-stage coupled affine ODE
PASS three-stage nonlinear ODE
PASS weighted per-sample loss and Taylor penalty
PASS Taylor-only loss with exact baseline
PASS RK step derivatives at zero for a coupled ODE
PASS exact flow derivatives at zero for a coupled ODE
PASS four exact flow derivatives of linear decay
PASS stable softmax on initial logits
PASS fit one tableau to several decay tasks using both terms
PASS classical order conditions up to order 3 for a three-stage tableau
PASS classical order conditions up to order 4 for a four-stage tableau
PASS keep third order exactly while fitting a fourth-order target on Duffing oscillators
PASS consistent constant-RHS step with two stages
PASS third-order convergence on the square family
15 passed, 0 failed
PASS weighted objective matches hand calculation
PASS fitted tableau and loss match an independent least-squares optimum
PASS a first-order (Adam) port with its own iteration count passes every port check
PASS order conditions agree with the checker's rooted-tree sums on 200 random tableaus
PASS coupled flow derivatives match direct chain-rule arithmetic
PASS flow through series sine, cosine, exponential and division
PASS caught only the immediately previous stage (2 fixed cases)
PASS caught multiply final weights by h twice (3 fixed cases)
PASS caught reverse output weights (3 fixed cases)
PASS caught pool baseline errors before dividing (1 fixed cases)
PASS caught compare Taylor coefficients instead of derivatives (2 fixed cases)
PASS caught forget the factorial in the RK derivatives (1 fixed cases)
PASS caught shift the exact flow derivative indices (2 fixed cases)
PASS caught skip softmax on logits (3 fixed cases)
PASS caught skip the order term during training (3 fixed cases)
PASS caught skip the finite-step term during training (2 fixed cases)
PASS caught use 1/3 instead of 1/6 for the b.Ac condition (2 fixed cases)
PASS caught ignore keep_order during training (1 fixed cases)
PASS caught fit without keep_order, then project onto the conditions (1 fixed cases)
Passed verify/check_paper.py: Checks the Eq. (23)–(24) closed-form square tableau and the order shown in Fig. 4 on new tasks. It compares Heun on the square family and demonstrates worse error after a nonlinear family shift.
PASS Eq. (24): a21=2.000000000000, b=(0.750000000000, 0.250000000000) (max difference 0.00e+00)
h=0.0800 learned E=1.175478e-04 Heun E=8.123064e-04
h=0.0400 learned E=1.349975e-05 Heun E=1.972697e-04
h=0.0200 learned E=1.616959e-06 Heun E=4.857114e-05
h=0.0100 learned E=1.978444e-07 Heun E=1.204825e-05
h=0.0050 learned E=2.446677e-08 Heun E=3.000155e-06
h=0.0025 learned E=3.041982e-09 Heun E=7.485473e-07
PASS Fig. 4: learned slope 3.0077, Heun slope 2.0029
PASS shift to linear decay: slope 2.0140, same errors as Heun within 1e-12
PASS nonlinear shift y'=sin(y): learned/Heun error ratios 3.539, 3.538, 3.537, 3.537
Passed verify/check_order_target.py: Pendulum family, three stages, errors against RK3 on new tasks from h=0.05 down to 5e-4. Without keep_order, the Taylor-only fit with target 4 and the paper's full objective with target 4 or the reachable target 3 all warn and drop to first order at small steps; the full objective is better than RK3 only at the training steps. With keep_order=3 each keeps third order to rounding and stays within 0.2% of RK3's error or below at every tested step, from RK3 or a random start. A four-stage keep_order=4 fit from RK4 moves away from RK4 and lowers the loss. Fits that stop early say so.
PASS Taylor term only, target 4, from RK3: warns; 10.70-126.46 of RK3's error at h=0.05, 0.025, 172731-264545 times RK3's at h=5e-4, slope 0.99-1.00; converged
PASS Taylor term only from a random start also warns
PASS full objective, target 4, RK4 baseline, from RK3: warns; 0.75-0.94 of RK3's error at h=0.05, 0.025, 393-603 times RK3's at h=5e-4, slope 0.98-0.99; stopped at the iteration cap and warned
PASS full objective, reachable target 3, RK3 baseline, from RK3: warns; 0.44-0.92 of RK3's error at h=0.05, 0.025, 530-801 times RK3's at h=5e-4, slope 0.99-1.00; stopped at the iteration cap and warned
PASS Taylor term only, target 4, keep_order=3: no lost-order warning, third-order conditions to rounding, slope 2.99-3.01 at small steps, 0.25-0.96 of RK3's error at h=0.05, 0.025 and 0.35-0.95 at h=1e-3, 5e-4; converged
PASS Taylor term only, target 4, keep_order=3 (random start): no lost-order warning, third-order conditions to rounding, slope 2.99-3.01 at small steps, 0.25-0.96 of RK3's error at h=0.05, 0.025 and 0.35-0.95 at h=1e-3, 5e-4; converged
PASS full objective, target 4, keep_order=3: no lost-order warning, third-order conditions to rounding, slope 3.00-3.00 at small steps, 0.53-0.99 of RK3's error at h=0.05, 0.025 and 0.53-0.99 at h=1e-3, 5e-4; stopped early and said so
PASS full objective, target 4, keep_order=3 (random start): no lost-order warning, third-order conditions to rounding, slope 3.00-3.00 at small steps, 0.51-0.98 of RK3's error at h=0.05, 0.025 and 0.51-0.98 at h=1e-3, 5e-4; stopped early and said so
PASS full objective, target 3, keep_order=3: no lost-order warning, third-order conditions to rounding, slope 2.99-3.00 at small steps, 0.38-0.97 of RK3's error at h=0.05, 0.025 and 0.37-0.97 at h=1e-3, 5e-4; stopped early and said so
PASS full objective, target 3, keep_order=3 (random start): no lost-order warning, third-order conditions to rounding, slope 2.99-3.00 at small steps, 0.35-0.97 of RK3's error at h=0.05, 0.025 and 0.34-0.97 at h=1e-3, 5e-4; stopped early and said so
PASS four stages, keep_order=4, full objective from RK4: fourth-order conditions to rounding, moved 1.19 from RK4, loss 0.712 against 1.491 at RK4; stopped early and said so

More methods are coming.