Hi
I'm trying to implement an OPF in Matlab using the COM interface including batteries in order to minimize the production cost of conventional generators. As a first step, it will be useful to send a command to the storage element to charge/discharge an specific amout of energy/power. So far, I have only found examples given in the OpenDSS Manual where the storage device is fully charged or discharged.
I've searching and testing in Matlab some possible useful options to get parameters of the storage device as mentioned in the OpenDSS STORAGE Element document such as:

El_Name = DSSCircuit.ActiveElement.Name
command = '? Storage.Battery.Model'
DSSText.Command = command
energyStored2 = str2num(DSSText.Result)

It is clear for me how to set the charge/discharge/idiling modes by either using loadshape arrays or manually, however I haven't figured out how to tell the storage device to charge/discharge an specific amout of energy/power without modifying the storage capacity.

On the other hand, the StorageController Element allows external control which may be used to modify the states of the device, but again no way to set the specific amount of charge/discharge power is mentioned.

Could you help me with this issue please?
I'll apreciate any help.
Thank you very much