How far can you trust Konjugate's answers? Benchmarks, safeguards and limits

Konjugate passes all 584 of its accuracy checks, and 226 of them are on problems that come from outside the project: examples and reference results published by the Modelica Association, the FMI Reference FMUs, a stiff problem from a published test set and classic equations from the numerical analysis literature. Every check runs on every release, on macOS and Linux, and a failing check fails the release. The reports are published at web.konjugate.com/benchmarks, and everything in them can be reproduced from a clone of our repository.
Below: what the checks compare against, how fast Konjugate is at matched accuracy against SciPy and Julia, where the evidence stops and how to check your own model.
Used exactly as published
These 96 checks are on problems where both the problem and the answer we compare with were published by someone else.
| Problem | Result | Details |
|---|---|---|
| Four FMI Reference FMUs, release v0.0.42: Dahlquist, VanDerPol, BouncingBall and Stair | Identical to FMPy | The FMUs are imported unchanged. The difference from FMPy's simulation of the same FMUs is 0.0 for all four. Dahlquist and Stair are also checked against their closed form. |
| Robertson's stiff kinetics, problem ROBER in the Bari Test Set for IVP Solvers | Matches the published values | Our reference, SciPy's Radau at 1e-12, agrees with the test set's published values at 1e11 s to 6.5e-13. Konjugate's Rodas4 stays within 4.8e-7 of it at every checkpoint from 0.4 s to 1e11 s, and keeps the total concentration at 1 to 3.6e-15. |
Four Modelica Standard Library 4.1.0 examples: TwoMasses, CauerLowPassAnalog, a rotational First and a translational Oscillator |
Agrees with the published results to their own accuracy | Compared with the Modelica Association's reference results (made with Dymola at a tolerance of 1e-6) and with each example's exact solution. On TwoMasses, Runge–Kutta 4 is within 2.1e-13 of the exact solution and 1.9e-5 of the published result, which is itself 1.87e-5 from exact. On the Cauer filter the figures are 1.0e-10 and 2.6e-5. |
What is theirs and what is ours: the FMUs and the Modelica reference results are used as files, unchanged (the reference results come from a branch of their repository, so we record each file's checksum). Robertson's equations, constants, starting values and end time are the test set's; the problem goes back to a 1966 chapter by H. H. Robertson, and Hairer and Wanner named it ROBER in Solving Ordinary Differential Equations II. The Modelica examples are rebuilt as Konjugate graphs from the library's equations, and two of them needed reducing by hand first (see Limits).
Classic equations from the literature
These 130 checks are on well-known equations. The equations are theirs. The parameter values, starting points, time spans and the references we compare with are ours (for Lorenz we use the classic σ = 10, ρ = 28, β = 8/3).
| Problem | Result | Details |
|---|---|---|
| Van der Pol oscillator, μ = 1, 10 and 1000 (van der Pol, 1926) | Matches a high-accuracy reference | Reference: SciPy's Radau with the exact Jacobian at 1e-12, cross-checked against DOP853 for μ = 1 and 10. At μ = 1 the limit-cycle period is off by 1.3e-8 under Runge–Kutta 4 and 4.2e-9 under Adaptive. |
| Lorenz system (Lorenz, 1963) | Follows the true trajectory for as long as each method's accuracy allows, and the attractor's statistics agree | Reference: a Taylor series method in 70-digit arithmetic. At the benchmark's step, Runge–Kutta 4 stays within 1% of it for 18.5 s; the best double-precision reference, DOP853 at 1e-12, loses it at 33.6 s. The attractor's statistics and its largest Lyapunov exponent are checked against 200 reference runs, whose exponent agrees with the literature value of 0.9056 from Viswanath's 1998 PhD thesis. |
| Prothero–Robinson equation (Prothero and Robinson, 1974) | Shows the order theory predicts, including the expected loss | Exact solution: sin t. Rodas4's observed order is 4.05 on the non-stiff case, where theory says 4, and about 1.2 on the stiff cases: the order reduction the problem was designed to expose. |
| Lotka–Volterra (Volterra, 1926) | Keeps its conserved quantity with the right method | Reference: SciPy's DOP853 at 1e-12 and the analytic conserved quantity. Over about 50 cycles at the benchmark's step, semi-implicit Euler keeps the conserved quantity's drift to 0.021 of the orbit's size, while explicit Euler lets it drift by up to 11.6 times that size. |
Our own problem files cite a source only for Robertson and Prothero–Robinson. For Van der Pol, Lorenz and Lotka–Volterra, the links above are to the original papers, as original statements of the equations.
Our own models, checked against independent tools
The other 358 checks are on models we wrote: a thermal RC network, RLC circuits, a harmonic oscillator, a pendulum and a double pendulum, a bouncing ball, coupled masses, a switched buck converter, a half-wave rectifier, a DC motor under PID control, a fluid network with a pump and a valve, a data-centre cooling model, counterflow and parallel-flow heat exchangers, generated graphs of up to about 100,000 nodes and synthetic datasets with known causal structure for the causal inference feature. Because we wrote them, they prove less than the problems above. What gives them value is what they are checked against: exact solutions by the matrix exponential (Higham's algorithm) and by Jacobi elliptic functions, SciPy's solve_ivp at 1e-12 to 1e-13, ngspice on the switching circuits, a model of the data centre written independently in Python and ε-NTU theory for the heat exchangers.
Our README's Where the problems come from lists every problem with the script that made its reference, the tool versions and the licences of third-party data, and each problem's folder under benchmarks begins with its equations.
What else is verified
- The engine implements its methods exactly. On the generated graphs, explicit Euler and Runge–Kutta 4 match each method's own exact steps to 1.7e-14. Whatever error remains belongs to the method, not the engine.
- Each method converges at its stated order. Order is measured over halvings of the step, not assumed. On the harmonic oscillator, the observed orders are 1.02 for explicit Euler, 2.00 for Verlet, 4.00 for Runge–Kutta 4 and 5.01 for Dormand–Prince. On the switched circuits, where the switches are located, Runge–Kutta 4 measures 3.96 to 4.12.
- Conservation holds to rounding. Every balance that is linear in the states is kept to about 1e-15: the thermal network's energy balance to 5.6e-15, Robertson's total to 3.6e-15 and a random network's total heat to 3.8e-17.
- The same answer every time, to the bit.
- Across backends: the serial and parallel backends give the same bits on every graph, size and method in the suite. The check also confirms that the parallel backends really ran in parallel.
- Across releases: every bundled example gives the same numbers, to the bit, as the engine of release 1.4.15, and projects saved by earlier releases open unchanged.
- Across exports: exported C++ gives the engine's error to every digit under Adaptive and Rodas4, and exported C++ and FMUs are tested against the engine on fixtures.
Speed at matched accuracy
The same equations, absolute tolerances and output samples are given to Konjugate's engine, Konjugate's exported C++, SciPy's solve_ivp and Julia's DifferentialEquations.jl, at relative tolerances from 1e-3 to 1e-10: 1,136 results over seven problems, eight tolerances, five interleaved rounds and every method each tool offers. Three problems are equations from the literature (marked †); the other four are our own. Tools reach different errors at the same tolerance, so the table compares them at the same achieved error: each cell is the fastest solve among a tool's runs whose error is at most 1e-6, with the method and tolerance that achieved it.
| Problem | Konjugate engine | Konjugate C++ export | SciPy | Julia |
|---|---|---|---|---|
| Robertson†, stiff | 1.04 ms Rodas4 (1e-6) | 3.98 ms Rodas4 (1e-6) | 74.5 ms Radau (1e-7) | 1.15 ms Rodas5P (1e-6) |
| Van der Pol†, μ = 1000, stiff | 2.84 ms Rodas5P (1e-8) | 4.28 ms Rodas5P (1e-8) * | 151 ms Radau (1e-7) | 1.35 ms Rodas5P (1e-8) |
| Thermal network, stiff | 0.49 ms Rodas4 (1e-5) | 3.36 ms Rodas5P (1e-7) * | 7.75 ms Radau (1e-7) | 0.22 ms Rodas5P (1e-5) |
| Lorenz†, adaptive | 0.88 ms Tsit5 (1e-8) | 3.37 ms Tsit5 (1e-8) * | 10.8 ms DOP853 (1e-7) | 0.56 ms Tsit5 (1e-7) |
| Thermal grid, 1,024 nodes, stiff | 23.1 ms Rodas5P (1e-3) | 27.0 ms Rodas5P (1e-3) | 106 ms Radau (1e-6) | 15.2 ms Rodas5P (1e-3) |
| Thermal grid, 1,024 nodes, adaptive | 60.2 ms Dormand–Prince (1e-6) | 20.9 ms Dormand–Prince (1e-6) | 14.6 ms RK45 (1e-7) | 6.40 ms DP5 (1e-6) |
| Thermal grid, 1,024 nodes, multistep | 49.4 ms BDF (1e-5) | 41.8 ms BDF (1e-5) | 16.6 ms LSODA (1e-9) | 24.4 ms QNDF (1e-7) |
| Buck converter, stiff | 27.7 ms Rodas4 (1e-5) | 8.10 ms Rodas4 (1e-6) | 1.47 s Radau (1e-7) | 37.1 ms Rodas4 (1e-7) |
† An equation from the literature. The rest are our own models.
* Noisy: the spread of the five runs is above 5% of their median. The C++ export is timed as a whole program run, including its start, which is why it trails the engine on the smallest problems.

What the table and the charts show:
- Where Konjugate's engine leads. Under the stiff methods it reaches an error of 1e-6 in less time than SciPy's Radau on all seven problems. Against Julia it is ahead on 3 of the 18 combinations of problem and method family in the full report where both reach 1e-6: Robertson under Stiff (1.04 ms against 1.15 ms), Lorenz under BDF (1.85 ms against 2.69 ms) and the buck converter under Stiff (27.7 ms against 37.1 ms).
- Where it trails. Julia is faster on the other 15 combinations. The widest gap is the 1,024-node grid under the adaptive methods, 60.2 ms against 6.40 ms. On that grid the engine is the slowest of the tools under the adaptive and multistep methods, because it evaluates every equation as an interpreted expression, node by node. The compiled C++ export, which runs the same methods, takes 20.9 ms on the same adaptive run.
- One problem only Konjugate's multistep runs solved to 1e-6. On Van der Pol at μ = 1000, Konjugate's BDF reaches an error of 1e-6, in the engine and the export, and no SciPy or Julia multistep method does at any tolerance run. Julia's FBDF at a tolerance of 1e-10 stopped with "Unstable", the only failed run of the 1,136, and it is kept as recorded.
- Switches change the comparison. Konjugate locates each switch of the buck converter from its equations. SciPy and Julia are given the switch written into the equations, which is what a user would normally do, and that is what the table shows. Given the exact switching instants instead, an easier problem, Julia's Rodas5P reaches 1e-6 in 1.53 ms.


How the engine scales. A separate study times generated thermal graphs from 100 to about 100,000 nodes. Serially, the engine integrates 13.6 million node steps per second on a 100-node chain and 3.6 million on a 100,000-node random network under explicit Euler, and 5.7 and 0.9 million under Runge–Kutta 4. The partitioned backend (4 partitions) is slower than serial on small graphs, with speed-ups of 0.22 to 0.33 at 100 nodes under Euler, and matches or beats it from 10,000 nodes, with 1.03 to 1.49. Under Runge–Kutta 4 it breaks even at best: 0.89 to 1.09 at about 100,000 nodes. At that size most of the time is not integration: the chain under Euler takes 6.1 s of wall time, 0.12 s of it integrating; the rest is reading the project and writing the result.
Limits
What these benchmarks do not show, in one place:
- Scope. Konjugate solves lumped-parameter models: graphs of components, volumes and flows. It does not discretise partial differential equations in space, so finite-element and CFD benchmarks are out of scope. It also does no acausal network solving or index reduction: the Cauer filter's capacitance matrix and a drive train's rigid gear were reduced by hand before the Modelica examples could be built.
- The problems suit the methods. They are smooth systems where a method's behaviour can be measured cleanly, plus stiff and switched cases run with the methods built for them. A problem nobody on this list has thought of could behave differently.
- One comparison is not independent. The stiff network, when it is heated in jumps, is compared with Konjugate's own Rodas4 at a tight tolerance.
- Some sources are not recorded. We found no recorded source for the ε-NTU relations' textbook, the published Van der Pol period at μ = 1, the 27 °C inlet temperature the data centre is judged against or the fluid network's friction factor and pump curve. We found no working link for Robertson's 1966 chapter or Viswanath's thesis.
- Thresholds are guards, not claims. A threshold is set to catch a change in the numbers. A passing check shows that nothing moved; the comparison with the reference shows how small the error is.
- Chaotic problems can only be judged so far. For Lorenz and the double pendulum, a trajectory is compared up to the predictability horizon each method reaches. Beyond it we check statistics and sensitivity, which is all that can honestly be checked of a chaotic system.
- Kinks are not located. A
Min,MaxorAbsof a quantity that changes sign is continuous but not smooth, and costs accuracy where it turns. The data centre's cooling units clamp their demand, which holds Runge–Kutta 4 to an observed order of 3.4 there instead of 4. - Explicit Euler has the usual pitfalls. It is Konjugate's quick default, and a stable run is not necessarily an accurate one. On the Cauer filter, explicit Euler at a step of 0.0025 s is off by 0.2% of the range, where Runge–Kutta 4 at a step four times longer is off by 1e-10. On a Modelica oscillator driven at resonance it is 9% off at 16,000 steps per second, against 0.3% for semi-implicit Euler. It lets Lotka–Volterra's conserved quantity drift, as above. And it changes a switch at the first step after the instant it should, so switched models converge only at first order under it.
- The model itself. No benchmark can tell that you meant a different equation or parameter. The checks below can catch modelling slips as well as numerical ones.
How to check your own model
The same ideas the benchmarks use, applied to your model, take a few minutes:
- Halve the step. If the results you care about change, the run has not converged.
- Run it with another method. Use Euler for a quick look, then Runge–Kutta 4, Adaptive or Stiff. If the answers agree to the accuracy you need, you can rely on them more. For a node that oscillates, use semi-implicit Euler; for switches, use a method that locates them.
- Look for a conserved quantity. If your model should conserve energy, mass or charge, check that it does. Konjugate keeps every linear balance to rounding, so drift points at the model or the method.
- Compare with a limit you know. A steady state, an analytic case or a published result is worth more than any benchmark.
- Export and cross-check. An exported FMU or program gives the engine's numbers, and you can run it in a tool you already trust.
Konjugate helps with these. Before a run, its stability analysis works out whether the step you chose is stable for the method you chose, names the state and parameter responsible if not and offers a fix, such as Use Stiff for a stiff model or semi-implicit Euler for an undamped oscillation. During and after a run it watches for growth and for the sawtooth of an unstable explicit run, and Check convergence re-runs a flagged node at doubled substep counts until the answers agree. An unknown method or an unsupported feature is refused by name, never replaced silently.
Reproduce it
Everything here can be reproduced from a clone, with nothing installed by hand and no administrator rights, on macOS or Linux. The accuracy checks also run on Windows.
git clone https://github.com/zenineasa/konjugate.git && cd konjugate
npm install
npm run setup # once: the engine's development dependencies
npm run benchmark:setup # the shipped engine and the pinned comparison tools
npm run benchmark:accuracy # every accuracy check, about forty seconds
npm run benchmark:performance # a timing session: several hours on an Apple M1
The accuracy run writes a self-contained report. Our benchmark README documents the problems, references, metrics and thresholds. If you find a result you cannot reproduce, or a problem we should add, please tell us on our issue tracker. We would especially like to hear about a case where Konjugate gives an answer you do not believe.
How we measured. All timings are from one computer, a MacBook Air with an Apple M1 chip and 8 GB of memory, on mains power with every other application quit, so compare tools on it, not machines. The engine timed is that of Konjugate 2.0.2, from a clean checkout. SciPy 1.18.1 (NumPy 2.5.5, Python 3.12.15) and Julia 1.13.4 with its OrdinaryDiffEq packages are pinned. Each timing is the minimum over repeated runs; the report also gives each median and spread. The comparison session ran with a recorded load average median of 1.82 during its timed runs, against 1.57 in the session before it, so Konjugate's shortest per-process timings are slightly pessimistic. Read differences of a few per cent as noise. The combined report has every problem's plots and numbers, and the data is there as CSV and JSON too, so you can check any figure in this post.
Follow Konjugate on LinkedIn for updates, or subscribe via RSS.
Comments
Post a Comment