To design and analyze the load frequency control of two area system using optimal integral controller using MATLAB/Simulink.

Experiment No. : -10

Aim of the Experiment: –

To design and analyze the load frequency control of two area system using optimal integral controller using MATLAB/Simulink.

Abstract: –

Apparatus Required:-

Simulation Model: –

PID 1
PID 2
Subsystem
Control Area 1Control Area 2
R1 = 0.05R2 =0.0625
D1 = 0.6D2 = 0.9
H1 = 5.5H2 = 5
Tg1 = 0.25Tg2 = 0.3
Ttr1 = 0.5Ttr2 = 0.6

Save this code to pso.m file

clc

clear all

xmin=0*[-1,-1,0,0,0,0]’;

xmax=1*[2,2,2,2,2,2]’;

vmin=-0.1*(xmax-xmin);

vmax=-1*vmin;

c1=2;

c2=2;

w=0.8;

n=10;

dim=6;

maxiter=20;

for i=1:n

x(:,i)=xmin+rand(dim,1).*(xmax-xmin);

v(:,i)=vmin+rand(dim,1).*(vmax-vmin);

xf(i)=vp(x(:,i));

end

[lbestf,index]=min(xf);

lbest=x(:,index);

gbest=lbest;

for iter=1:maxiter

for i=1:n

v(:,i)=w*v(:,i)+c1*rand(dim,1).*(lbest-x(:,i))+c2*rand(dim,1).*(gbest-x(:,i));

for j=1:dim

if v(j,i)<vmin(j)

v(j,i)=vmin(j);

elseif v(j,i)>vmax(j)

v(j,i)=vmax(j);

end

end

x(:,i)=x(:,i)+v(:,i);

for j=1:dim

if x(j,i)<xmin(j)

x(j,i)=xmin(j);

elseif x(j,i)>xmax(j)

x(j,i)=xmax(j);

end

end

xf(i)=vp(x(:,i));

end

[pbestf(iter),index]=min(xf);

pbest(:,iter)=x(:,index);

lbest=pbest(:,iter);

[gbestf,index]=min(pbestf);

gbest=pbest(:,index);

end

vp(gbest);

Save this code as vp.m file

function f = vp(p);

assignin(‘base’,’Kp1′,p(1));

assignin(‘base’,’Kd1′,p(2));

assignin(‘base’,’Ki1′,p(3));

assignin(‘base’,’Kp2′,p(4));

assignin(‘base’,’Kd2′,p(5));

assignin(‘base’,’Ki2′,p(6));

sim(‘PID_pso’)

f=sum(itse);

end

Theory: –

Result: –

Conclusion: –

To be written by student.