Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Bangladesh University of Engineering & Technology

Department of Electrical & Electronic Engineering

Lab Report

Course No.: EEE 412


Experiment-05
Experiment name: STEP-BY-STEP SOLUTION OF THE SWING
CURVE

Name: Al ami shawon


Student ID:1806098
Section: B1

Date of Performance: 9/8/2023


Date of Submission:19/8/2023
Objective:
1. To understand the change in electrical angle of a generator following a fault.
2. To observe the change in swing curve with the variation in fault clearing cycle.

Task 1,2,3:
Code:

clear all;
close all;
clc;

% Given parameters

H = 5; % Inertia constant in seconds


P_mech = 0.8; % Mechanical power in per unit
delta_initial_deg = 25.15; % Initial swing angle in degrees
P_e_before = P_mech / sind(delta_initial_deg);
P_e_fault = 0.575; % Electrical power during fault in per unit
P_e_after = 1.294; % Electrical power after fault in per unit
f_nominal = 60; % Nominal frequency in Hz

r1_ratio = P_e_fault / P_e_before;


r2_ratio = P_e_after / P_e_before;
delta_max_deg = 180 - rad2deg(asin(P_mech / P_e_after));

% Time parameters
t_fault_occurrence = 0; % Time of fault occurrence in
seconds
cycles_per_clearance = [4.5 15 30]; % Cycles per fault
clearance
t_clearance = cycles_per_clearance / f_nominal; % Convert cycles to seconds
t_res = 0.05; % Time resolution in seconds
t_simulation_end = 12; % End time for simulation in
seconds

% Initialize arrays
time_steps = 0:t_res:t_simulation_end;
angle_degrees = zeros(size(time_steps));
angle_degrees(1) = delta_initial_deg;

% Calculate critical angle and time


x_val = ((P_mech / P_e_before) * (deg2rad(delta_max_deg) - deg2rad(delta_initial_deg)) +
r2_ratio * cosd(delta_max_deg) - r1_ratio * cosd(delta_initial_deg)) / (r2_ratio -
r1_ratio);
critical_angle_deg = rad2deg(acos(x_val));
critical_clearance_time = sqrt((4 * H_val * (critical_angle_deg -
deg2rad(delta_initial_deg))) / (2 * pi * f_nominal * P_mech));

% Numerical solution using Step-by-step method for different clearance times

clearance_idx = 1;
while clearance_idx <= 3
delta_accum = 0;
time_idx = 1;

while time_idx <= length(time_steps) - 1


current_time = time_steps(time_idx);
if current_time >= t_fault_occurrence && current_time < t_fault_occurrence +
t_clearance(clearance_idx)

P_available = P_mech - P_e_fault * sind(angle_degrees(time_idx));


else
P_available = P_mech - P_e_after * sind(angle_degrees(time_idx));
end

increment_coeff = (180 * f_nominal / H) * (t_res^2);


delta_accum = delta_accum + increment_coeff * P_available;
angle_degrees(time_idx + 1) = delta_accum + angle_degrees(time_idx);

time_idx = time_idx + 1;
end

% Plot results for each clearance time


figure(clearance_idx);

plot(time_steps, angle_degrees);
xlabel('Time (s)');
ylabel('Rotor Angle (degrees)');
title('Synchronous Generator Swing Curve'); grid on;

% Display the time at which the fault is cleared


fprintf('Fault cleared at t = %.5f seconds\n', t_fault_occurrence +
t_clearance(clearance_idx));

clearance_idx = clearance_idx + 1;
end

% Display critical angle and critical clearing time fprintf('Critical angle = %.5f
degrees\n', critical_angle_deg);
fprintf('Critical Clearing Time = %.5f sec.\n', critical_clearance_time);
Output:
Here, the fault clearing time is more than the critical clearing time of 0.25809 and is 30/60 = 0.5
seconds. This makes the system unstable. The generator's rotor angle may have swung
dramatically if the fault is not fixed within the necessary clearing period, and the system may be
forced into runaway.

Task 4:
Code:

clc;

clear all;
close all;

time = linspace(0, 0.85, 35); %timespan


delta_not_1 = 20.82;
delta_not_2 = 16.19 ;
delta_1 = [delta_not_1 zeros(1, length(time)-1)];
delta_2 = [delta_not_2 zeros(1, length(time)-1)];
del_delta_1 = zeros(1, length(time));
del_delta_2 = zeros(1, length(time));
% defined for delta 2

gamma_dr_fault = 0.755;
gamma_after_fault = 0.847;
Pm_dr_fault = 1.6955;
Pm_after_fault = 1.6696;
Pmax_dr_dault = 5.5023;
Pmax_after_dault = 6.4934;
% del_t = 0.05;
% f = 60;
k = 3.375;
for i=1:1:(length(time)-1) %delta2 iteration
if(time(i)<0.225)
pa = Pm_dr_fault - Pmax_dr_dault*sin((delta_2(i)-gamma_dr_fault)*pi/180);
else
pa = Pm_after_fault - Pmax_after_dault*sin((delta_2(i)-gamma_after_fault)*pi/180);
end

if(i==1)
Kpa = k*pa/2;
else
Kpa = k*pa;
end

del_delta_2(i+1) = del_delta_2(i) + Kpa;


delta_2(i+1) = delta_2(i) + del_delta_2(i+1);
end

for i=1:1:(length(time)-1) % delta 1 iteration


if(time(i)<0.225)
pa = 3.5;
else
pa = 2.8944 - 8.3955*sin((delta_1(i)-1.664)*pi/180);
end
if(i==1)
Kpa = k*pa/2;
else
Kpa = k*pa;
end
del_delta_1(i+1) = del_delta_1(i) + Kpa;
delta_1(i+1) = delta_1(i) + del_delta_1(i+1);
end
figure();
plot(time,delta_1); hold on;
plot(time,delta_2);
ylim([0,40]);
xlabel('Time(Seconds)'), ylabel('Elcetrical Angle(delta in degree)');
legend('Delta angle for Machine 1','Delta angle for Machine 2');

Output:

Fault cleared at t=0.200000 seconds

You might also like