Thanks João. Sorry I haven’t responded to your earlier e-mail about this issue. 
I’ve been swamped with other deadlines and haven’t yet had a chance to take a 
look at this. Just wanted to let you know that I have taken note of this and 
will be sure to check it out and incorporate any fix as soon as I get the time.

Thanks for providing a clear explanation and the files needed to reproduce the 
problem.

   Ray



> On Jul 31, 2015, at 5:31 AM, João Gorenstein Dedecca <[email protected]> 
> wrote:
> 
> Dear all,
> After reviewing the code I believe this is caused by the sparse matrix 
> creation command for the Bf matrix.
> In the case in question the Bf matrix must have an empty last row. But since 
> no element of this row is provided to the sparse command it creates a Bf 
> matrix with a missing row.
> This can be fixed by changing the line in makeBdc.m from:
> 
> Bf = sparse(i, [f; t], [b; -b]);    % = spdiags(b, 0, nl, nl) * Cft;
> 
> to
> 
> Bf = sparse(i, [f; t], [b; -b], nl, nb);    % = spdiags(b, 0, nl, nl) * Cft;
> 
> Best regards,
> 
> João Gorenstein Dedecca
> 
> On Fri, Jul 31, 2015 at 9:07 AM, João Gorenstein Dedecca <[email protected] 
> <mailto:[email protected]>> wrote:
> Dear Matpower community,
> For a DCOPF with a dc line a simple change in the bus order causes an error 
> in matpower 5.1.
> Attached are the .m files for a 4-bus system with 2 x AC and 1 x DC lines.
> Presenting the DC bus in the branch matrix before last results in the error 
> below.
> 
> 
> Error using opt_model/add_constraints (line 170)
> @opt_model/add_constraints: number of columns of A does not match
> number of variables, A is 4 x 6, nv = 7
> 
> Error in opf_setup (line 212)
>   om = add_constraints(om, 'Pmis', Amis, bmis, bmis, {'Va', 'Pg'}); %% nb
> 
> 
> Has anyone faced this before?
> Thanks,
> 
> João Gorenstein Dedecca
> 

Reply via email to