Skip to content

Instantly share code, notes, and snippets.

@Nectarineimp
Created March 25, 2026 20:26
Show Gist options
  • Select an option

  • Save Nectarineimp/8c3601169e381ff80bd0e4f4a84cf8ca to your computer and use it in GitHub Desktop.

Select an option

Save Nectarineimp/8c3601169e381ff80bd0e4f4a84cf8ca to your computer and use it in GitHub Desktop.
Baghdad Battery from Basic Principles
digraph BaghdadBatteryDependencies {
rankdir=TB;
node [shape=box, style=rounded];
subgraph cluster_L0 {
label="Level 0 – Physical Laws (Not Known, but True)";
style=dashed;
L0_1 [label="L0.1: Different metals have different\nintrinsic electrode potentials"];
L0_2 [label="L0.2: Acids enable redox reactions\nbetween metals and ions"];
L0_3 [label="L0.3: Charge separation creates an\nelectric potential difference"];
L0_4 [label="L0.4: Electrons move through metals,\nions move through liquids"];
L0_5 [label="L0.5: Chemical free energy can be\nconverted into electrical energy"];
}
subgraph cluster_L1 {
label="Level 1 – Empirical Chemical & Material Behaviors";
style=dashed;
L1_1 [label="L1.1: Iron corrodes rapidly in\nsour/acidic liquids"];
L1_2 [label="L1.2: Copper corrodes slowly or not\nat all in the same liquids"];
L1_3 [label="L1.3: Some liquids (vinegar, wine,\nfermented juice) are 'sharp' and reactive"];
L1_4 [label="L1.4: Two different metals in the\nsame liquid behave differently"];
L1_5 [label="L1.5: If metals touch directly,\nbehavior/effect changes"];
L1_6 [label="L1.6: Sealed containers preserve\nliquid properties over time"];
}
subgraph cluster_L2 {
label="Level 2 – Craft Technologies";
style=dashed;
L2_1 [label="L2.1: Clay selection for vessels"];
L2_2 [label="L2.2: Kiln firing to harden ceramics"];
L2_3 [label="L2.3: Making liquid-tight ceramic jars"];
L2_4 [label="L2.4: Smelting copper from ore"];
L2_5 [label="L2.5: Hammering copper into sheets"];
L2_6 [label="L2.6: Rolling copper sheets into\ncylinders/tubes"];
L2_7 [label="L2.7: Smelting/forging iron rods or nails"];
L2_8 [label="L2.8: Harvesting natural bitumen/tar"];
L2_9 [label="L2.9: Heating and applying bitumen\nas a waterproof sealant"];
}
subgraph cluster_L3 {
label="Level 3 – Assembly Principles (Cell Architecture)";
style=dashed;
L3_1 [label="L3.1: Metals must be kept physically\nseparate (no direct contact)"];
L3_2 [label="L3.2: Both metals must be exposed\nto the same liquid"];
L3_3 [label="L3.3: The liquid must be acidic\nfor a strong effect"];
L3_4 [label="L3.4: The container must be sealed\nto prevent evaporation/contamination"];
L3_5 [label="L3.5: Iron rod centered within\ncopper cylinder"];
L3_6 [label="L3.6: Copper cylinder closed at one end\n(cup-like form)"];
L3_7 [label="L3.7: Assembly must be stable and\nupright in use"];
}
subgraph cluster_L4 {
label="Level 4 – Functional Insight (Electrical Potential Awareness)";
style=dashed;
L4_1 [label="L4.1: Connecting the two metals externally\nproduces a consistent effect"];
L4_2 [label="L4.2: The effect is repeatable\nacross builds"];
L4_3 [label="L4.3: The effect depends on the\nchoice of metals"];
L4_4 [label="L4.4: The effect depends on the\nchoice of liquid"];
L4_5 [label="L4.5: The effect depends on keeping\nmetals separated in the liquid"];
L4_6 [label="L4.6: Multiple jars can strengthen\nor modify the effect"];
}
subgraph cluster_L5 {
label="Level 5 – Final Device (Baghdad Battery as Intentional Cell)";
style=dashed;
L5_1 [label="L5.1: Clay jar body"];
L5_2 [label="L5.2: Copper cylinder electrode"];
L5_3 [label="L5.3: Iron rod electrode"];
L5_4 [label="L5.4: Bitumen plug/seal"];
L5_5 [label="L5.5: Acidic electrolyte (e.g., vinegar,\nwine, sour juice)"];
L5_6 [label="L5.6: External connection points\non iron and copper"];
L5_7 [label="L5.7: Intentional assembly as a\ndevice to generate potential"];
}
// Level 0 → Level 1
L0_1 -> L1_4;
L0_2 -> L1_1;
L0_2 -> L1_2;
L0_3 -> L1_4;
L0_4 -> L1_4;
L0_5 -> L1_1;
// Level 1 → Level 3
L1_1 -> L3_3;
L1_2 -> L3_3;
L1_3 -> L3_3;
L1_4 -> L3_1;
L1_4 -> L3_2;
L1_5 -> L3_1;
L1_6 -> L3_4;
// Level 2 → Level 3
L2_1 -> L2_2;
L2_2 -> L2_3;
L2_3 -> L3_4;
L2_3 -> L5_1;
L2_4 -> L2_5;
L2_5 -> L2_6;
L2_6 -> L3_6;
L2_6 -> L5_2;
L2_7 -> L3_5;
L2_7 -> L5_3;
L2_8 -> L2_9;
L2_9 -> L3_4;
L2_9 -> L5_4;
// Level 3 → Level 4
L3_1 -> L4_1;
L3_2 -> L4_1;
L3_3 -> L4_4;
L3_4 -> L4_2;
L3_5 -> L4_1;
L3_6 -> L4_1;
L3_7 -> L4_2;
// Level 1 & 3 → Level 4 (material/liquid dependence)
L1_4 -> L4_3;
L1_3 -> L4_4;
// Level 4 → Level 5
L4_1 -> L5_6;
L4_2 -> L5_7;
L4_3 -> L5_2;
L4_3 -> L5_3;
L4_4 -> L5_5;
L4_5 -> L5_7;
L4_6 -> L5_7;
// Overall flow (for layout hints)
{rank=same; L0_1; L0_2; L0_3; L0_4; L0_5;}
{rank=same; L1_1; L1_2; L1_3; L1_4; L1_5; L1_6;}
{rank=same; L2_1; L2_2; L2_3; L2_4; L2_5; L2_6; L2_7; L2_8; L2_9;}
{rank=same; L3_1; L3_2; L3_3; L3_4; L3_5; L3_6; L3_7;}
{rank=same; L4_1; L4_2; L4_3; L4_4; L4_5; L4_6;}
{rank=same; L5_1; L5_2; L5_3; L5_4; L5_5; L5_6; L5_7;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment