Skip to content
Get started

Composition

Language overview · Install this source revision

A component is a reusable declaration. An instance creates one occurrence with explicit named bindings. public requirements live inside the component body.

composition.eqi
component Offset(parameter input: 1, parameter offset: 1 = 1) {
variable output: 1;
relation value { output - input - offset = 0; }
}
model TwoOffsets() {
instance first: Offset(input = 2);
instance second: Offset(input = 5, offset = 3);
}

input is required; offset has a default. The two occurrences own separate private output Fields and relations. Equal input values would not merge those occurrences. Missing required parameters and unknown bindings are errors.

Electrical components expose named positive and negative conserving ports. connect conserving connects their typed connector occurrences: across values agree and outward through values sum to zero. It does not paste one component’s equations into another or impose an execution order. A signal input/output port has different semantics.

A continuum component can require support body: volume(ambient_dimension = 2) and an occurrence-bound variable or state in its signature. In an instance, write support body = body and field displacement = displacement explicitly. The elastic-body example binds the same displacement to a balance law and its boundary interface. These bindings refer to one existing Field, not two copied displacement states.

Exact support and connector identity matter; equal numerical sizes are insufficient. Complete boundary families must include the actual exterior members.

A package-qualified declaration additionally requires its exact dependency closure. See source files and installation for the source-installed workflow.

Example source · hierarchy compiler · Next: Standard sources