Lemonergy · Studio block
Sample difference check
Checks absolute per-sample change against a strict maximum. The first comparison is skipped and reports zero change.
- Implementation ID
native-check-gradient- Reviewed
- 2026-10-27
Behavior
difference[0] = 0; difference[k] = |value[k] − value[k−1]|. pass = (difference < configured maximum).
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | 1 | Value; real scalar. |
out0 | output | 1 | Pass; bool scalar. |
out1 | output | 1 | Absolute sample difference; real scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample periodsampleTimeS | s | 0.1 | Positive interval between sample instants. Values are held between samples. Minimum 0 |
Maximum absolute sample differenceparams[0] | 1 | 0.3 | Configured value for Maximum absolute sample difference. |
Equations and rules
difference[0] = 0; difference[k] = |value[k] − value[k−1]|pass = (difference < configured maximum)
Worked example
Sample difference check — worked example
Value = 1. Pass at 0 s = 1; Absolute sample difference at 0 s = 0.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Passout0 | 0 | 1 | 1 | 1e-09 |
Absolute sample differenceout1 | 0 | 0 | 1 | 1e-09 |
Explore the recorded outputs
Sample difference check recorded example
Sample difference check / Absolute sample difference11 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
Download the recorded samples (JSON) · Open this Studio example after release
Use in a workflow
Sample difference check — worked example
Checks absolute per-sample change against a strict maximum. The first comparison is skipped and reports zero change.
- Sample difference check: difference[0] = 0; difference[k] = |value[k] − value[k−1]|. pass = (difference < configured maximum).
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Checks change per sample, not change divided by elapsed time; the first comparison is skipped.
Reference basis
This software operation is defined by its public contract and worked example; no external research result is claimed.
Implementation sources
This reference follows the public interface and locally verified numerical checks for an upcoming release.
Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27
docs/glossary/native-block-verification.json
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)