Lemonergy · Studio block
Scaled integer constant
Encodes exact real-world values as integer codes with an explicit slope and bias.
- Implementation ID
scaled-constant- Reviewed
- 2026-10-27
Behavior
Stores exactly representable real-world values as signed32 or unsigned32 integer codes with declared slope and bias.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
out0 | output | 1 | Output 1; i32 signal. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
quantityquantity | 1 | dimensionless | Explicit quantity in the worked model. |
shapeshape | 1 | [2] | Explicit shape in the worked model. |
element TypeelementType | 1 | i32 | Explicit elementType in the worked model. |
slopeslope | 1 | 0.25 | Explicit slope in the worked model. |
biasbias | 1 | 0 | Explicit bias in the worked model. |
valuesvalues | 1 | [1.5, -0.5] | Explicit values in the worked model. |
Equations and rules
real-world value = slope × stored code + biasstored code = (value − bias)/slope
Worked example
Scaled integer constant — executable model
Values[1.5,−0.5] with slope0.25 and bias0 have raw codes[6,−2].
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
ResultResult | 0.2 | 6 | 1 | 1e-09 |
Second integer codeResult/out0/1 | 0.2 | -2 | 1 | 1e-09 |
Use in a workflow
Scaled integer constant — executable model
Encodes exact real-world values as integer codes with an explicit slope and bias.
- Scaled integer constant: Stores exactly representable real-world values as signed32 or unsigned32 integer codes with declared slope and bias.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Values must be exactly representable and within storage bounds. This supplies a bounded scaled-integer source, not a general fixed-point arithmetic library.
Reference basis
This compiler and software type contract is defined by the documented behavior and executable example; no external research result or full external API parity 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)