Hello everyone,
I'm currently working on a concurrent simulation using OpenDSS parallel processing. In this setup, I have a storage system placed on two buses within the IEEE 13-bus system. My optimization code, written in MATLAB and interfacing with OpenDSS through the COM interface, assigns each storage system, circuit, and optimization code to a separate OpenDSS Actor. The simulation is then run using this approach, similar to the example format provided in the OpenDSS documentation:
My current challenge is to pause both DSS actors concurrently during the simulation at a specific time interval to perform system-wide checks/controls on voltage and storage parameters.
Ideally, I'd like to pause, conduct system-wide checks, and then resume the simulation from the last paused state. For reference, I've reviewed the training material available at
Also, is it accurate to compose the model with the IEEE test system on each actor when you want to solve simultaneous optimizations on both storage systems at different buses.
Any insights or suggestions on achieving this concurrent pause and system check functionality within the OpenDSS parallel processing framework would be greatly appreciated.
Pausing an actor does not necessarily the best way to go since, depending on the sample time and determinism of the observer (host), you may end up pausing in different parts of the simulation. However, there is an easy way. You can always use the option "number" (set number=..) to specify the number of time steps the simulation will run, this way, you can simulate each actor and stop at certain point, do your "checks" and keep going with the simulation at each actor independently.
By setting the "number" of time steps per actor, it will be waiting once the number of steps is done, no need for dedicated poling routines or processes.
Best regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My other question was
* Also, is it accurate to compose the model with the IEEE test system on each actor when you want to solve simultaneous optimizations on both storage systems at different buses as i have set it up below:
%%% the Battery storage system script for Bus A heresim_stepsize='30m';DSSText.Command='set mode=daily number=1';DSSText.Command=['set stepsize=',sim_stepsize];DSSText.Command='Set controlmode=Time';DSSText.Command='Set number=48';originalSteps=DSSObj.ActiveCircuit.Solution.Number;DSSObj.ActiveCircuit.Solution.Number=1;forstepNumber=1:originalSteps%%% My Optimization Codes Here !!DSSCircuit.Solution.SolveSnap;DSSObj.ActiveCircuit.Solution.FinishTimeStep();endendifi==2%%% the Battery storage system script for Bus B heresim_stepsize='30m';DSSText.Command='set mode=daily number=1';DSSText.Command=['set stepsize=',sim_stepsize];DSSText.Command='Set controlmode=Time';DSSText.Command='Set number=48';originalSteps=DSSObj.ActiveCircuit.Solution.Number;DSSObj.ActiveCircuit.Solution.Number=1;forstepNumber=1:originalSteps%%% My Optimization Codes Here !!DSSCircuit.Solution.SolveSnap;DSSObj.ActiveCircuit.Solution.FinishTimeStep();endend
I was wondering: What makes you think it's not accurate? Each actor is independent and can host different versions/configurations of the same or different systems. Changes can be applied to each actor independently, just be careful on activating the correct actor before applying changes. This is demonstrated in the following example:
Hello Davis
I noticed an issue during the simulation. When stopping at certain points to perform checks, the irradiance values for PV1 are being used as the starting values for PV2 at Actor 2. This happens even though PV1 and PV2 have different irradiance loadshape profiles (MyIrrad1 and MyIrrad2).
Specifically, the irradiance value at hour 1 for PV2 is taken from MyIrrad1’s hour 13 value instead of using MyIrrad2’s hour 1 value. I tried renaming the loadshapes, but the first loaded irradiance loadshape is always used.
Please I don’t know why this happen? And do I need to clear the loaded irradiance loadshape before calling Actor 2?
It feels like if you are setting the daily simulation mode for one of the actor only. Since they are independent, you need to set the simulation mode and other parameters for every actor. You can do this by using the option:
set ActiveActor = *
This will broadcast every command you send to every actor, however, be careful, after setting up the actors you need to activate actor 1 before starting a simulation. There is an example that shows how to use the * argument for the active actor to setup the simulation globally:
Hello everyone,
I'm currently working on a concurrent simulation using OpenDSS parallel processing. In this setup, I have a storage system placed on two buses within the IEEE 13-bus system. My optimization code, written in MATLAB and interfacing with OpenDSS through the COM interface, assigns each storage system, circuit, and optimization code to a separate OpenDSS Actor. The simulation is then run using this approach, similar to the example format provided in the OpenDSS documentation:
OpenDSS/Code/ [r3807]/trunk/Version8/Distrib/Examples/Parallel_Processing/MATLAB
Ideally, I'd like to pause, conduct system-wide checks, and then resume the simulation from the last paused state. For reference, I've reviewed the training material available at
https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Training/UPRM-2019/Session6.pptx. which makes use of DSS commands such as: DSSCircuit.Solution.SolveAll. and DSSParallel.Wait
Any insights or suggestions on achieving this concurrent pause and system check functionality within the OpenDSS parallel processing framework would be greatly appreciated.
Related
Commit: [r3807]
Last edit: Alexis amako 2024-09-03
Hello,
Pausing an actor does not necessarily the best way to go since, depending on the sample time and determinism of the observer (host), you may end up pausing in different parts of the simulation. However, there is an easy way. You can always use the option "number" (set number=..) to specify the number of time steps the simulation will run, this way, you can simulate each actor and stop at certain point, do your "checks" and keep going with the simulation at each actor independently.
By setting the "number" of time steps per actor, it will be waiting once the number of steps is done, no need for dedicated poling routines or processes.
Best regards,
Thanks for your prompt reply.
My other question was
* Also, is it accurate to compose the model with the IEEE test system on each actor when you want to solve simultaneous optimizations on both storage systems at different buses as i have set it up below:
DSSCircuit = DSSObj.ActiveCircuit;
DSSText.Command = 'ClearAll';
DSSText.Command = 'Set Parallel=No';
DSSParallel = DSSCircuit.Parallel;
CPUs = 2;
DSSText.Command = 'compile "C:\Users......\MasterCircuit.dss"';
DSSText.Command = 'set maxiterations=1000 maxcontroliter=1000';
DSSText.Command = ['Clone ', int2str(CPUs - 1)];
for i=1:CPUs
DSSParallel.ActiveActor=i;
if i == 1
end
DSSText.Command = 'Set Parallel=Yes';
DSSCircuit.Solution.SolveAll;
DSSParallel.Wait;
Thanks for your response
Hello,
I was wondering: What makes you think it's not accurate? Each actor is independent and can host different versions/configurations of the same or different systems. Changes can be applied to each actor independently, just be careful on activating the correct actor before applying changes. This is demonstrated in the following example:
https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Distrib/Examples/Parallel_Processing/MATLAB/Example_4/
Best regards,
Thanks for your response
Hello Davis
I noticed an issue during the simulation. When stopping at certain points to perform checks, the irradiance values for PV1 are being used as the starting values for PV2 at Actor 2. This happens even though PV1 and PV2 have different irradiance loadshape profiles (MyIrrad1 and MyIrrad2).
Specifically, the irradiance value at hour 1 for PV2 is taken from MyIrrad1’s hour 13 value instead of using MyIrrad2’s hour 1 value. I tried renaming the loadshapes, but the first loaded irradiance loadshape is always used.
Please I don’t know why this happen? And do I need to clear the loaded irradiance loadshape before calling Actor 2?
%%% Initialization codes !!
DSSText.Command = 'set mode=Daily stepsize=1h number=12 hour=0 controlmode=Time';
for ActorIdx = 1:2
DSSParallel.ActiveActor = ActorIdx;
end
DSSCircuit.Solution.SolveAll;
Hello,
It feels like if you are setting the daily simulation mode for one of the actor only. Since they are independent, you need to set the simulation mode and other parameters for every actor. You can do this by using the option:
This will broadcast every command you send to every actor, however, be careful, after setting up the actors you need to activate actor 1 before starting a simulation. There is an example that shows how to use the * argument for the active actor to setup the simulation globally:
https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Distrib/Examples/Parallel_Processing/MATLAB/Example_3/
Best regards,