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

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: Motasim Billah


Student ID: 1806081
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 workspace, close figures, and clear command window
clearvars;
close all;
clc;

% Given parameters
H_val = 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_val) * (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;
close all;
clear all;
% Given parameters
H = 5; % Inertia constant in seconds
Pm = [3.5 1.85]; % Mechanical power in per unit
delta0 = 16.19; % Initial swing angle in degrees
Pe_prefault=Pm/sind(delta0);
Pe_duringfault = [0 0.1545]; % Electrical power during fault in per unit
Pe_afterfault = [0.6056 0.1804]; % Electrical power after fault in per unit
f_nominal = 60; % Nominal frequency in Hz
% Time parameters
t_fault = 0; % Time of fault occurrence in seconds
cpc = 12; % Cycles per fault clearance
t_clrnce = cpc / f_nominal; % Convert cycles to seconds
t_rsltion = 0.005; % Time resolution in seconds
t_end = 1; % End time for simulation in seconds
% % Convert initial angle to radians
% delta0_rad = deg2rad(delta0);
% % Initial conditions
omega = 2 * pi * f_nominal; % Convert frequency to rad/s
% Initialize arrays
time = 0:t_rsltion:t_end;
angle_deg = zeros(size(time));
dif_delta=zeros(size(time));
dif_delta(1)=0;
angle_deg(1)=delta0;
% Numerical solution using Step-by-step method
j = 1;
while j <= 2
i = 1;
while i <= length(time) - 1
t = time(i);

if t >= t_fault && t < t_fault + t_clrnce


if j == 1
Pa = Pm(j) - Pe_prefault(j) * sind(angle_deg(i));
else
Pa = Pm(j) - (Pe_prefault(j) + 5.5023 * sind(angle_deg(i) - 0.755));
end
else
if j == 1
Pa = Pm(j) - (Pe_afterfault(j) + 8.3955 * sind(angle_deg(i) -
1.664));
else
Pa = Pm(j) - (Pe_afterfault(j) + 6.4934 * sind(angle_deg(i) -
0.847));
end
end

k = (180 * f_nominal / H) * (t_rsltion^2);


dif_delta(i+1) = dif_delta(i) + k * Pa;
angle_deg(i+1) = dif_delta(i) + angle_deg(i);

i = i + 1;
end

angle_mech{j} = angle_deg;

j = j + 1;
end

figure(1)
plot(time, angle_mech{1}); hold on
plot(time, angle_mech{2});
xlabel('Time (s)');
ylabel('Rotor Angle (degrees)');
title('Synchronous Generator Swing Curve');
ylim([0 50]);
legend('Machine 1','Machine 2');
grid on;
% Display the time at which the fault is cleared
fprintf('Fault cleared at t = %.5f seconds\n', t_fault + t_clrnce);
Output:

Fault cleared at t=0.200000 seconds

You might also like