AmesimKnowledge

Community Knowledge > Headless Automation (AMEOpen)

Connection causality rules as the AMEOpen validator applies them

Run status: EXERCISED 2026-09-03 on Simcenter Amesim 2511, model 6dof_flight.

Amesim reports an illegal connection only at code generation, as fail to generate code for system, after the model is already built. amesim_validate_connections in amesim-mcp applies the same rules to a JSON connection list with no model open, using the per-port variables that SubmodelPort exposes (IO direction, dimension, unit, input type). This page states the rules exactly as the validator implements them, so a failing pair can be read and fixed in one pass.

The rules

  1. Same port tag. Both ports must carry the same tag: HFlow to HFlow, Signal to Signal, Thermal to Thermal, RShaft to RShaft. A tag mismatch fails before any variable is examined.
  2. Every InputBasic input needs a compatible output. For each input variable of type InputBasic on either side, the facing port must offer an output variable of the same dimension and unit. The failure names the input that has no compatible output.
  3. InputWithDefaultValue may go unfed. An input of that type is allowed to face a port with no matching output; the submodel falls back to its default.
  4. A dynamic port may feed any number of inputs. A dynamic port is one whose dimension comes from a structural parameter, for example dimInp on SIGRECEI0. Its single output satisfies as many inputs as face it. Added in commit 944cc7c after the 6dof_flight run showed the earlier one-to-one check rejecting legal signal fan-in.
  5. Two output-only ports cannot face each other. If neither side has an input, the pair is flagged. Also added in 944cc7c. This is the shape behind "two capacitive or two resistive elements facing each other".

Reading the domain table through the rules

Domain Capacitive side outputs Resistive side outputs
hydraulic (HFlow) pressure flow rate
thermal temperature heat flow
electrical voltage current
rotary mechanical torque speed
translational mechanical force velocity

Two capacitive ports face each other: both output pressure, both need flow, neither offers it. Rule 2 fails on the flow input, rule 5 fails if the ports are output-only. The fix is the usual one: insert a resistive element (orifice, pipe) between two capacitive ones, a capacitive element (volume, tank, node) between two resistive ones, and terminate a signal output with SSINK.

Workflow

  1. amesim_lib_submodel(name) for every candidate, in one batch, to get the port tables.
  2. Write the list as {submodel1, port1, submodel2, port2} with 0-based ports.
  3. amesim_validate_connections once with all pairs. Iterate to valid: true.
  4. Only then amesim_new_circuit, amesim_add_component, amesim_connect_ports.

Full two-phase recipe in the amesim-model-authoring skill in tc-automation-skills.

Source: amesim-mcp commit 944cc7c (validate_connections) and tc-automation-skills amesim-model-authoring SKILL.md · retrieved 2026-09-03