So I do not need to use the add_constraints function? Because when I used
the code you mentioned and then runopf(mpc), convergence fails. In general,
how to add box constraints for Va,Vm, Pg and Qg of xr (r = runopf(mpc);
r.raw.xr).
If I have to use the add_constraints function, how do I do that?

Regards
Viswanath Hariharan

On Wed, Sep 27, 2017 at 1:39 PM, Ray Zimmerman <[email protected]> wrote:

> Voltage magnitude constraints are already included. Simply set the VMIN
> and VMAX columns in the bus matrix to the desired values.
>
> For voltage angles, simply define the A, l and u corresponding to
> equation (6.25) in the User’s Manual
> <http://www.pserc.cornell.edu/matpower/docs/MATPOWER-manual-6.0.pdf>.
> Something like the following …
>
> mpc = loadcase(<your-case-name>);
> nb = size(mpc.bus, 1);
> ng = size(mpc.gen, 1);
> mpc.A = sparse(1:nb, 1:nb, 1, nb
> <https://maps.google.com/?q=1:nb,+1,+nb&entry=gmail&source=g>, 2*nb+2*ng);
> mpc.u = 0.26 * ones(nb, 1);
> mpc.u = -mpc.l;
>
> — Ray
>
>
>
> On Sep 23, 2017, at 5:25 PM, Viswanath Hariharan <[email protected]>
> wrote:
>
> Hello Sir
>
> I want to add voltage magnitude and voltage angle constraints to the
> opf solver but I am not able to figure out how to.
>
> Voltage magnitude constraints --->  0.9 <= Vm <= 1.1
> Voltage angle constraints ---> - 0.26 <= Va <= 0.26 (Unrelaxed form)
>
> I read a post where you mentioned to add these constraints to the case
> struct which looked pretty simple in the post but I didn't know how to add
> that to the case struct.
> I was wondering if you can guide me on how to do it. Hoping to hear from
> you soon.
>
> Regards
> Viswanath Hariharan
> Graduate Research Assistant
> Electrical Engineering
> University at Buffalo
>
>
>

Reply via email to