Lemonergy · Studio block
Reusable submodel
Groups a model behind named typed inputs and outputs so it can be used as an independent instance inside another model.
- Implementation ID
subsystem- Reviewed
- 2026-10-27
Behavior
An instance names a versioned internal definition. Compilation resolves its public ports, applies validated parameter overrides and creates separate runtime states for its internal blocks. Only declared outputs may cross the boundary; port names remain stable through export and import.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
u | input | 1 | Parent input connected to the child input boundary. |
y | output | 1 | Child result exposed through the named output boundary. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Definition identifierdefinition | 1 | double | Identifier of the internal reusable model definition. |
Definition versionversion | 1 | 1 | Exact required definition version; a mismatch is rejected. |
Instance parameter overridesparameters | 1 | {} | Validated overrides for declared blocks in this instance; other instances retain their own values and states. |
Equations and rules
child input u = parent inputexample child output y = 2uparent Result = child output y
Worked example
Typed input and output of a reusable submodel
The example selects the doubling submodel. The parent supplies a constant 3 through the named input u. Inside the child, gain 2 produces 6 and the named output y returns it to the parent. The parent Result signal is 6 at 0.2 seconds. Selecting the alternate tripling definition for another run produces 9.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Parent result after the child output boundaryResult | 0.2 | 6 | 1 | 1e-09 |
Use in a workflow
Typed input and output of a reusable submodel
Groups a model behind named typed inputs and outputs so it can be used as an independent instance inside another model.
- Reusable submodel: An instance names a versioned internal definition. Compilation resolves its public ports, applies validated parameter overrides and creates separate runtime states for its internal blocks. Only declared outputs may cross the boundary; port names remain stable through export and import.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Internal versioned definitions share the parent simulation and solver. Separately loaded external models with independent solver settings or lifecycle are not supported.
- Containment must be acyclic and at most 16 levels deep. Interfaces, node counts and expanded graphs have explicit finite budgets.
- The linked example uses a compile-time selector to choose an ordinary typed submodel; the basic submodel itself does not select variants or provide conditional execution.
Reference basis
Model hierarchy, named interfaces and instance isolation are software contracts verified by the executable example. No external research result or 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)