Lemonergy Wiki

Worked examples

Two cells: triggered heat propagation

Check that heat from the first cell produces the expected sampled trigger in its neighbor.

Document created Updated
Editorially reviewedSource record reviewed

Follow a heat pulse into a neighboring cell

Heat conduction can activate an event in a neighboring thermal mass. In this example, cell 1 releases a finite heat pulse, cell 2 samples its temperature, and a latched trigger starts a second pulse. You will trace the event logic, reproduce the two temperature histories and verify the complete energy balance in Lemonergy.

The prepared model is tr-propagation, reference version 1. Its 48 blocks and 64 connections combine continuous thermal states with sampled logic in the Rust/WebAssembly engine. First try passive heat exchange and single-cell finite release if these building blocks are new to you.

Open and inspect the complete model

Open prepared examples and choose Two cells: triggered heat propagation. 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 connected two-cell propagation model inside Lemonergy, including both thermal states and their pulse-control branches.
Two cells: triggered heat propagation: 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 .

Every required block is included. The extra energy-accounting branches measure the model's balance; they do not represent additional physical cells.

Define the balances and event rules

The cells begin at the same temperature. Each loses heat to the environment, and a conductive link transfers equal and opposite heat between them:

q12 = G (T1 − T2)
C dT1/dt = P1 − H (T1 − Ta) − q12
C dT2/dt = P2 − H (T2 − Ta) + q12
P1 = 200 W for 0 ≤ t < 10 s; otherwise 0 W
P2 = 200 W for t2 ≤ t < t2 + 10 s; otherwise 0 W

Cell 1 starts from a time-seeded command at 0 s. Cell 2 starts at the first 0.1 s sampling instant when T2 is strictly greater than 320 K. Each latch remembers its trigger permanently; a separate timer shuts off heat after ten seconds.

InputValueWhere to inspect it
Heat capacity C20 J/K per cellBoth Thermal balance blocks
Initial temperatures300 K, 300 KBoth temperature Integrators
Inter-cell conductance G2 W/Kinter-cell-heat Gain
Ambient conductance H1 W/K per cellThermal balance blocks and ambient-heat Gains
Ambient temperature Ta300 Kambient-temperature Constant
Release power200 W per triggered cellBoth release-heat Gains
Release duration10 sBoth On-delay timers
Sample time0.1 sBoth latches and timers
Cell 1 seed0 to 1 at 0 sStep block
Cell 2 thresholdStrictly greater than 320 KThreshold Constant and Compare
Observation window0–40 sSolver settings

For an independent reference, let m = (T1 + T2)/2 − Ta and d = (T1 − T2)/2. Between event instants, dm/dt = (P1 + P2)/(2C) − Hm/C and dd/dt = (P1 − P2)/(2C) − (H + 2G)d/C. Their closed-form exponential solutions supply reference temperatures independently of the block solver.

Understand every block group

Select a block in the prepared diagram to inspect its read-only parameters and connections. In the table, cell-i means the listed group exists once for each of the two cells.

Block or groupParameters and unitsRole
ambient-temperature, zero, one · Constants300 K, 0, 1Supply the ambient state and logic levels
negative-ambient · Gain−1Form −Ta for ambient-loss accounting
cell-1-seed · Step; seed-threshold · ConstantBefore 0, after 1, at 0 s; threshold 0.5Seed cell 1
cell-1-trigger · CompareSeed ≥ 0.5Create cell 1 set condition
cell-2-threshold · Constant; cell-2-trigger · Compare320 K; T2 > thresholdCreate the neighboring set condition
cell-i-latched · Boolean latchSample 0.1 s; initial 0; reset connected to zeroKeep trigger memory
cell-i-release-complete · On-delay timerSample 0.1 s; delay 10 sMark the end of each pulse
cell-i-negative-timer · Gain; cell-i-release-remaining · Sum−1; two inputsCalculate 1 − timer output
cell-i-release-gate · ProductLatch × release-remaining; scale 1Enable the finite pulse
cell-i-release-heat · Gain200 W per unit logic levelProduce heat power
cell-i-temperature-rate · Thermal balanceC = 20 J/K; H = 1 W/KCalculate dTi/dt from net heat, Ti and Ta
cell-i-temperature · IntegratorInitial 300 K; rate gain 1Accumulate temperature
cell-i-release-energy · IntegratorInitial 0 J; rate gain 1Accumulate the heat released by that cell
cell-i-above-ambient · Sum; cell-i-ambient-heat · GainTi − Ta; gain 1 W/KMeasure heat transferred to ambient
cell-i-negative-initial · Constant; cell-i-temperature-change · Sum−300 K; two inputsForm Ti − Ti(0)
cell-i-stored-energy · Gain20 J/KCalculate stored-energy change
negative-cell-2-temperature · Gain; inter-cell-temperature-difference · Sum−1; two inputsForm T1 − T2
inter-cell-heat · Gain; negative-inter-cell-heat · Gain2 W/K; −1Compute equal and opposite link heat
cell-1-net-heat, cell-2-net-heat · SumsP1 − q12; P2 + q12Feed each Thermal balance
total-ambient-heat · Sum; ambient-energy · IntegratorTwo inputs; initial 0 J, gain 1Accumulate total environmental loss
total-release-energy · Sum; negative-release-energy · GainTwo inputs; −1Form the negative released-energy total
energy-residual · SumFour inputsStored change + ambient energy − released energy
A propagation-model block selected in Lemonergy's parameter inspector.
Two cells: triggered heat propagation: read-only parameters and connections for the selected cell-2-trigger block. Pro opens the model editor for changes. Captured .

In the Pro editor, changing a physical parameter can require an accounting change too: if you edit C, update the corresponding stored-energy gain; if you edit H, update the ambient-heat gain. This keeps the independent energy check consistent with the physical balances.

Run the model and inspect the event

  1. Confirm the loaded model has 48 blocks, 64 connections and a 0–40 s window.
  2. Keep the fixed solver settings below and the 0.1 s latch/timer sample times.
  3. Choose Run prepared model. Check that the comparison and full-trace completeness pass.
  4. Use Scope signal to inspect Cell 2 temperature, then Cell 2 trigger memory and Cell 2 released heat. The neighboring pulse begins at 9.7 s.
  5. Inspect Cell 1 released heat. It ends at 10 s while cell 2 continues releasing heat until 19.7 s.
  6. Inspect each released-energy signal, Energy transferred to ambient and Energy balance residual. Use the comparison CSV export to inspect exact event rows.
  7. Choose Download run evidence to retain the fresh model/result comparison and Download results CSV for the sampled signals. The original model data is available under Model, method and references.
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 temperature and energy results

The propagation result and native-versus-reference comparison plotted inside Lemonergy.
Two cells: triggered heat propagation: fresh Rust/WebAssembly results captured on 2026-10-10. The numerical checks, Scope overlay and error plot come from this same successful run. Captured .

The table contains rounded analytical checkpoints. Power outputs are right-continuous: the new power applies at an event instant, while temperature and energy remain continuous.

Time (s)T1 (K)T2 (K)P1 (W)P2 (W)Meaning
0300.000000300.0000002000Seeded pulse starts
5336.389826307.8500182000Conduction heats the neighbor
9.6356.307302319.9360202000Neighbor remains below threshold
9.7356.660718320.199843200200First sampled trigger for cell 2
10357.748910323.9225700200Cell 1 pulse ends
19.7346.838739380.30672300Cell 2 pulse ends
40322.934307323.14351800Both cells are cooling

Do not round the 9.6 s temperature to 320 K when deciding the event. Its unrounded value is below the strict threshold. The 9.7 s event is a sampled-model result, not a continuous crossing-time estimate.

Energy at 40 sExpected value
Cell 1 release2,000 J
Cell 2 release2,000 J
Transfer to ambient3,078.443512 J
Combined stored-energy increase921.556488 J
Stored increase + ambient transfer − release0 J analytically

The retained thermal report, generated 1 October 2026 at 18:52:33 UTC, passed with 410 output points and a maximum energy-balance residual of approximately 1.18e−11 J. This historical record is separate from the fresh run shown in the interface screenshots.

Fixed full-trace gates are 1e−6 K for temperatures, 1e−10 W for release power, 1e−3 J for energies and exactly zero latch error. Original settings, every accepted point, all 0.1 s instants and both trigger/end times must also match. See how to read validation results for the difference between final-value agreement and complete trace agreement.

Explore weaker coupling (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.

Save the reference model, then change Gain on inter-cell-heat from 2 to 0.1. Keep the other parameters unchanged and rerun. The neighbor should remain below the trigger threshold over 40 s, and total release should fall from 4,000 J to 2,000 J. The edited model will differ from this page's frozen propagation reference.

For a matching reference and a full interpretation of that experiment, load Two cells: reduced thermal coupling. Comparing these cases also shows the tradeoff: a weaker link reduces neighboring heating while letting the seeded cell become hotter during its own pulse.

Troubleshoot and assess the scope

ObservationCheck
Cell 2 never triggers in the original caseG = 2 W/K, threshold 320 K, strict greater-than comparison and both thermal connections
Cell 2 appears to trigger at 9.6 sRead unrounded data and exact sample instants; do not infer an event from rounded chart labels
Heat continues after ten secondsOn-delay settings and the 1 − timer branch
Trigger memory drops when heat stopsThe timer gates heat; the latch reset should stay connected to zero
Energy residual growsOpposite signs of link heat, matched C/H accounting gains and release-energy integrators

This authored lumped model verifies a numerical implementation. Its rectangular release, constant properties and sampled trigger do not represent measured battery reaction kinetics. Gas, flame, radiation, venting, ejecta, electrochemistry and spatial gradients are outside its scope. A pass is not physical validation or a safety claim.

References and related reading

The retained model and report bind this example to its historical inputs and numerical evidence. The cited external architecture documentation in this page's sources is background, not a measured reference dataset; MATLAB/Simscape was not executed for that retained check. Continue with thermal propagation verification, battery thermal management or the example library.

Models and evidence

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

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

    SHA-256: 6c54a542838f1de0c3e1c620695d412b585d3f101db1e852ede680a33a53452f

  • 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.