Lemonergy Wiki

Worked examples

Single cell: finite heat release

Check that a finite heat pulse releases the intended energy and stops at the declared event.

Document created Updated
Editorially reviewedSource record reviewed

Release a fixed amount of heat

A heat source should stop when its specified energy has been delivered. Here a 20 J/K thermal mass receives 200 W for ten seconds, starting at 2 s. You will follow the seed command through a latch and timer, reproduce the temperature rise and account for all 2,000 J.

The model is tr-finite-release, reference version 1. Its 26 prepared blocks and 30 connections combine continuous thermal states and sampled logic in Lemonergy's Rust/WebAssembly engine.

Open the prepared model

Open prepared examples and choose Single cell: finite heat release. The complete supplied model loads automatically. Choose Run prepared model to calculate a fresh result with Rust/WebAssembly, then select blocks to inspect their read-only parameters and connections. You can download the original model data for reference.

The public viewer lets you inspect, run and explore this prepared example. To change parameters, connect blocks, import a file or save an edited model, choose Edit with Pro. The Design app opens the selected example in its authenticated Pro editor; the workflow guide explains both experiences.

The finite-release model in Lemonergy, including its seed, timer, thermal state and energy-accounting branches.
Single cell: finite heat release: the complete prepared graph and Display outputs in the public Lemonergy example viewer. Fit, zoom and scroll reveal its connected blocks; the graph is read-only. Captured .

Define the pulse and temperature response

With no ambient loss or neighboring cell, the heat balance and analytical solution are:

C dT/dt = P(t)
P(t) = 200 W for 2 ≤ t < 12 s; otherwise 0 W
T(t) = 300 + 10 clamp(t − 2, 0, 10) K
Erelease(t) = 200 clamp(t − 2, 0, 10) J

Dividing 200 W by 20 J/K gives a heating rate of 10 K/s. Ten seconds of heating raises the temperature by 100 K. The trigger is a time-seeded command, not a temperature threshold. A latch remembers the seed; a timer ends the pulse without resetting that memory.

QuantityValueRole
Heat capacity20 J/KConverts heat to temperature rate
Initial temperature300 KIntegrator initial value
Release power200 WHeat applied while the pulse is active
Seed time2 sStep changes from 0 to 1
Release duration10 sOn-delay timer setting
Sample time0.1 sLatch and timer update interval
Ambient conductance / temperature0 W/K / 300 KNo heat loss
Observation window0–30 sIncludes before, during and after release

Follow the block chain

Select a block in the prepared diagram to inspect its read-only parameters and connections. The inventory is 5 Constant, 6 Gain, 6 Sum, 3 Integrator, and one each of Step, Compare, Boolean latch, On-delay timer, Product and Thermal balance.

BlockParameter or connectionFunction
ambient-temperature, zero, one · Constants300 K, 0, 1Supply ambient temperature, latch reset and pulse logic levels
negative-ambient · GainGain −1Form −300 K for the ambient-loss branch
cell-1-seed · StepBefore 0; after 1; at 2 sIssue the seed command
seed-threshold · Constant0.5Level for the command comparison
cell-1-trigger · CompareGreater than or equal; seed and threshold inputsGenerate the latch set condition
cell-1-latched · Boolean latchSample time 0.1 s; initial 0; reset wired to zeroRemember the seed
cell-1-release-complete · On-delay timerSample time 0.1 s; delay 10 sSignal the end of release
cell-1-negative-timer · GainGain −1Negate timer output
cell-1-release-remaining · Sum1 minus timer outputEnable heat until completion
cell-1-release-gate · ProductLatch × release-remaining; scale 1Form the finite pulse
cell-1-release-heat · GainGain 200; heat outputConvert the pulse to watts
cell-1-temperature-rate · Thermal balanceHeat capacity 20 J/K; ambient conductance 0Calculate temperature rate
cell-1-temperature · IntegratorInitial 300 K; rate gain 1Accumulate temperature
cell-1-release-energy · IntegratorInitial 0 J; rate gain 1Integrate released heat
cell-1-above-ambient · Sum; cell-1-ambient-heat · GainT − 300 K; gain 0 W/KCalculate the zero ambient heat loss
cell-1-negative-initial · Constant; cell-1-temperature-change · Sum−300 K; two inputsSubtract the initial temperature
cell-1-stored-energy · GainGain 20 applied to T − 300 KCalculate stored-energy change
total-ambient-heat · Sum; ambient-energy · IntegratorOne input; initial 0 J, gain 1Accumulate ambient transfer
total-release-energy · Sum; negative-release-energy · GainOne input; gain −1Form the negative release total
energy-residual · SumStored change + ambient energy − release energyCheck conservation
A selected finite-release block and its parameter values inside Lemonergy.
Single cell: finite heat release: read-only parameters and connections for the selected cell-1-release-complete block. Pro opens the model editor for changes. Captured .

This inventory includes all 26 blocks. Energy-accounting branches are connected measurements of the same thermal state, not additional heat sources.

Run and inspect the event boundaries

  1. Confirm the loaded binding: 26 blocks, 30 connections and 0–30 s.
  2. Keep the reference solver settings below, including the 0.1 s maximum step and sampled-block times.
  3. Choose Run prepared model. Confirm the status and full-trace completeness pass.
  4. Select Cell 1 released heat in Scope signal. Check that heat is on at 2 s and off at 12 s.
  5. Inspect Cell 1 temperature, Cell 1 released energy and Cell 1 trigger memory. The memory remains 1 after heating stops.
  6. Inspect Energy balance residual. Choose Download results CSV to review exact event rows and Download run evidence to retain the model and current comparison.
Solver settingReference value
MethodDormand–Prince 4(5)
Initial / minimum / maximum step0.001 / 1e−10 / 0.1 s
Relative / absolute tolerance1e−11 / 1e−12
Maximum steps100,000
Algebraic tolerance / iteration limit1e−10 / 30
Implicit tolerance / iteration limit1e−10 / 20

After the run, move Display time to inspect numerical Display outputs at retained solver times. Choose a signal’s Scope button, or use Scope signal, to view its full trajectory and reference-error plot. Scrubbing changes the inspected time, not the prepared model or its result.

Read the expected result

The finite-release result and fixed-reference comparison in Lemonergy.
Single cell: finite heat release: fresh Rust/WebAssembly results captured on 2026-10-10. The numerical checks, Scope overlay and error plot come from this same successful run. Captured .

Event outputs are right-continuous: heat is already 200 W at 2 s and already zero at 12 s. Temperature and accumulated energy stay continuous. These analytical checkpoints show the distinction:

Time (s)Temperature (K)Heat (W)Released energy (J)Trigger memory
0300000
230020001
73502001,0001
1240002,0001
3040002,0001

The retained thermal report, generated 1 October 2026 at 18:52:33 UTC, passed with 304 output points. Maximum temperature and heat errors were zero; maximum release-energy error and energy residual were approximately 1.14e−12 J. These historical metrics are distinct from a new run shown in the current interface screenshots.

The fixed gates are 1e−6 K for temperature, 1e−10 W for heat, 1e−3 J for energy and exactly zero latch error. The full 30 s window, every accepted point and every 0.1 s event instant must be retained. Matching final temperature alone is insufficient: a late pulse can deliver the same total energy at the wrong time.

Change the pulse power (Pro)

Choose Edit with Pro to open this example in the authenticated Design editor. The following changes require Pro editing. Use Run blocks & compare there to solve the edited graph; the public prepared model stays unchanged.

Select cell-1-release-heat and change Gain from 200 to 220, keeping the duration at 10 s. The edited model should release 2,200 J and reach 410 K. It should fail against the unchanged 200 W reference while its own energy residual remains near zero.

Save the variant separately. Restore Load reference blocks and rerun to recover the original case. This experiment distinguishes a different but internally balanced input from an error in the pulse or energy accounting.

Troubleshoot and assess the scope

ObservationCheck
Heating begins immediatelyStep seed time must be 2 s
Heating never stopsTimer delay and the 1 − timer branch
Trigger memory falls to zero at 12 sThe timer gates power; it should not reset the latch
Correct final temperature but a failed comparisonExact event instants, sample-time settings and full trace coverage
Residual changes after editing heat capacity in ProThe Thermal balance capacity and stored-energy gain must describe the same C

This is prescribed rectangular heating of one uniform thermal mass. It does not infer reaction heat from temperature or represent measured cell behavior. A passing energy balance establishes numerical consistency within this model, not physical validation or safety performance.

References and related reading

The retained thermal report records the historical verification. The external architecture sources attached to this article provide background; MATLAB/Simscape was not executed for that retained evidence. Continue with triggered heat propagation, where a neighboring temperature activates a second pulse, or read validation results to interpret the full-trace gates.

Models and evidence

  • Open Block validation
  • Download original model data 223780 bytes
    Artifact provenance

    Repository origin: outputs/thermal-runaway-validation/models/tr-finite-release.lemon.json

    SHA-256: 327ce87e7efec9fcf7c5a8092b7e58ed41026e3ffdd878bc1eb109b5f95384ff

  • Download thermal evidence (JSON) 3467407 bytes
    Artifact provenance

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

    SHA-256: 3938c96604897de04fcc8d41894179951ca1bc72d179a4fac69a3d50509a7a40

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

Related papers and references

  • paper

    A Review of Lithium-Ion Battery Thermal Runaway Modeling and Diagnosis Approaches

    Manh-Kien Tran; Anosh Mevawalla; Attar Aziz; Satyam Panchal; Yi Xie; Michael Fowler · MDPI — Processes · 2022-06-15

    A review connecting thermal-runaway model choices with prediction and detection methods; background for understanding what a numerical verification case can and cannot establish.

    Read original · DOI 10.3390/pr10061192

    Source description · Abstract and Sections 3–4: thermal-runaway models, prognosis and diagnosis. Background reading; the numerical verification cases do not reproduce a reviewed experiment.