3. Algebraic relations and networks
Why relations come before algorithms
Section titled “Why relations come before algorithms”Many models are networks of simultaneous statements rather than recipes that calculate one variable after another. Conservation at a junction, compatibility between connected parts, and a constitutive law can all constrain the same unknowns. Calling one variable an “input” too early can hide that structure.
Eqiora writes each statement as a residual equal to zero. An equation such as therefore has the residual . The ordering of the symbols does not assign a computational direction.
Learning outcomes
Section titled “Learning outcomes”After this chapter, you should be able to:
- distinguish unknown quantities, prescribed parameters, and relations;
- count unknowns and independent scalar relations in a small model;
- separate conservation from the law that closes a network;
- compile a bounded algebraic
.eqimodel without selecting a solver; and - identify underdetermined, overconstrained, and inconsistent structures.
A two-branch split
Section titled “A two-branch split”Let a prescribed amount split into two unknown branch amounts and . Conservation provides one relation,
That relation alone cannot determine both branches. For a symmetric splitter, the constitutive or design assumption supplies the second relation. Solving the two statements by substitution gives , but the model owns the relations—not the elimination order used to obtain that expression.
Readable Eqiora source
Section titled “Readable Eqiora source”Save this as split.eqi:
model split { parameter supplied: 1 = 1; variable branch_a: 1; variable branch_b: 1;
relation conservation { branch_a + branch_b - supplied = 0; } relation equal_split { branch_a - branch_b = 0; }}From a source checkout, run the installed compiler against the checked-in copy:
$ eqiora check examples/algebraic-split.eqiView the complete checked-in model source.
Compilation checks the source and typed expressions. It does not execute this algebraic model or prove that the two residuals are globally independent.
Count before solving
Section titled “Count before solving”For this bounded example:
| Item | Count | Role |
|---|---|---|
| Prescribed parameters | 1 | supplied is known for one model instance. |
| Scalar unknowns | 2 | branch_a and branch_b must be determined. |
| Scalar relations | 2 | conservation and equal split close this particular structure. |
Matching counts are necessary, not sufficient. Two copies of the conservation
relation would still leave the split undetermined. A third relation demanding
branch_a = supplied would contradict equal split when supplied is nonzero.
Independence and consistency depend on relation content, not names or counts.
From equations to networks
Section titled “From equations to networks”In a physical network, a component typically owns its constitutive relation, while a connection owns compatibility or conservation across ports. This makes the model acausal: the assembled relations determine which quantities must be solved together. It does not mean every possible network is currently executable, and it does not turn connection order into execution order.
Observation boundary
Section titled “Observation boundary”This chapter observes compiler acceptance and performs a hand derivation. It
does not produce a Result. The values follow from the two written
relations; they are not reported as Eqiora numerical output.
Deliberate failure: remove the closing relation
Section titled “Deliberate failure: remove the closing relation”Delete equal_split while retaining conservation. The source remains readable
and dimensionally consistent, so the current compile check need not diagnose
the missing physical assumption. By hand, one equation constrains two unknowns:
every pair satisfying is possible. The repair is to state a justified
second relation, not to choose an arbitrary solver default.
This is an important diagnostic lesson: successful compilation does not prove that a model is closed or physically meaningful.
Exercises
Section titled “Exercises”- For , list three distinct pairs that satisfy conservation when
equal_splitis absent. - Replace equal split with . Derive both branch amounts without changing the conservation relation.
- Add the relation to the original symmetric model. For which value of are all three relations consistent?
- Give one circuit or flow-network example in which a connection owns conservation and a component owns a constitutive law. Identify every unknown and prescribed parameter.
Previous: Quantities, dimensions, and units · Back to the series map · Next: Ordinary differential equations