MATLAB
MATLAB
MATLAB
% Calculations
Z_line = R_line + 1i*2*pi*50*L_line; % Line impedance
Y_line = 1i*2*pi*50*C_line; % Line admittance
Z_load = (V_source^2) / (load_power * load_pf); % Load
impedance
% Simulation
distance = linspace(0, length_line, 1000); % Distance along the
line
V_received = zeros(size(distance)); % Received voltage array
for i = 1:length(distance)
Z_total = Z_line * distance(i) + Z_load; % Total impedance
Y_total = Y_line * distance(i); % Total admittance
I_received = V_source / Z_total; % Current received at this
point
V_received(i) = V_source - I_received * Z_total * distance(i);
% Voltage received at this point
end
% Plotting
figure;
plot(distance, abs(V_received) / 1000); % Plot voltage profile
(kV)
xlabel('Distance (km)');
ylabel('Voltage (kV)');
title('Voltage Profile along the Transmission Line');
grid on;
% Parameters
R_line = 0.1; % Resistance per unit length of the line (ohms/km)
L_line = 1e-3; % Inductance per unit length of the line (H/km)
C_line = 1e-6; % Capacitance per unit length of the line (F/km)
G_line = 1e-9; % Conductance per unit length of the line (S/km)
length_line = 100; % Length of the transmission line (km)
f = 50; % Frequency (Hz)
% Simulation parameters
% Plot results
distance = linspace(0, length_line, num_segments);
figure;
subplot(2, 1, 1);
plot(distance, abs(V));
xlabel('Distance (km)');
ylabel('Voltage (V)');
title('Voltage Profile along the Transmission Line');
grid on;
subplot(2, 1, 2);
plot(distance, abs(I));
xlabel('Distance (km)');
ylabel('Current (A)');
title('Current Profile along the Transmission Line');
grid on;
% Parameters
R_line = 0.1; % Resistance per unit length of the line (ohms/km)
L_line = 1e-3; % Inductance per unit length of the line (H/km)
C_line = 1e-6; % Capacitance per unit length of the line (F/km)
G_line = 1e-9; % Conductance per unit length of the line (S/km)
length_line = 100; % Length of the transmission line (km)
f = 50; % Frequency (Hz)
% ABCD matrix
A = cosh(gamma * length_line);
B = Z0 * sinh(gamma * length_line);
C = (1/Z0) * sinh(gamma * length_line);
D = A;