You say "MATPOWER dont accept” but we will need to see the actual error message in order to help. Also, if it is a one-time change you are making to a case file, it makes sense to duplicate the file and give the duplicate a new name, then make your changes to the case directly in the new case file.
Ray > On Sep 10, 2018, at 9:33 AM, amir ali Hosseini <tpmhosse...@gmail.com> wrote: > > my subject study is : > Distributed generation planning .and use TLBO , PSO algorithm for answers > Optimization . > ok ! > so tow variables 1- where must be generation on the buses( place of > generator) > 2- how many product energy (capacity of generator) > I have tow scope 1- the network parameters be better than last. > 2-The who's have power plane ( DG ,PV, Wind, etc ) have Max benefit > so I do this > I study TLBO and PSO .then give ones exercise of them. > > In the MATPOWER ues > > The create M-file flow the below > > clc; > clear all; > %% identify system > mpc = loadcase('case9');% load case9 in the mpc > sizbus = size(mpc.bus); > numbus =sizbus(1,1); %get number fo buses > [idx] = (1:9)';% make index for branch > %% get information of system > % for i=1:1:numbus > % > % end > results = runuopf(mpc); %optimization power flow > [Ploss] = real(get_losses(results));%sperate losses active > indPloss = [idx Ploss];% the matrix that it has index colume and active losses > [maxploss,idx1] = max(Ploss);% maximon loss active power with index > Qloss = imag(get_losses(results));%sperate losses diactive > indQloss = [idx Qloss];%the matrix that it has index colume and deactive > losses > [maxqloss,idx2] = max(Qloss);%maximon loss deactive power with index > %% chenge system > mpc.gen(4,:) = [4,5,0,5,-5,1,7,1,7,0.5,0,0,0,0,0,0,0,0,0,0,0]% add generator > mpc.gencost(4,:) = [2,300,0,3,0.122500000000000,1,335]% add generator cost > mpc.bus(4,2) = 2; % change bus type > %% get results twovice > results2 = runuopf(mpc); > be change and power plow after the it . but why when change number 4 to 5 for > genrator 5(th) . MATPOWER dont accept !