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.
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.
Ports and physical connections
Section titled “Ports and physical connections”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.
Binding existing spatial Fields
Section titled “Binding existing spatial Fields”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.
Source files and packages
Section titled “Source files and packages”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