Your gen and gencost matrices have 153 rows each, but mpc.reserves.zones has 
only 55 elements. It runs fine with the following modification in ex_case118.m.

mpc.reserves.zones = [ones(1,54) zeros(1,99)];

— Ray


> On Apr 6, 2017, at 9:05 AM, Ammar Raza <[email protected]> wrote:
> 
> Hi every one,
> 
> 
> I am working on most dcopf of 118 bus system but I am getting this error. 
> I attached my code with this email.
> Can you please specified my why I am getting this error?
> 
> Thank you,
> 
> Kind Regard
> 
> Mohammad Ammar Raza
> 
> 
> 
> Index exceeds matrix dimensions.
> 
> Error in get_reorder (line 29)
> B = subsref(A, s);
> 
> Error in e2i_data (line 68)
>     newval = get_reorder(val, idx, dim);
> 
> Error in e2i_field (line 60)
>         e2i_data(mpc, subsref(mpc, s), ordering, dim) );
> 
> Error in toggle_reserves>userfcn_reserves_ext2int (line 135)
> mpc = e2i_field(mpc, {'reserves', 'zones'}, 'gen', 2);
> 
> Error in run_userfcn (line 37)
>                 rv = feval(userfcn.(stage)(k).fcn, rv, args);
> 
> Error in ext2int (line 211)
>                 mpc = run_userfcn(mpc.userfcn, 'ext2int', mpc);
> 
> Error in opf (line 195)
> mpc = ext2int(mpc);
> 
> Error in runopf (line 75)
> [r, success] = opf(casedata, mpopt);
> 
> Error in runopf_w_res (line 58)
> [varargout{1:nargout}] = runopf(mpc, varargin{2:nargin});
> 
> Error in most_ammar2 (line 39)
> r1 = runopf_w_res(mpc, mpopt);
> Kind Regard,
> 
> Mohammad Ammar Raza
> 
> 
> 
> <most_ammar2.m><ex_case118.m>

Reply via email to