Hi Marc,
Defining a new variable (if you don’t want to load the same case data multiple
times) could help you fix the problem easily. Below is an example that may help
you.
mpc = loadcase('case6ww'); % load the raw data;
for i = 1 : 5
data = mpc; % duplicate the raw data;
data.bus(:, 3) = data.bus(:, 3) / i; % do your modification;
results = runpf(data); % run the modified data;
end
Best regards,
Gang
From: [email protected]
[mailto:[email protected]] On Behalf Of Marc Gebhardt
Sent: Monday, June 13, 2016 8:49 AM
To: [email protected]
Subject: Overwriting specific in loop data before running runpf
Hi,
if i could minimize my problem in an easier case:
i specified my knots and branches in a case file of my matpower direction.
now i want to show the influence of varying one parameter of the branches.
for example the resistance of one line influences the losses.
so i bulit a for-loop, which should overwrite the input of the runpf
calculation.
how can i adress the workspace without changing the case-file every time?
my solution (lower in the text) doesn't work, cause it calculates every time
with the given value in the case-file.
clear all;
%loading of the given topology
run case_123.m;
%setting the steps
n=5;
stepsize=0.5;
%loop for the steps
for i=1:n;
%calc the new resistance
resis=-(n+1)/2*stepsize+stepsize*(i);
%write it in the case (!!!!!!!!!!!!!!!!!!!!! and this is wrong)
ans.branch(2,3)=resis;
%doing the powerflowcalc
mpRes=runpf('case_pst1');
%output of the wanted values...
output(i,1)=resis;
output(i,2)=mpRes.branch(1,16);
end
how can i change the single value in a case with a loop for comparing the
results?
thank you
marc