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

Scaled integer constant interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Scaled integer constantStudio blockout0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
out0output1Output 1; i32 signal.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
quantity
quantity
1dimensionlessExplicit quantity in the worked model.
shape
shape
1[2]Explicit shape in the worked model.
element Type
elementType
1i32Explicit elementType in the worked model.
slope
slope
10.25Explicit slope in the worked model.
bias
bias
10Explicit bias in the worked model.
values
values
1[1.5, -0.5]Explicit values in the worked model.

Equations and rules

  • real-world value = slope × stored code + bias
  • stored 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 →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Result
Result
0.2611e-09
Second integer code
Result/out0/1
0.2-211e-09

Use in a workflow

Scaled integer constant — executable model

Encodes exact real-world values as integer codes with an explicit slope and bias.

  1. 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.
Open Studio example after release

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)