Lemonergy Wiki

How-to guides

Collect independent comparison evidence

Collect repeatable results from Lemonergy and an independent implementation, check the same inputs and numerical gates, and retain evidence that another engineer can reproduce.

Document created Updated
Draft explanationSource record reviewed

Make an independent comparison reproducible

Use this guide when auditing a Lemonergy result against a separately executed implementation. Match inputs, units, initial states, event handling and full traces before comparing performance. For ordinary modeling, begin with your first simulation.

Collect the Lemonergy result

  1. Open prepared examples and select the case. Its complete prepared model loads automatically.
  2. Choose Run prepared model. Inspect every signal and numerical gate, using Display time and Scope to explore the result.
  3. Choose Download run evidence for the fresh graph and trace, and Download results CSV for the compared samples. Under Model, method and references, Download the model file provides the original model data; it does not save your fresh result into that original file.
  4. Record the machine, source version and initialization state. Retain failed runs too.
Lemonergy's RLC result table and plots accompanying a native run
RLC circuit: current and charge: fresh Rust/WebAssembly results captured on 2026-10-10. The numerical checks, Scope overlay and error plot come from this same successful run. Captured .

This picture shows Lemonergy. The retained reports currently contain no imported external execution evidence.

Agree on the comparison contract

ItemWhat must match
IdentityCase ID and reference version
InputsValues, signs, units and initial states
Time domainComplete window and required output/event instants
SolverMethod, tolerances and event/sampling scope
ObservablesEvery required signal
TimingDeclare initialization, encoding, checking and rendering scope
MachineUse the same device for a same-machine claim

The supplied independent scripts implement authored equations in base MATLAB. Its installation is needed only for the commands below; Lemonergy's models run without it. These scripts do not invoke Simulink or a commercial battery model.

Collect the six circuit and rod cases

Run from the repository root. Replace the example machine label with your actual device identifier.

export MATLAB_BENCHMARK_MACHINE='my-measurement-machine'
matlab -batch "addpath('benchmarks/cross-tool/matlab-performance'); run_matlab_reference('outputs/matlab-performance.json')"
node benchmarks/cross-tool/matlab-performance/run-native.mjs --matlab=outputs/matlab-performance.json

The first program writes independent results; the native collector imports and checks them. Format lemonergy/matlab-performance@1 retains six case IDs, inputs, settings, accepted traces, numerical limits and first/warm timings.

Collect the four thermal event cases

matlab -batch "addpath('benchmarks/cross-tool/thermal-runaway'); run_matlab_reference('outputs/thermal-runaway-matlab.json')"
node benchmarks/cross-tool/thermal-runaway/run.mjs --matlab=outputs/thermal-runaway-matlab.json

Format lemonergy/matlab-runaway-performance@1 includes complete thermal traces, energy accounting and sampled events for the reduced thermal equations. It does not reproduce a physical abuse experiment.

Both folders contain run_matlab_reference. In an existing session, clear that function and put the intended folder first with addpath(path,'-begin') before calling it. A new batch process avoids reusing a previously loaded function.

Review the import

The protocols default to ten measured repetitions after two warmups, with the first run recorded separately. Optional second and third function arguments change the counts; document the values actually used.

The importer checks identity, inputs, units, settings, the full time window, switching/sample instants and every required signal. It recomputes numerical errors and timing summaries; a supplied pass flag cannot override the checks.

OutcomeNext action
File or format missingConfirm the command finished and inspect its output path
Inputs/settings differRestore the agreed contract and collect both sides again
Required event times absentCheck event/output rules instead of dropping the requirement
Numerical gate failsPreserve the failure and investigate its first divergence
Both pass but timing scopes differReport individual timings without a speed ratio

Keep the evidence with the conclusion

Retain both original files, source versions, environment and settings. Report numerical agreement before speed. The native engine emits intermediate block values; the independent runner emits the compared observables, so output scope must be explained.

Checksums identify changed content; they do not authenticate the machine or software that generated a file. Historical reports remain historical after a new build. See result interpretation for timing definitions and the retained campaign for the existing evidence.

Models and evidence

  • Download reference-case evidence (JSON) 48240 bytes
    Artifact provenance

    Repository origin: outputs/validation-performance/native.json

    SHA-256: 2523aa6c919662d18fd11226a2f72d0f555a555ed24e162c05505ba22b91814f

  • Download thermal evidence (JSON) 3467407 bytes
    Artifact provenance

    Repository origin: outputs/thermal-runaway-validation/native.json

    SHA-256: 3938c96604897de04fcc8d41894179951ca1bc72d179a4fac69a3d50509a7a40

  • Download reference contract (JSON) 22401 bytes
    Artifact provenance

    Repository origin: benchmarks/cross-tool/matlab-campaign/evidence/reference.json

    SHA-256: 5fafd62331140b6ea2c47df3ba25dcaed14632d63e1b9a6e0537fc31c688d171

Downloads preserve recorded inputs and results. Opening a saved result does not run a new simulation.

Related papers and references

  • article

    MathWorks: Estimate Battery Model Parameters from HPPC Data

    MathWorks

    The retained CT-01 contract transcribes ParameterSummary ID 5 for BAK N18650CL-29 at 25 °C and 0.4 SOC. Its original retrieval date is August 23, 2026; the campaign source notes record a September 30, 2026 check. The measured source voltage waveform was not imported.

    Read original

    Bibliographic reference · contents not reviewed · Published HPPC parameter problem; supplied MATLAB runner solves the authored fixed forward-model contract.

  • article

    MathWorks: Heat Conduction Through Iron Rod

    MathWorks

    The retained campaign contract records the iron-rod inputs and printed answers for Examples 1–3. Campaign source notes record a September 30, 2026 check. The local linear and lumped exponential trajectories are analytical constructions, not downloaded Simscape traces.

    Read original

    Bibliographic reference · contents not reviewed · Published iron-rod scalar examples and disclosed lumped balance.

  • article

    MathWorks: Solve Differential Equations of RLC Circuit Using Laplace Transform

    MathWorks

    The retained campaign contract records the circuit inputs and published current/charge expressions. Campaign source notes record a September 30, 2026 check. Lemonergy implements a connected numerical equation graph; it does not invoke a symbolic Laplace solver.

    Read original

    Bibliographic reference · contents not reviewed · Published driven RLC equations and analytical solution.