Thank you for your quick answer! With your help I managed to do what I
wanted to...


Best regards,

Daniel Dias

On Wed, Jun 10, 2009 at 6:12 PM, Ray Zimmerman <[email protected]> wrote:

> You want to load the case into a struct first, then you can modify the
> appropriate value before you call the power flow. Something like this ...
>
> [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...
>    VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] =
> idx_bus;
> mpc = loadcase('mycase');
> % initialize V, X and Y
> while some_condition_on_V
>    % update X and Y
>    mpc.bus(some_bus, [PD QD]) = [X Y];
>    [baseMVA, bus, gen, branch, success, et] = runpf(mpc);
>    V = bus(some_bus, VM);
> end
>
> --
> Ray Zimmerman
> Senior Research Associate
> 428-B Phillips Hall, Cornell University, Ithaca, NY 14853
> phone: (607) 255-9645
>
>
>
> On Jun 10, 2009, at 11:39 AM, Daniel Dias wrote:
>
> Hello! I am a student from Portugal, and I have a doubt related to
>> MATPOWER.
>>
>> I need to define two external constants (X and Y) and run a power flow
>> using them as "Pd" [bus(:,3)] and "Qd" [bus(:,4)] (real and reactive power
>> demand) of a certain bus. My objective is to make a "while" cycle to run
>> power flows while the constants X and Y are changing, till I get a specific
>> value for the voltage in that bus.
>>
>> Can someone help me? My problem is that I don't know how I can insert
>> external constants into MATPOWER...
>>
>>
>> Best regards,
>>
>> Daniel Dias
>>
>
>
>

Reply via email to