Skip to content

Commit

Permalink
Update the simpleBattery module documentation with fault message
Browse files Browse the repository at this point in the history
Update the simpleBattery module documentation with fault message
  • Loading branch information
Yumeka Nagano committed Jan 17, 2025
1 parent 808c3fb commit 4f179b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/simulation/power/simpleBattery/simpleBattery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ The next step is to attach one or more :ref:`PowerNodeUsageMsgPayload` instances

For more information on how to set up and use this module, see the simple power system example :ref:`scenarioPowerDemo`.

To simulate a battery capacity fault that reduces the actual storage capacity (without directly altering the stated capacity), users must set up the fault flag::
Users must configure the fault message to simulate a battery capacity fault that reduces the actual storage capacity while the ``storageCapacity`` value remains unchanged. The faulted battery capacity is determined using the ``faultCapacityRatio``, calculated as (actual capacity) / (set capacity). ::

battery.fault = True
battery.faultCapacityRatio = 0.5 # 50% of the original capacity
faultMsg = messaging.PowerStorageFaultMsgPayload()
faultMsg.faultCapacityRatio = 0.3 # Actual capacity is 30% of the nominal capacity
faultStatusMsg = messaging.PowerStorageFaultMsg().write(faultMsg)
battery.batteryFaultInMsg.subscribeTo(faultStatusMsg)

0 comments on commit 4f179b6

Please sign in to comment.