If you are given the bus voltage magnitudes and angles in the mpc.bus matrix, 
you can compute the nodal complex power injections as follows …

define_constants
V = mpc.bus(:, VM) .* exp(1j*mpc.bus(:, VA)*pi/180);
Ybus = makeYbus(mpc);
Sbus = V .* conj(Ybus * V);

Hope this helps,

    Ray

> On Jan 12, 2018, at 5:50 PM, Arkan Arkan <[email protected]> wrote:
> 
> Thank you so much.
> 
> The second scenario I had talked about it is: (it is a general question but I 
> want to implement it MATPOWER):
> 
> In MATPOWER, in transmission grid, we say that changing system states 
> acquired after state estimation can lead to a change in active and reactive 
> power since estimated states are used to recalculate some parameters. Now, in 
> this case file "case33bw" which is for the distribution network, I want to 
> know if I change the obtained voltage magnitude and angle of runpf(), what 
> will happen and what parameters will be affected. How can I use MATPOWER to 
> know that?
> 
> Thanks
> 
> On Fri, Jan 12, 2018 at 1:11 PM, Ray Zimmerman <[email protected] 
> <mailto:[email protected]>> wrote:
> Power loss is an output of the power flow and optimal power flow problems, 
> not an input. If you change the inputs, the power flow solution, and 
> therefore the power loss is likely to change, and the change is defined by a 
> complex non-linear function of the inputs.
> 
>     Ray
> 
> 
>> On Jan 12, 2018, at 11:55 AM, Arkan Arkan <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Thank you, Vitor and Ray. I appreciate your help.
>> 
>> So, how can I increase and decrease power loss in MATPOWER  in case file 
>> "case33bw" which is for distribution network?
>> 
>> Thanks.
>> 
>> Kind regards,
>> Arkan
>> 
>> On Wed, Jan 10, 2018 at 7:45 AM, Ray Zimmerman <[email protected] 
>> <mailto:[email protected]>> wrote:
>> The point is that we want to keep the focus of this forum on helping users 
>> to use MATPOWER to implement their solution methodology, not on providing 
>> help with developing solution methodologies for their problems.
>> 
>> If I’ve misunderstood your questions, please feel free to describe your 
>> solution methodology and exactly where you are having trouble understanding 
>> how to implement it in MATPOWER.
>> 
>> Best regards,
>> 
>>     Ray
>> 
>> 
>>> On Jan 8, 2018, at 9:02 PM, Arkan Arkan <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Dear Ray,
>>> 
>>> Thank you. Actually, I want to simulate and do them in MATPOWER case file 
>>> in case file "case33bw".
>>> 
>>> Thank you for your consideration.
>>> 
>>> Kind regards,
>>> Arkan
>>> 
>>> On Mon, Jan 8, 2018 at 11:13 AM, Ray Zimmerman <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> I’m not sure any of these are really MATPOWER-specific questions. For more 
>>> general power systems research related questions, please find a more 
>>> appropriate forum.
>>> 
>>> If you do have MATPOWER-specific questions, please feel free to submit them 
>>> here.
>>> 
>>> Thanks,
>>> 
>>>     Ray
>>> 
>>> 
>>> 
>>> > On Jan 2, 2018, at 3:38 PM, Arkan Arkan <[email protected] 
>>> > <mailto:[email protected]>> wrote:
>>> >
>>> > Hi everyone,
>>> >
>>> > Happy new year. I want to simulate the following scenarios on 
>>> > distribution grid (case33) in MATPOWER. I would be so grateful if you 
>>> > could help me in this regard.
>>> >
>>> > 1) How can I add DGs in distribution grid to increase voltage stability? 
>>> > How can I see the effect of wrong DG placement there? I mean a DG which 
>>> > should be installed in one place to support 4 buses, is installed in a 
>>> > place that only supports 3 buses and one of the buses which should be 
>>> > supported is not supported. So I want to see the effect on voltage 
>>> > magnitude of that unsupported bus.
>>> >
>>> > 2) Where can I find load values for distribution grid to be able to have 
>>> > different runs and different outputs?
>>> >
>>> > 3) How can I change the value of power loss (increase and decrease) and 
>>> > see its effect on different parameter values like voltage magnitudes?
>>> >
>>> > 4)  When a total loss in the distribution network is decreased, the 
>>> > generation in the real world also should be decreased and adapted to that 
>>> > loss. I mean the power loss in the network and one generation of that 
>>> > network. How can I calculate the new generation value with considering 
>>> > the new loss value to be able to change in MATPOWER? (Also about increase 
>>> > of loss). Because the generation amount is a constant number in MATPOWER.
>>> >
>>> >
>>> > Thank you so much for your consideration and help.
>>> >
>>> > Kind regards,
>>> > Arkan
>>> 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

Reply via email to