Relationship direction: one way, both ways and relationship groups
Every relationship built so far in this series has been an ordinary one-way relationship: an equation evaluated once, contributing to one side only. That's the right default for most models, but not the only shape a relationship can take, and the choice between them isn't just a labeling preference. For one specific kind of equation, it changes the actual numbers a run produces.
The example below stays deliberately small to make that visible: two nodes, A and B, each with a single state called Value starting at 0, connected by one relationship whose entire equation is the constant 0.01. That equation is worth noticing on its own terms: it doesn't reference A or B at all, it's the same number regardless of which node is which.
The default: one way
A new relationship always acts one way, from its source to its target, the order you clicked the two nodes in. At the top of its card, One way is selected.

Running this model for 10 seconds produces exactly what a one-way relationship promises: the equation contributes only to its declared output, here B's value, and nothing else in the model moves.

Making it act both ways
Pressing Both ways on the same relationship keeps the same source and target (that choice was made once, when the relationship was drawn), but changes how the engine uses them: the equation is still evaluated once, then applied to both sides, negated on the far one.

Closing the results and running the identical model again, unchanged except for that one button, produces a different result:

This is exactly correct for a genuine conserved quantity, provided the equation is anti-symmetric under swapping source and target: a real function of sourceX - targetX, the way heat, mass or current transfer always is. Swap which node is source and the formula's sign flips too, but the physical result doesn't change.
A bare constant is the sharp counterexample, and it's why this example uses one. 0.01 doesn't reference source or target at all, so it isn't anti-symmetric. The ±0.1 split above wasn't computed from anything physical: it was decided entirely by which node happened to get labeled target when the relationship was drawn. Both ways is the right tool for a real flux equation, not a substitute for "connects two nodes."
The relationship group alternative
"Subsystems and relationship groups" covers building a relationship group. What's worth knowing here is how its mesh actually behaves, because it isn't a two-way relationship under another name.
A relationship group never uses one two-way relationship per pair. Instead, for every pair of members, it builds two ordinary one-way relationships, one each way, both carrying the identical equation. Each is evaluated independently, with its own source and target, and lands on its own target with no mirroring or sign flip involved. For the equation in this example, that means A → B contributes +0.01/s to B, and B → A independently contributes +0.01/s to A: both nodes end at +0.1, not the ±0.1 split a two-way relationship produced.
For a genuinely anti-symmetric flux equation, this reduces to the same numbers a two-way relationship would give: k · (sourceX - targetX) evaluated as A → B gives k(A-B), and evaluated as B → A gives k(B-A), the exact negative of the first. Nothing is lost for real physics. This shape exists because a group has no single user-chosen source and target for a given pair the way a hand-drawn relationship does, so an arbitrary role assignment across a larger mesh would be unavoidable with only one relationship per pair. Two independent one-way relationships sidestep that question instead of answering it arbitrarily.
That also means a two-member relationship group is not interchangeable with a two-way relationship, even though both connect the same two nodes. For an anti-symmetric equation the two happen to agree numerically, which is exactly why this rarely comes up in practice. For anything that isn't, a bare constant being the clearest case, they don't. Wanting real sign-flip, conserved-exchange behavior for exactly two nodes calls for an ordinary two-way relationship, not a two-member group.
Choosing between them
- A contribution with no counter-effect on the other side: an ordinary one-way relationship.
- Exactly two nodes and a real conserved quantity flowing between them, equation written as
sourceX - targetX: an ordinary two-way relationship, with source and target chosen deliberately. - The same interaction replicated across three or more nodes, or a two-node case authored the same way a larger mesh would be: a relationship group, with the equation written the same anti-symmetric way across every pair.
Where to go from here
This closes a gap left open since "Getting started," which only ever needed the one-way default. From here, "Subsystems and relationship groups" covers building the mesh described above, and "Running a simulation" covers everything this page did with Run and Close and edit in more depth.
Follow Konjugate on LinkedIn for updates, or subscribe via RSS.
Comments
Post a Comment