Lemonergy · Studio block

Shared site power allocator

Share one grid-side power budget among one to eight requests.

Implementation ID
site-power-allocator
Reviewed
2026-10-27

Behavior

Proportional allocation scales all nonnegative demands together. Input-priority allocation fills request 1 before request 2 and subsequent requests. It outputs allocated power for each configured input plus total demand, total allocation and unused power.

Interface

Shared site power allocator interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Shared site power allocatorStudio blocklimitdemand1demand2demand3demand4demand5demand6demand7demand8totalDemandtotalAllocatedunusedPowerallocation1allocation2allocation3allocation4allocation5allocation6allocation7allocation8
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
limitinputWTyped signal input; its quantity must match the connected output.
demand1inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand2inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand3inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand4inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand5inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand6inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand7inputWNonnegative request. Only demand1 through the configured ports count may be connected.
demand8inputWNonnegative request. Only demand1 through the configured ports count may be connected.
totalDemandoutputWObserved result from the solved component or sampled controller.
totalAllocatedoutputWObserved result from the solved component or sampled controller.
unusedPoweroutputWObserved result from the solved component or sampled controller.
allocation1outputWAllocated power; outputs exist through the configured ports count.
allocation2outputWAllocated power; outputs exist through the configured ports count.
allocation3outputWAllocated power; outputs exist through the configured ports count.
allocation4outputWAllocated power; outputs exist through the configured ports count.
allocation5outputWAllocated power; outputs exist through the configured ports count.
allocation6outputWAllocated power; outputs exist through the configured ports count.
allocation7outputWAllocated power; outputs exist through the configured ports count.
allocation8outputWAllocated power; outputs exist through the configured ports count.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Ports
ports
count2Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1; Maximum 8
Limit W
limitW
W grid-side11000Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Allocation
allocation
0 proportional, 1 input priority0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1

Equations and rules

  • P_i = max(0, demand_i) * min(1, P_limit / sum(max(0, demand_j))), when total demand > 0

Worked example

Compare charging policies

Connect a vehicle for eight hours with a cheaper window from hour 1 to hour 7.

Open the Studio example →

Use in a workflow

Share a site supply

Multiple branches share one power cap.

  1. Shared site power allocator: Shares grid-side power
    • limitW
    • ports
    • allocation
Open the Studio example

Compare charging policies

Compare authored schedules on the same hardware.

  1. Shared site power allocator: Shares grid-side power
    • limitW
    • ports
    • allocation
Open the Studio example

Connected concepts

Limits and interpretation

  • This is deterministic policy comparison, not a forecast or economic optimum.
  • Downstream unused capacity is not silently redistributed.

Implementation sources

This reference follows Lemonergy implementation sources. Scientific articles support the linked concepts separately.

Repository: battery-design · Revision: ef9802329b75bc15bb96885f8ed5d49425106696

  • js/charging-control.js
  • js/charging-scenarios.js
  • docs/CHARGING_BLOCKS_SPEC.md
  • js/physical-network.js
  • rust-core/src/charging_control.rs

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)