Assignment on Swing Equation using MATLAB
Course Instructor: Prof. Dr. A. H. M. Abdur Rahim
Student Name: Ahmed Mahad Mohamed
Student ID: 21371010
Course Title: Power System Stability
Answer No.1
The task of this question was to investigate the steady state limit by using the following giving.
Xd= 0.3j, Xt=0.1j, xl=0.1j, xl=0.05j, P(real power)= 0.5pu, Q(reactive power)=.2 Pu, V=1 pu
and load giving 0.8 pf and ).5MVA.
so we know that in current(I)= p/V*pf………..equation(1)
. As we see on above giving we haven’t have pf, fortunately we have real and reactive power
and can get pf. But before that we to calculate complex or apperent power, because it will make
easier to find pf.
Apperent power(S)= squart(P^2+Q^2)…..equation(2)
Power factor(PF)= apperent power(S)/real power(p)……equation(3)
After we power factor, direct go back to equation(1), then now we have current, but note that
this current is the current that follow voltage terminal(I1). Now we have calculate maximum
power at point V1 to do first we have to get V1 and we can easily get using
V1= V+I(jx)…………….equation(3).
jX= reactance at point V1.
Pmax= (V1*V)/X……………equation(4)
Addtionally we have also have to calculate active power at load and active power at generator.
Pl= (MVA*Pf)…….equation(5)
Active power generator(Pg)= pl+P…………equation(6)
Current through load can be calculated by
I(L)= Pl/V1*pf………………..equation(7). Which mean equation(5)/ (equation(3)*pf load)
The active power of generator will be Pg= Pl+Pa………equation
Total current from generator can be calculated(I).
I= I(L)+Ii…...equation(8).
E= Vi+(jX)(I)……………..equation(9)
Pgenerator= (EV)sineDel/X
Del= sin-1 (p/EVi)
After equatio we will get del and the wil be less than 90, so we know that if the angle is less
than 90, then the system will be stable.
Answer-2
This question about to find critical clearance angle and critical clearance time, by using swing
equation we will findout these both values , before fault, during fault and and after fault.
We done calculation as below.
Answer.3
3.a This question is little related with question.2,we will findout the critical clerance angle
before fault,during fault and after fault. by euler;s method by using matlab, and then we will
plot the delta and omega.
Code(3.a)
Delta=1.95;
clc; clear; close all;
dcr1 = 1.95;
F = 60;
H = 3;
Pmax = 0.9152;
dt =0.01;
W0(1) = 2*pi*F;
Ws = 2*pi*F;
time =0:0.01:1;
d0(1) = 0.4179;
for i = 2:length(time)
Dd0(i) = W0(i-1)-Ws;
if d0(i-1)>= dcr1
Pmax = 2.1353;
end
Pa1(i) = 1-Pmax*sin(d0(i-1));
DW0(i) =(Pa1(i)*(2*pi*60))/(2*H);
db(i) =d0(i-1)+Dd0(i)*dt;
wb(i) =W0(i-1)+DW0(i)*dt;
Ddb(i) =wb(i)-(2*pi*F);
Dwb(i) =((1-Pmax*sin(db(i)))*(2*pi*60))/(2*H);
d0(i) = d0(i-1)+((Dd0(i)+Ddb(i))/2)*dt;
W0(i) = W0(i-1)+((DW0(i)+Dwb(i))/2)*dt;
i = i+1;
end
%% ODE
tspan = 0:0.01:1;
[t,d]=ode45(@(t,d) swing_Function1(t,d), tspan ,d0);
time =0:0.01:1;
subplot(211);plot(time,d0*180/pi, 'k.-'); hold on;
subplot(211);plot(t,d(:,1)*180/pi,'r.-')
grid minor;
title('Modified Euler Method in Power System UnStability ')
xlabel('Time (sec)', 'FontSize', 12)
ylabel('\delta (degree)', 'FontSize', 12)
legend('theory Simulation', 'ODE Simulation', 'Location', 'southwest')
subplot(212);plot(time,W0, 'k.-'); hold on;
subplot(212);plot(t,d(:,2)+377,'r.-')
grid minor;
xlabel('Time (sec)', 'FontSize', 12)
ylabel('\omega (rad/sec)', 'FontSize', 12)
legend('theory Simulation', 'ODE Simulation')
delta = zeros(size(d));
delta(1) = d(2);
Pmax = 0.915;
for i =1:length(t)
if d(i,1)<1.94
Pmax = 0.915;
elseif d(i,1)>1.94
Pmax =2.1353;
end
end
delta(2) = (0.5*(2*pi*60)/3)*(1-Pmax*sin(d(1)));
i=i+1;
end
These two above figures will show us Euler’s method in power system stability. The above will show
delta with respect to time while below shows omega with respect to time.
3.b. code
clc; clear; close all;
dcr1 = 2.09;
F = 60;
H = 3;
Pmax = 0.9152;
dt =0.01;
W0(1) = 2*pi*F;
Ws = 2*pi*F;
time =0:0.01:1;
d0(1) = 0.4179;
for i = 2:length(time)
Dd0(i) = W0(i-1)-Ws;
if d0(i-1)>dcr1
Pmax = 2.1353;
end
Pa1(i) = 1-Pmax*sin(d0(i-1));
DW0(i) =(Pa1(i)*(2*pi*60))/(2*H);
db(i) =d0(i-1)+Dd0(i)*dt;
wb(i) =W0(i-1)+DW0(i)*dt;
Ddb(i) =wb(i)-(2*pi*F);
Dwb(i) =((1-Pmax*sin(db(i)))*(2*pi*60))/(2*H);
d0(i) = d0(i-1)+((Dd0(i)+Ddb(i))/2)*dt;
W0(i) = W0(i-1)+((DW0(i)+Dwb(i))/2)*dt;
end