Lemonergy · Studio block

Normal random source

Produces reproducible Box–Muller Gaussian samples and holds them at the declared sample period.

Implementation ID
native-normal-random
Reviewed
2026-10-27

Behavior

z = sqrt(−2 ln(r₁)) × cos(2πr₂). y = mean + standard deviation × z.

Interface

Normal random source interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Normal random sourceStudio blockout0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
out0output1Signal; real scalar.

Parameters

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

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample period
sampleTimeS
s0.1Positive interval between sample instants. Values are held between samples.
Minimum 0
Seed (1–4294967295)
params[0]
11Configured value for Seed (1–4294967295).
Mean
params[1]
10Configured value for Mean.
Standard deviation
params[2]
11Configured value for Standard deviation.

Equations and rules

  • z = sqrt(−2 ln(r₁)) × cos(2πr₂)
  • y = mean + standard deviation × z

Worked example

Normal random source — worked example

Use the configured source parameters. Signal at 0 s = 4.376933234944767.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Signal
out0
04.37693323494476711e-10

Explore the recorded outputs

Normal random source recorded example

Normal random source
Normal random source against timeRecorded synthetic simulation values. Time in seconds; output in —.-0.961967100.47162650.251.905220.53.3388140.754.7724071—Time (s)
Normal random source: 4.376933 — at 0 s

11 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.

Download the recorded samples (JSON) · Open this Studio example after release

Use in a workflow

Normal random source — worked example

Produces reproducible Box–Muller Gaussian samples and holds them at the declared sample period.

  1. Normal random source: z = sqrt(−2 ln(r₁)) × cos(2πr₂). y = mean + standard deviation × z.
    • Use the block reference for settings and connections.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • Gaussian samples use the xorshift32 sequence and the cosine Box–Muller transform. This is not a power-spectral-density-normalized band-limited noise block.

Scientific and mathematical references

These sources explain the scientific and mathematical background. The behavior, interface and limits above define the Lemonergy implementation; a citation does not imply every model option in the source is implemented.

  1. A Note on the Generation of Random Normal Deviates

    G. E. P. Box, Mervin E. Muller · The Annals of Mathematical Statistics, 29(2), 610–611 · 1958

    Technical reference · The mathematical transform from two independent uniform variates to a normal variate; software generator and seed conventions are defined separately.

  2. Xorshift RNGs

    George Marsaglia · Journal of Statistical Software, 8(14) · 2003

    Technical reference · Xorshift random number generation; the exact 32-bit shifts and uniform scaling used here are specified by the Lemonergy contract.

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)