The construction of the Ybus and B’ matrices have been covered in Lecture 1a and Lecture 1b. Please review these lectures. In Matpower, these functions are called makeYbus.m and makeB.m. Note that makeYbus.m uses a different algorithm than the method presented in class. Please code your functions constructYbusHWT#.m, and constructBbusHWT#.m using full matrix computations, as opposed to the sparse matrix operations used in makeYbus.m. and makeB.m. Please replace the number sign # by the number of your Homework Team.

MATPOWER provides several index functions, such as idx_bus and idx_brch whose use will make your code more readable. For example in idx_brch.m, the following indices are defined as

%% define the indices

F_BUS = 1; %% f, from bus number

T_BUS = 2; %% t, to bus number

BR_R = 3; %% r, resistance (p.u.)

BR_X = 4; %% x, reactance (p.u.)


Thus instead of extracting the column which lists all branch resistances as brch_R = mpc.branch(:,3), you can extract them as brch_R = mpc.branch(:,BR_R), which (with some insight into the power flow problem) will tell the reader of your code that are extracting the resistances. You also don’t have to memorize or check that the resistances are indeed in column 3 and not, for example, in column 4. You are thus strongly encouraged to call both index functions at the start of your functions and use these mnemonic indices instead of numbers.

For the purpose of this lab,

1) include all branches whose status is 1; in other words include all branches k where mpc.branch(k,,BR_STATUS) = 1,

2) Assume that all n buses are ordered as follows:

a) The slack bus data is listed in the first row of mpc.bus

b) The m generator (PV) buses are listed in row 2 to m+1.

c) The n-m-1 load buses are listed in rows m+2 to n, and

3) ignore the tap changing transformers, i.e. assume that the transformer ratios and angles listed in columns 9 and 10 of mpc.branch are all zero.

You are allowed to copy lines from Matpower files, as for example from makeYbus.m, provided you precede them by the following comment:

%% The following lines have been copied from Matpower 5.1 function makeYbus.m

% line 40-42:



If the number of copied lines is excessive, only partial credit will be given for the code. Plagiarism rules apply for unidentified

copied lines of code from Matpower or other sources.

Reporting Procedures

1. Upload a draft of your new Matlab files, and your result files, see below, at the end of the lab to the draft assignment

in the Lab2 folder.

2. Upload a copy of (i) your report, and (ii) your case file by the Lab 2 due date to the Lab 2 assignment in the Lab2


3. Provide a hard copy of your report, your case file(s) and your result files to the TA by the due date.


Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post matlab!!! appeared first on The Nursing TermPaper.