pub fn supply_energy(cfg: &Config, load: &CycleLoad) -> f64Expand description
The energy a cycle takes from the supply, J: what the drives drew less what they fed back, plus what the braking
resistor burned of what they fed back (with the DC link simulated; a shared one counted once). What the capacitors
hold more at the end than at the start counts as fed back. With the DC link simulated also what the bleeders took
out of it and the line module’s (or an S210’s rectifier’s) own loss, effects.dc_link’s
ratings.line_module_efficiency eta both ways: it draws drawn / eta from the line for the drawn it puts into the
DC link and gives the mains eta * fed of the fed it takes out (effects.regenerative_supply), so it loses
(1/eta - 1) drawn + (1 - eta) fed; with the load’s line_module_energy = drawn + fed and mains_energy = eta * fed,
fed = mains_energy / eta. The DC link’s balance, drawn - fed = net + burned + bleeders (+ what the capacitors gain),
makes this the energy drawn from the line less what the mains got back. A shared link is counted once, with the
shared config’s efficiency; a link of its own with its motor’s (catalog::motor_config).