optimal power flow by using pso

2 contribuyentes han marcado con alerta este/a pregunta
  • Marcado con alerta como No es adecuada para MATLAB Answers por Rik hace el 26 de Sept. de 2021.

    This is not attracting any useful interactions. I vote for deleting the entire thread, but I would prefer consensus on that decision. To prevent further 'send me the code' posts I'm closing the question.

  • Marcado con alerta como Poco clara por Walter Roberson hace el 26 de Sept. de 2021.

    years of send-it-to-me should be cleaned up

hi this is my program . but i want to change my program for power flow .i want to compare ieee 30 bus result ,from newton raphson method
please help me ......
i am waiting your result....
clc;
clear all;
close all;
ipf=fopen('opres75n.in','r');
opf=fopen('opres75.out','w+');
%reading data
no_part=fscanf(ipf,'%f',1);
no_var=fscanf(ipf,'%f',1);
no_units=fscanf(ipf,'%f',1);
itermax=fscanf(ipf,'%f',1);
temp=fscanf(ipf,'%f',[5,no_units]);
temp=temp';
c=temp(:,1);
b=temp(:,2);
a=temp(:,3);
pmin=temp(:,5);
pmax=temp(:,4);
bng=fscanf(ipf,'%f',no_var);
pg=fscanf(ipf,'%f',no_units);
pbest=zeros(no_part,1);
gbest=0;
part_v=zeros(no_part,no_var);
wmin=0.4; wmax=0.9;
c1=2; c2=2;
vmax=(pmax-pmin)/50;
% Random Generation of particles
% for i=1:no_part
% for j=1:no_var
% ng=bng(j);
% part(i,j)=pmin(ng)+(pmax(ng)-pmin(ng))*rand-pg(ng);
% end
% end
i=1;
while i~=no_part+1
for j=1:no_var
ng=bng(j);
part(i,j)=pmin(ng)+(pmax(ng)-pmin(ng))*rand-pg(ng);
end
sum_part=sum(part(i,:));
i=i+1;
if abs(sum_part)>=0.1
i=i-1;
end
if i==0
i=1;
end
end
for iter=1:itermax
i=1;
tic;
while i~=no_part+1
sum_part=sum(part(i,:));
if abs(sum_part)>=0.1
for j=1:no_var
ng=bng(j);
part(i,j)=pmin(ng)+(pmax(ng)-pmin(ng))*rand-pg(ng);
end
i=i-1;
else
i=i+1;
end
if i==0
i=1;
end
end
% Binding Fitness calculation
bf=zeros(no_part,no_var);
dpmin=pg-pmin;
dpmax=pmax-pg;
i=1;
while i~=no_part+1
for j=1:no_var
ng=bng(j);
if part(i,j)<dpmin(ng)
bf(i,j)=dpmin(ng)-part(i,j);
end
if part(i,j)>dpmax(ng)
bf(i,j)=part(i,j)-dpmax(ng);
end
end
k=0;
for j=1:no_var
if bf(i,j)==0
part(i,j)=pmin(ng)+(pmax(ng)-pmin(ng))*rand-pg(ng);
k=1;
end
end
if k==1
i=i-1;
end
i=i+1;
end
% Optimal Fitness Calculation
cost=zeros(no_part,1);
for i=1:no_part
for j=1:no_var
ng=bng(j);
cost(i)=cost(i)+(a(ng)+b(ng)*part(i,j)+c(ng)*part(i,j)*part(i,j))*part(i,j);
end
end
% PBEST
if iter==1
pbest=cost;
part_pb=part;
else
for i=1:no_part
if pbest(i)>cost(i)
pbest(i)=cost(i);
part_pb(i,:)=part(i,:);
end
end
end
%GBEST
gbest=min(pbest);
for i=1:no_part
if gbest==cost(i)
part_gb=part(i,:);
end
end
% Velocity
w=wmax-((wmax-wmin)/itermax)*iter;
for i=1:no_part
for j=1:no_var
ng=bng(j);
part_v(i,j)=w*part_v(i,j)+c1*rand*(part_pb(i,j)-part(i,j))+c2*rand*(part_gb(j)-part(i,j));
if part_v(i,j)>vmax(ng)
part_v(i,j)=vmax(ng);
end
if part_v(i,j)<-vmax(ng)
part_v(i,j)=-vmax(ng);
end
end
end
% Position Update
for i=1:no_part
for j=1:no_var
ng=bng(j);
part(i,j)=part(i,j)+part_v(i,j);
if part(i,j)>dpmax(ng)
part(i,j)=dpmax(ng);
end
if part(i,j)<dpmin(ng)
part(i,j)=dpmin(ng);
end
end
end
time(iter)=toc;
fitmin(iter)=min(cost);
costa(iter)=mean(cost);
iter
% max(max(bf))
% min(min(bf))
end
subplot(2,1,1);
plot(1:iter,costa);
xlabel('Iterations');
ylabel('Cost');
subplot(2,1,2);
plot(1:iter,time);
xlabel('Iterations');
ylabel('Time');
for j=1:no_var
for k=1:no_units
ng=bng(j);
if ng==k
pg(ng)=pg(ng)+part_gb(j);
if pg(ng)<pmin(ng)
pg(ng)=pmin(ng);
end
if pg(ng)>pmax(ng)
pg(ng)=pmax(ng);
end
end
end
end
fc=0;
for k=1:no_units
fc=fc+a(k)+b(k)*pg(k)+c(k)*pg(k)*pg(k);
end
s=0;
for i=1:6
s=s+pg(i);
end

7 comentarios

Walter Roberson
Walter Roberson el 3 de Jun. de 2012
You did not ask a question. You presented code (that appears to implement Particle Swarm) and you indicated a general desire ("I want to change my program for power flow"), but you did not ask a question. Please be clearer as to what you are asking.
Walter Roberson
Walter Roberson el 3 de Jun. de 2012
Editada: Walter Roberson el 4 de En. de 2021
Chirag Tanti
Chirag Tanti el 11 de Feb. de 2015
Dear sir, I want to the PSO code for optimal location of STATCOM in IEEE30 bus system
Stephen Ndubuisi
Stephen Ndubuisi el 6 de Oct. de 2017
Pls, I need a matlab code I can use to simulate the transmission loss equation using PSO. How can I apply the constraints to the PSO programming Syntex
Akhil Madarapu
Akhil Madarapu el 3 de Abr. de 2018
Hi Manoj sir, You had given a code for optimal power flow by using pso & I tried a lot to execute it in Matlab but it always shows an error... could u help me please
Muhammad Rizaldy
Muhammad Rizaldy el 17 de Mayo de 2020
Where is your data input sir?
Mehmet Cumali Köylü
Mehmet Cumali Köylü el 4 de En. de 2021
Dear sir, I want to the PSO code for optimal location of STATCOM in IEEE30 bus system

Respuestas (6)

MANOJ MAHAJAN
MANOJ MAHAJAN el 3 de Jun. de 2012

0 votos

sir, i apply this program for economic load dispatch ,it is run but the problem is that i want result for power flow on bus and real power loss for different ieee bus

1 comentario

Walter Roberson
Walter Roberson el 3 de Jun. de 2012
This is a statement:
"I found instructions for trimming the edge of my garden with electric clippers.I want to cut my lawn with an gasoline lawnmower."
And *this* is a question:
"How far out should I pull the choke when I am starting a Banana Junior 9000 gasoline lawnmower?"
MANOJ MAHAJAN
MANOJ MAHAJAN el 7 de Jun. de 2012

0 votos

sir ,there is any tool box to solve the problem of optimal power flow by using pso like a economic load dispatch
kishan bhayani
kishan bhayani el 4 de Mzo. de 2013

0 votos

have you get your answer of economic load dispatch of ieee 30 bus system using pso by using above program????
Stephen Ndubuisi
Stephen Ndubuisi el 6 de Oct. de 2017

0 votos

Sir pls I need a MATLAB code that will help me minimise transmission loss using PSO.

4 comentarios

Walter Roberson
Walter Roberson el 6 de Oct. de 2017
Look in the File Exchange to see what is available. If you do not see what you need there, then you will have to write the code yourself (or hire someone to write it.)
Akhil Madarapu
Akhil Madarapu el 3 de Abr. de 2018
Sir please could you give me the code for " transmission loss minimization using PSO" It's my Btech final year project & I have to submit the code and execute it within 2 days. Help me please........
mohammed hamouda
mohammed hamouda el 26 de Jun. de 2019
please sir
if you finished your project can you send me the code in my email
eng_mohammedhamouda@azhar.edu.eg
TEBBAKH NOUR
TEBBAKH NOUR el 26 de Sept. de 2021
hello please if you have got this code send it to me
nouropport2010@yahoo.com
Nandhini Sankar
Nandhini Sankar el 14 de En. de 2018

0 votos

sir please i need a MATLAB code that will help me Rician noise removal method using PSO
mohammed hamouda
mohammed hamouda el 26 de Jun. de 2019

0 votos

pleas sir
i nead code for optimal planning to penetrate of renewable resource in electrical network (sizing & type) dealing with reliability?

1 comentario

TEBBAKH NOUR
TEBBAKH NOUR el 26 de Sept. de 2021
Hello sir please if you have got this code send it to me
nouropport2010@yahoo.comù

La pregunta está cerrada.

Preguntada:

el 3 de Jun. de 2012

Cerrada:

Rik
el 26 de Sept. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by