It’s not clear to me what the problem is from what you’ve shown here. I notice
the line number of the error does not seem to match my version of int2ext.m
from MATPOWER 5.1. Are you using the latest released MATPOWER? I think there
may have been some fixes related to isolated nodes in 5.1.
Also, does it run without error if you comment out the line where you add the
additional constraints?
Ray
> On Dec 7, 2015, at 12:15 PM, Schilling, Samuel
> <[email protected]> wrote:
>
> Dear MATPOWER team,
>
> I managed to modify an OPF in a meshed AC/DC grid by adding a linear
> constraint after setup_opf and add_constraint. The grid contains AC and DC
> lines as well as isolated nodes. However I get an error due to dimensional
> problems when I want to convert the data back to external numbering. The
> error occurs because of the isolated nodes. If I am not using them, the code
> works. Can you help me?
>
> Thank you very much.
>
> mpc = loadcase('testcase‘);
> mpc = toggle_dcline(mpc, 'on');
> mpc=ext2int(mpc);
> om=opf_setup(mpc, mpopt);
> om=add_constraints(om, 'PDC', A_Pg_DC, l, u, {'Pg'});
> [results, success, raw]=opf_execute(om, mpopt);
>
> results=int2ext(results); %%this causes the error
>
> ??? Error using ==> horzcat
> CAT arguments dimensions are not consistent.
>
> Error in ==> int2ext at 108
> mpc.bus = [mpc.bus zeros(nr,
> nc-size(mpc.bus,2))];
>
> Error in ==> Optimierung at 104
> results=int2ext(results);
>
> Kind regards
> Samuel Schilling