Skip to main content

Crate pantometry_electrical

Crate pantometry_electrical 

Source
Expand description

pantometry-electrical: resistive dissipation, as a domain built on the pantometry-core kernel.

The physics that produces the watts every other domain in this workspace has so far been handed. pantometry-thermal consumes heat, pantometry-optics publishes it from absorbed light, pantometry-mechanics from a dashpot, pantometry-acoustic from an absorbing duct end — and a motor or a heater or a trace on a board gets hot for none of those reasons. It gets hot because current went through resistance.

Until this crate, the workspace’s own examples papered over that with a source of a stated number of watts. That is fine as a stand-in and it is not a model: nothing decides the number, so nothing can be wrong about it.

use pantometry_electrical::Winding;
use pantometry_units::{Current, Length, Temperature};

// A copper winding carrying 3 A. Its resistance is what decides the heat.
let coil = Winding::of_copper("coil", Length::m(24.0), 0.35e-6, Temperature::celsius(25.0))
    .driven_at(Current::a(3.0));
// rho*L/A at 20 C is 1.18217 ohm; five kelvin of copper adds 1.965%.
assert!((coil.resistance().to_si() - 1.205401).abs() < 1e-6);
assert!((coil.dissipation().to_si() - 10.848610).abs() < 1e-6);   // I^2 R

§The coupling this crate deliberately does not have

Copper’s resistivity rises about 0.393% per kelvin, so a winding that gets hot dissipates more, which makes it hotter. That feedback is the whole reason thermal runaway is a thing a designer worries about, and it is not expressible here.

A domain would need to read another domain’s temperature inside the step loop. Exchange carries amounts — joules, coulombs — and not state, which is exactly what makes the conservation audit an equality rather than an approximation. There is no peek_temperature, and adding one would not be a small thing: a channel carrying state is not conserved, cannot be audited, and is a short step from domains reading each other, which is the property the crate split exists to hold.

So this crate models the resistance at a temperature you state, and Winding::at_temperature is how you state it. The number is right for that temperature and the feedback is the caller’s to close, between steps, with both temperatures in hand. What that costs and whether the kernel should grow something is written up rather than decided here — see the repository’s FRICTION.md.

§What the audit can and cannot see

A Winding holds a finite reserve of joules, like every other source in this workspace, because a source with an unlimited supply creates energy from nothing every step.

The domain refuses that itself rather than leaving it to the audit, and the reason is worth stating: an infinite reserve does not fail the audit, it disables it. The ledger reports inf before and inf after, inf compares equal to itself, and a winding pouring joules into a plate runs green at any tolerance. This test was written expecting the audit to catch it and it did not.

What the audit cannot check is whether I²R is the right number of watts. Both sides of the bus agree perfectly about whatever is published, so a resistance wrong by a factor of two balances the books exactly. The tests are therefore against closed forms computed independently: the resistivity of copper at a stated temperature, P = I²R, and the exact equivalence of the constant-current and constant-voltage forms at the same operating point.

Re-exports§

pub use conductor::Conductor;

Modules§

conductor
Current as a field, so I²R is a consequence of a shape rather than a number somebody typed.

Structs§

Winding
A length of conductor carrying current, dissipating I²R onto the heat channel.

Constants§

COPPER_ALPHA
Temperature coefficient of copper’s resistivity, per kelvin, referenced to 20 °C.
COPPER_RESISTIVITY_20C
Resistivity of annealed copper at 20 °C, in ohm-metres.
HEAT
The channel resistive loss is published on.