Lemonergy · Studio block
Battery with SOC-dependent OCV
Lumped battery with a linear SOC-dependent open-circuit voltage and series resistance.
- Implementation ID
battery-ocv- Reviewed
- 2026-10-27
Behavior
The network solves terminal current and integrates charge into SOC. Positive current into the positive terminal charges the battery. Coulombic efficiency applies during charging; discharge uses unity.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
p | conserving | V, A | Electrical terminal: potential and charge-conserving current. |
n | conserving | V, A | Electrical terminal: potential and charge-conserving current. |
ocv | output | V | Observed result from the solved component or sampled controller. |
socSignal | output | fraction | Observed result from the solved component or sampled controller. |
loss | output | W | Observed result from the solved component or sampled controller. |
voltage | output | V | Observed result from the solved component or sampled controller. |
current | output | A | Observed result from the solved component or sampled controller. |
power | output | W | Observed result from the solved component or sampled controller. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Empty Voltage VemptyVoltageV | V | 300 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.01; Maximum 1000000 |
Full Voltage VfullVoltageV | V | 420 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.01; Maximum 1000000 |
Resistance OhmresistanceOhm | ohm | 0.08 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1e-06; Maximum 1000000 |
Capacity AhcapacityAh | Ah | 100 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1e-06; Maximum 1000000000 |
Initial SocinitialSoc | fraction | 0.2 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Coulombic EfficiencycoulombicEfficiency | fraction | 1 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.01; Maximum 1 |
Equations and rules
OCV = V_empty + (V_full - V_empty) * SOCI = (V_terminal - OCV) / RdSOC/dt = I * eta_charge / (3600 * Q_Ah), for I >= 0; I / (3600 * Q_Ah) otherwiseP_loss = I^2 * R
Worked example
Build CC–CV charging
An illustrative 100 Ah battery with a 420 V ceiling can use a 32 A cap. At the ceiling, current falls as OCV rises.
Open the Studio example →Use in a workflow
Build CC–CV charging
Native current and voltage regulation act against an explicit battery.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Share a site supply
Multiple branches share one power cap.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Compare charging policies
Compare authored schedules on the same hardware.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Compare grid and battery energy
Separate energy and loss signals make efficiency visible.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Separate low current from float
Bounded lithium charging and lead-acid maintenance are distinct.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Connect SOC and voltage
The battery integrates charge and combines OCV with resistance.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Charge during available stops
Availability is an independent signal.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Supply an outage load
V2H illustrates outage-triggered dispatch and reserve.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Model signed grid exchange
Explicit battery and converter exchange average power.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Transfer between two batteries
Conserving conversion couples donor and recipient.
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
- Battery with SOC-dependent OCV: Stores charge and supplies terminal voltage
- capacityAh
- initialSoc
- emptyVoltageV / fullVoltageV
- resistanceOhm
- Electrical ports p and n
Connected concepts
- CC-CV charging
- Charger
- Charging curve
- Constant current
- Constant voltage
- Cutoff voltage
- Taper current
- Depot charging
- Electric bus
- Energy management system
- Energy arbitrage
- AC slow charging
- Smart charging
- Energy efficiency
- Heat generation
- Joule
- Joule heating
- Power
- Watt
- Trickle and float charging
- Closed-circuit voltage
- Coulomb counting
- Coulombic efficiency
- Internal resistance
- IR drop
- OCV–SOC curve
- Open-circuit voltage
- State of charge
- Boost and top-up charging
- Opportunity charging
- Islanding
- Smart load panel
- Grid-to-vehicle
- Vehicle-to-everything
- Vehicle-to-grid
- DC/DC converter
- Vehicle-to-vehicle
Limits and interpretation
- The battery uses linear OCV and fixed resistance. It does not automatically add aging, thermal dynamics or balancing.
- Internal model SOC is not an estimate of an unknown physical battery. OCV is linear and resistance fixed.
- A loss signal is not a predicted temperature. This network takes external temperature.
- This is deterministic policy comparison, not a forecast or economic optimum.
- Downstream unused capacity is not silently redistributed.
- All battery and converter limits still apply. A schedule is not an electrochemical law.
- These effective parameters are not a recipe. Lithium-ion does not use indefinite trickle or lead-acid float.
- This excludes AC waveforms, synchronization, communications and certification.
- No islanding switches, smart-panel circuits or protection coordination are simulated.
- The example assumes hardware compatibility; it does not establish connector or communication compatibility.
Implementation sources
This reference follows Lemonergy implementation sources. Scientific articles support the linked concepts separately.
Repository: battery-design · Revision: ef9802329b75bc15bb96885f8ed5d49425106696
js/charging-control.jsjs/charging-scenarios.jsdocs/CHARGING_BLOCKS_SPEC.mdjs/physical-network.jsrust-core/src/charging_control.rs
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)