You can turn off all of the printing of the power flow output by calling runpf 
with an appropriate options vector ...

opt = mpoption('OUT_ALL', 0);
r = runpf(mpc, opt);

When the script below finishes, the total annual losses will be in the variable 
total_loss. If you want to print that to the command window, please check the 
Matlab docs for fprintf or disp.

I would not put gen_profile and load_profile in the mpc struct. As long as they 
are defined somewhere before executing the code snippet I gave you it should be 
OK. You can set that up however you like. As an aside, please make sure you 
actually understand every step in the example code I proposed. Some of your 
questions make me think you are just blindly running code you don't understand. 
MATPOWER was never designed to be used in that way.

-- 
Ray Zimmerman
Senior Research Associate
419A Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645




On Mar 23, 2012, at 12:56 AM, Ruhaizad Ishak wrote:

> Dear Dr Zimmerman,
>  
> Thank you very much for your helpful advice.
>  
> I created the gen_profile and load_profile matrices in the workspace with 
> file name gen_profile and load_profile respectively.
>  
> Next I follow the code sript as given and the power flow simulation converged.
>  
> I noticed that in the command window, there were a lot of power flow data 
> (probably 52 sets).  
>  
> At which part can I get the total loss (for 52 weeks) result?
>  
> Is it necessary to include the files for gen_profile  and load_profile into 
> the mpc struct of the eg case24_ieee_rts?
>  
> Again thank you very much for your kind assistance.
>  
>  
> 
> From: Ray Zimmerman <[email protected]>
> To: MATPOWER discussion forum <[email protected]> 
> Sent: Thursday, March 22, 2012 8:39 PM
> Subject: Re: Generator Input
> 
> Here's what I would do. Create a matrix gen_profile with the generator output 
> values, where each row corresponds to a generator and each column to a week 
> of the year. You could set up another matrix load_profile with the nodal 
> loads in it, then do something like the following ...
> 
> define_constants;
> mpc = loadcase('mybasecase');
> for k = 1:52
>     mpc.bus(:, PD) = load_profile(:, k);
>     mpc.gen(:, PG) = gen_profile(:, k);
>     r = runpf(mpc);
>     loss(k) = sum(mpc.gen(:, PG)) - sum(mpc.bus(:, PD));
> end
> total_loss = sum(loss);
> 
> Hope this helps,
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> 419A Warren Hall, Cornell University, Ithaca, NY 14853
> phone: (607) 255-9645
> 
> 
> 
> 
> On Mar 22, 2012, at 4:24 AM, Ruhaizad Ishak wrote:
> 
>> Dear All,
>>  
>> First of all please forgive if the question that I wanted to ask here sounds 
>> repetitive. I am new in this community.
>>  
>> I had browsed through the archive but couldn't find any similar topic or 
>> otherwise I may missed it.
>>  
>> Although found one closely related on how to add generator but mine is a 
>> liitle bit different.
>>  
>> Using the existing generators (same number of generators) how can I change 
>> the output of each generator?
>>  
>> So far I tried the same method for changing load power demand but it doesn't 
>> work.
>>  
>> Apart from changing the output, I also plan to set an output profile for 
>> each generator for certain time frame (such as 52 weeks.)
>>  
>> For example:
>> Generator 1
>> Week 1: 20 MW
>> Week 2: 40 MW
>> Week 3: 25 MW
>>  
>> Generator 2
>> Week 1: 10 MW
>> Week 2: 25 MW
>> Week 3: 13 MW
>>  
>> Then I would like to find the total losess for the system in MWh unit.
>>  
>> Can someone guide me on this?
>>  
>> I appreciate your helpful advice and comment in advance.
>>  
>> Thank you.
>>  
>>  
>>  
>>  
> 
> 
> 

Reply via email to