How to add generators to different buses in MATPOWER and see the PF results?

12 ビュー (過去 30 日間)
Iman
Iman 2011 年 11 月 17 日
コメント済み: VIKASH KUMAR VERMA 2023 年 5 月 20 日
I have a quick question about MATPOWER.
From MATPOWER documentation we know if we want to load the 30-bus system data from case30.m, increase its real power demand at bus 2 to 30 MW, then run an AC optimal power flow with default options, this could be accomplished as follows:
>> define_constants;
>> mpc = loadcase('case30');
>> mpc.bus(2, PD) = 30;
>> runopf(mpc);
Now I have a generator and I want to connect it to bus n each time and see how the result of power flow would change.To begin with I add a 10MW generator to bus 7 and run pf for 14 bus system so I write:
>> define_constants;
>> mpc = loadcase('case14');
>> mpc.gen (7, PG) = 10; //add 10MW to bus 7
>>mpc.bus (7, BUS_TYPE) = 2; // changes the type of bus 7 to PV
>> runpf(mpc);
but I recieve this error:
??? Subscript indices must either be real positive integers or logicals.
Error in ==> ext2int at 230
gs = ( mpc.gen(:, GEN_STATUS) > 0 & ... %%gen status
Error in ==> runpf at 131
mpc = ext2int(mpc);
Do u know what is wrong with my code?
Thanks
  3 件のコメント
Basti
Basti 2017 年 5 月 2 日
編集済み: Basti 2017 年 5 月 2 日
Mokryani? :D You have define at which bus you want the new generator. At the moment it is bus 0.
define_constants;
mpc = loadcase('case30');
mpc.gen (7, PG) = 50;
mpc.gen (7, GEN_BUS) = 7;
mpc.bus (14, BUS_TYPE) = 2;
runpf(mpc);
VIKASH KUMAR VERMA
VIKASH KUMAR VERMA 2023 年 5 月 20 日
What would be the code if I want to connect connect 4 generators at bus 18, 22, 25 and 33 in sequential order for 24 hours load profile.

サインインしてコメントする。

回答 (1 件)

Md. Jillur Rahman
Md. Jillur Rahman 2019 年 12 月 14 日
編集済み: Md. Jillur Rahman 2019 年 12 月 14 日
Since there is only 5 generators in this system this program below will run smoothly but if you want to add a geneator at bus 7 you have to manually change the m file by adding corresponding data in mpc.gen section.
define_constants;
mpc = loadcase('case14');
mpc.gen (4, PG) = 10;
mpc.bus (6, BUS_TYPE) = 2;
runpf(mpc);

カテゴリ

Help Center および File ExchangeModel Predictive Control Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by