Skip to content

Commit

Permalink
Allow ESD1 to be initialized at negative power by setting lower limit…
Browse files Browse the repository at this point in the history
… of PHL to `-pmx`.
  • Loading branch information
cuihantao committed Sep 10, 2024
1 parent 8d8ae0c commit c7e7304
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions andes/models/distributed/esd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from andes.core.block import Integrator
from andes.core.discrete import HardLimiter, LessThan
from andes.core.param import NumParam
from andes.core.service import ConstService
from andes.core.var import Algeb, AliasState
from andes.models.distributed.pvd1 import PVD1Data, PVD1Model

Expand Down Expand Up @@ -53,6 +54,10 @@ class ESD1Model(PVD1Model):
def __init__(self, system, config):
PVD1Model.__init__(self, system, config)

self.pmin = ConstService(v_str='-pmx')

self.PHL.lower = self.pmin

# --- Determine whether the energy storage is in charging or discharging mode ---
self.LTN = LessThan(self.Ipout_y, 0.0)

Expand Down

0 comments on commit c7e7304

Please sign in to comment.