runpf error - Unrecognized function or variable 'runpf'.
28 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
k heindl
el 7 de Abr. de 2021
Respondida: Kamilu Sanusi
el 16 de Ag. de 2022
When I runpf I get Unrecognized function or variable 'runpf'.
>> case5
ans =
struct with fields:
version: '2'
baseMVA: 100
bus: [5×13 double]
gen: [5×21 double]
branch: [6×13 double]
gencost: [5×6 double]
>> result = runpf('case5')
Unrecognized function or variable 'runpf'.
Did you mean:
>> result = run('case5')
1 comentario
AquilesC
el 2 de Jul. de 2021
Maybe you need to install the matpower script. Find “insta_matpower.m” function script in the folder where the application you have kept, and you shall be to apply "Run: install_matpower". Next, you’ll see a matpower installation options menu, and you shall have to select “do modify the MATLAB patch, but only temporarily” and go with the installation process.
Now you will be able to run the operators: (runpf (‘case…’) and runopf (‘case…’) in the command window.
Respuesta aceptada
Monisha Nalluru
el 22 de Abr. de 2021
From my understanding there is no built function in MATLAB called runpf.
If runpf is a user defined function, when you can calling the function make sure the function is either in MATLAB path or defined in current directory.
0 comentarios
Más respuestas (1)
Kamilu Sanusi
el 16 de Ag. de 2022
Sir, I am trying to carryout a load flow analysis on a given island grid, but i am also having similar problem in line 68 (runpf), pls kindly assist me with the possible solution
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Ndleitung, Bus, Netzbase] = Netzdaten(x)
Name='zwei_G.xlsx';
Ndleitung=xlsread(Name,1);
Bus=xlsread(Name,2);
Netzbase=xlsread(Name,3);
x=Bus(1,3);
% Generator=xlsread(Name,4);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ndleitung =
1.0000 2.0000 0.5000 0.6500
Bus =
1.0000 2.0000 1.5000 0 1.0000
2.0000 3.0000 0 0 1.0000
Netzbase =
1
1
x =
1.5000
ans =
1.0000 2.0000 0.5000 0.6500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Pf]=Powerflow
[Ndleitung, MeaBus, base] = Netzdaten;
Ki=0;
Ktyp=0;
% bus data
% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
PL=0;
QL=0;
One_bus=[Ki Ktyp PL QL 0 0 1 1 0 1 1 1.1 0.9];
% KL_bus=[nL 1 PL QL 0 0 1 1 0 1 1 1.1 0.9];
% KG_bus=[nG 2 0 0 0 0 1 1 0 1 1 1.1 0.9];
% generator data
% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max Qc2min Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf
VG=0;
PG=0;
One_gen=[Ki PG 0 100 -100 VG 1 1 318 0 0 0 0 0 0 0 0 0 0 0 0];
% KG_gen=[nG PG 0 100 -100 VG 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0];
% branch data
% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax
nf=0;
nt=0;
R=0;
X=0;
Lij=[0 0 0 0 0 250 250 250 0 0 1 -360 360;];
nK=size(MeaBus,1);
NETZ.bus=[];
NETZ.gen=[];
for i=1:nK
if MeaBus(i,2)==1 %PQ-Knoten
Tans=One_bus; %zwischenwert
Tans(:,1:4)=MeaBus(i,1:4);
NETZ.bus=[NETZ.bus;Tans];
else
Tans=One_bus;
Tans(:,1:2)=MeaBus(i,1:2);
NETZ.bus=[NETZ.bus;Tans];
Tans=One_gen;
Tans(:,1)=MeaBus(i,1);
Tans(:,2)=MeaBus(i,3);
Tans(:,6)=MeaBus(i,5);
NETZ.gen=[NETZ.gen;Tans];
end
end
nL=size(Ndleitung,1);
NETZ.branch=[];
for i=1:nL
NETZ.branch=[NETZ.branch;Lij];
end
NETZ.branch(:,1:4)=Ndleitung;
NETZ.version = '2';
NETZ.baseMVA = 1;
NETZ.bus(:,3:4)=NETZ.bus(:,3:4)./base(2);
NETZ.gen(:,2)=NETZ.gen(:,2)./base(2);
NETZ.gen(:,6)=NETZ.gen(:,6)./base(1);
resultPF = runpf(NETZ);
j=1;
for i=1:nK
Vout(i)=resultPF.bus(i,8)*cosd(resultPF.bus(i,9))+1j*resultPF.bus(i,8)*sind(resultPF.bus(i,9));
if MeaBus(i,2)==1 %PQ-Knoten
Sout(i)=-resultPF.bus(i,3)-1j*resultPF.bus(i,4);
else
Sout(i)=resultPF.gen(j,2)+1j*resultPF.gen(j,3);
j=j+1;
end
end
Iout=(Sout./Vout)';
Pf.V=Vout;
Pf.I=Iout;
Pf.S=Sout;
0 comentarios
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!