Hi Stephen,

Is it not the case that in your original 4-period problem, the are an infinite 
number of optimal solutions with exactly the same cost? Specifically, when the 
35 MW of InitialStorage are used has no impact on the cost, correct? If that is 
the case, there is no unique optimal solution to the first problem, and I 
believe also for the redispatch problem as well. So there is no reason a 
numerical algorithm should terminate with a particular one.

To make the solution unique, and therefore replicable, you probably want to 
either vary the cost of the traditional generator across time or make it 
quadratic or something.

    Ray


> On Oct 13, 2017, at 12:01 PM, Stephen Suffian <stephen.suff...@gmail.com> 
> wrote:
> 
> Hey everyone,
> 
> I have a question regarding how storage is calculated for each time step 
> during an economic dispatch run. I am attempting to simulate a 24-hour 
> economic dispatch followed by hourly re-dispatch of units with an updated 
> load forecast. With an identical forecast, I would assume that the redispatch 
> would be identical to the initial dispatch. This is in fact the case with the 
> normal generators (generators in mpc) and also any wind generators that are 
> added. 
> 
> However, when I add hydro (as energy-limiting storage units), it seems to 
> shift around which time periods are using different levels of storage power 
> during the re-dispatch, despite all other conditions being identical. This is 
> problematic, because I calculate an added operational cost to the grid 
> between the initial dispatch and the redispatch, despite the same load being 
> met.
> 
> The following is a simple example with a single generator, a single storage 
> unit, a flat load, running on a no-bus network, with no terminal targets. To 
> reiterate, I ideally would want the levels of power dispatched from storage 
> to be identical between the initial 4-hour dispatch and each subsequent 
> re-dispatch, but that doesn't seem to be the case below. 
> 
> Any help understanding better how the storage outputs are calculated, or 
> whether I am doing something wrong in this code or otherwise, would be 
> greatly appreciated.
> 
> Thanks!
> Stephen Suffian
> 
> define_constants
> this_load_profile.values = [125; 125; 125; 125];
> nt = size(this_load_profile.values,1);
> 
> warning('off','all')
> mpopt = mpoption('verbose', 0);
> mpopt = mpoption(mpopt, 'most.dc_model', 0);    % use model with no network
> mpopt = mpoption(mpopt, 'most.storage.cyclic', 0);
> mpopt = mpoption(mpopt, 'most.storage.terminal_target',0);
> 
> mpc_orig.version = '2';
> mpc_orig.baseMVA = 100;
> mpc_orig.bus = [ 1    3    0    0    0    0    1    1    0    135    1    
> 1.05    0.95;];
> mpc_orig.gen = [
>     1    125    0    25    -25    1    100    1    200    0    0    0    0    
> 0    0    0    0    250    600    0    0;
>     1    -200    0    0    0    1    100    1    0    -600    0    0    0    
> 0    0    0    0    500    500    0    0;
> ];
> mpc_orig.branch = [];
> mpc_orig.gencost = [
>     2    0    0    3    0   1  0;
>     2    0    0    3    0    100    0;
> ];
> xgd_table.colnames = {};
> xgd_table.data = [];
> 
> %Storage
> storage.gen=[ 1    0    0    0    0    1    100    1    15    0 0    0    0   
>  0    0    0    0    15    15    0    0];
> storage.xgd_table.colnames = {};
> storage.xgd_table.data = [];
> storage.sd_table.colnames = {
>     'InitialStorage', ...
>         'InitialStorageLowerBound', ...
>             'InitialStorageUpperBound', ...
>                 'InitialStorageCost', ...
>                     'TerminalStoragePrice', ...
>                         'MinStorageLevel', ...
>                             'MaxStorageLevel', ...
>                                 'OutEff', ...
>                                     'InEff', ...
>                                         'LossFactor', ...
>                                             'rho', ...
>                                                 
> 'ExpectedTerminalStorageMin',...
>                                                 
> 'ExpectedTerminalStorageMax',...
> };
> storage.sd_table.data=[35    35    35    0    0    0    35    1    1    0    
> 0  0 0];
> 
> for index = 1: 2
>     mpc = mpc_orig;
>     xgd = loadxgendata(xgd_table, mpc_orig);
>     profiles = getprofiles(this_load_profile);
>     profiles(1).values=profiles(1).values(index:end);
>     [iess, mpc, xgd, sd] = addstorage(storage, mpc, xgd);
>     remaining_nt = nt-index+1;
>     mdi = loadmd(mpc, remaining_nt, xgd, sd, [], profiles);
>     mdo_re = most(mdi, mpopt);
>     mdo_re.results.ExpectedDispatch
> end
> 
> 
> %%OUTPUT (The third row should be identical (so if the first ans is [0 15 15 
> 5], the second should be [15 15 5], as it is the re-dispatch at time t=2.
> 
> ans =
> 
>   125.0000  110.0000  110.0000  120.0000
>  -125.0000 -125.0000 -125.0000 -125.0000
>          0   15.0000   15.0000    5.0000
> 
> 
> ans =
> 
>   120.0000  110.0000  110.0000
>  -125.0000 -125.0000 -125.0000
>     5.0000   15.0000   15.0000

Reply via email to