How to calculate the power flow for specific branch and curtail the generator accordingly
Hello guys, I have a 3 bus system with 3 generators (at bus 1 type PQ with generated power 100 MW and demand 50 MW, bus 2 Type PV solar generator with generated power maximum 50 MW and demand 50 MW, bus 3 the sluck bus) What i am trying to do is: I defined different demands (A) as shown in the code below and change the demand every minute for busses 1 and 2 and i am saving the results from the branches. mpc = loadcase('micha'); A = [10;20;30;40;50;60;70;80]; x = []; for i = 1:8 mpc.bus(1:2,3) = A(i); results = runpf(mpc); x = [x;results.branch(2,14)]; if x(i) > 80 mpc.gen(2,2) = 0; end end What i am trying to do next is to check the violation between bus 2 and 3 based on the results i am saving from the branches. I want the power flow to be equal to 80 MW or less through that branch (2 and 3). So in the code i define it above and based on the results i am getting from the branches i want to change the generated power from the solar generator. For example if generator 1 generate 100 MW and the solar generator 50 MW i have in total 150 MW if the demand changed in 10 MW each the total demand will be 20 MW and the power flow through branch 2 and 3 will be 130 MW but i don't want this i want 80 MW and i have to curtail the solar generator. So in that case i curtail the solar generator at 0 MW and run again the power flow to check if its satisfy the limits i set but i am not getting the results i want. How can i do that in programming and set the demand for different values and curtail the solar generator each time to respect the limits i want?? Thanks in advance!
Adding Wind Generation to Profiles
Currently working on adding wind generator units to my model. I am working off the 30 bus example case in MOST. I am trying to run the following code casefile = 'case30'; mpc = loadcase(casefile); xgd = loadxgendata('xgd_uc', mpc); [iwind, mpc, xgd] = addwind('wind_uc_30', mpc, xgd); profiles = getprofiles('wind_profile', iwind); profiles = getprofiles('load_profile', profiles); nt = size(profiles(1).values, 1); % number of periods %%- Full Transition Probabilities - transmat = ex_transmat(nt); mdi = loadmd(mpc, transmat, xgd, [], [], profiles); mdo = most(mdi, mpopt); if verbose ms = most_summary(mdo); end However the added generator units of which there are 7 of them in wind_uc_30 don't seem to get the profile set to them in the output. Instead only the first Generator unit gets the profile while the rest of them are set at PMAX. windprofile = struct( ... 'type', 'mpcData', ... 'table', CT_TGEN, ... 'rows', 1, ... 'col', PMAX, ... 'chgtype', CT_REL, ... 'values', [] ); windprofile.values(:, :, 1) = [ 0.80; 0.65; 0.60; 0.82; 1.00; 0.70; 0.50; 0.85; 1.00; 1.10; 1.06; 0.95; Above is a snippet from the wind_profile. I am assuming it has something to do with the row count, however, I haven't been able to find a solution. Could I please get some help. to ensure all the generator units receive the load profile. Thankyou, -- J.Sebben