modelBatterySimple
Simplified model of a battery without events
Extends from TransiEnt.Basics.Icons.Model (Icon for models).
Information
Purpose
Simple battery model with SOC state and SOC‑dependent charge/discharge limits. Optionally applies input dynamics (dead time and first‑order lag) to the power setpoint before enforcing limits.
Function
- Energy state: der(E) = P_actual, SOC = E / Bat_Capacity.
- Setpoint path: P_set → optional fixedDelay(deadTime) → optional FirstOrder(T=tau) → P_set_internal.
- Hard limit: P_limit = clamp(P_set_internal, -Bat_PowerLimit, +Bat_PowerLimit).
- SOC limits (no nested lists): – If SOC ≥ 1 and charging or SOC ≤ 0 and discharging ⇒ P_actual = 0.
– If charging and SOC ≥ threshold_P_curtailment ⇒ linear taper to P_min_rel at SOC = 1.
– If discharging and SOC ≤ 1 - threshold_P_curtailment ⇒ linear taper to P_min_rel at SOC = 0.
– Else ⇒ P_actual = P_limit. - Electrical coupling: P_actual is exported via a PQ boundary at the complex power port epp.
Inputs
- P_set — desired charge/discharge power (W, + = charge).
- epp — electrical grid connection (complex power port).
Outputs
- SOC — state of charge (0–1).
- P_set_internal — setpoint after optional dynamics (for diagnostics).
- P_max — reported absolute power limit (= Bat_PowerLimit).
Notes
- useDynamics=false bypasses both dead time and first‑order lag.
- Model omits voltage/current dynamics and efficiency; power is applied directly to the energy state.
Source
Time‑constant references: S. S. T. AG, Technische Information – SUNNY BOY SMART ENERGY / SUNNY BOY STORAGE / SUNNY ISLAND, 1st ed., Sep. 2022.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | threshold_P_curtailment | 0.95 | If SOC > thr. reduce power linearly |
| Real | P_min_rel | 0.02 | Minimum relative power at SOC limits (0 or 1) |
| Battery | |||
| Modelica.Units.SI.Energy | Bat_Capacity | 90e3*3600 | Battery capacity in Joule |
| Real | Bat_SOCStart | 0.5 | Battery Charge at start |
| Modelica.Units.SI.Power | Bat_PowerLimit | 15000 | Charge and discharge power |
| Dynamics | |||
| Boolean | useDynamics | true | Time constant of delay transfer function |
| Modelica.Units.SI.Time | deadTime | 2 | Time constant of delay transfer function |
| Modelica.Units.SI.Time | tau | 3 | Time constant of first order transfer function |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| TransiEnt.Basics.Interfaces.Electrical.ComplexPowerPort | epp | ||
| Modelica.Blocks.Interfaces.RealOutput | SOC | ||
| Modelica.Blocks.Interfaces.RealOutput | P_set_internal | ||
| TransiEnt.Basics.Interfaces.Electrical.ElectricPowerIn | P_set | Set power for charging and discharging | |
| TransiEnt.Basics.Interfaces.Electrical.ElectricPowerOut | P_max | Real Power |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Sources.RealExpression | P_actual_ | ||
| Modelica.Blocks.Nonlinear.FixedDelay | fixedDelay | ||
| Modelica.Blocks.Continuous.FirstOrder | firstOrder | ||
| Modelica.Blocks.Math.Gain | noDynamics | ||
| Modelica.Units.SI.Energy | E | ||
| Modelica.Units.SI.Power | P_actual | ||
| Modelica.Units.SI.Power | P_limit | ||
| TransiEnt.Components.Boundaries.Electrical.ComplexPower.PQBoundary | pQBoundary | ||
| Modelica.Blocks.Sources.RealExpression | Battery_PowerLimit |