Skip to content
Get started

3. Algebraic relations and networks

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 a+b=sa+b=s therefore has the residual a+bsa+b-s. The ordering of the symbols does not assign a computational direction.

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 .eqi model without selecting a solver; and
  • identify underdetermined, overconstrained, and inconsistent structures.

Let a prescribed amount ss split into two unknown branch amounts aa and bb. Conservation provides one relation,

a+bs=0.a+b-s=0.

That relation alone cannot determine both branches. For a symmetric splitter, the constitutive or design assumption ab=0a-b=0 supplies the second relation. Solving the two statements by substitution gives a=b=s/2a=b=s/2, but the model owns the relations—not the elimination order used to obtain that expression.

Save this as split.eqi:

eqiora
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:

Terminal windowconsole
$ eqiora check examples/algebraic-split.eqi

View 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.

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.

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.

This chapter observes compiler acceptance and performs a hand derivation. It does not produce a Result. The values a=b=s/2a=b=s/2 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 a+b=sa+b=s 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.

  1. For s=1s=1, list three distinct pairs (a,b)(a,b) that satisfy conservation when equal_split is absent.
  2. Replace equal split with a=2ba=2b. Derive both branch amounts without changing the conservation relation.
  3. Add the relation a=sa=s to the original symmetric model. For which value of ss are all three relations consistent?
  4. 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