Summon sinusoids representing the grid and SM
[phA, phB, phC, t] = getThreePhiSinusoid(freqGrid, 4, 380); % Grid
[phR, phS, phT, ~] = getThreePhiSinusoid(freqSM, 4, 380); % SM
% Plot the grid and SM voltages seperately
legend('v_{An}', 'v_{Bn}', 'v_{Cn}')
ylabel('V_{phase-neutral} (V)')
xlim([0, 4*1e3/freqGrid])
title("Grid Voltage vs. Time Graph")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
saveas(gcf, "E.d.grid.emf")
saveas(gcf, "E.d.grid.png")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
legend('v_{Rn}', 'v_{Sn}', 'v_{Tn}')
ylabel('V_{phase-neutral} (V)')
title("Machine Terminal Voltage vs. Time Graph")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
saveas(gcf, "E.d.sm.emf")
saveas(gcf, "E.d.sm.png")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% V_A and V_R Plot on X-T mode:
legend('v_{An}', 'v_{Rn}')
ylabel('V_{phase-neutral} (V)')
title("Phase A and R Voltages vs. Time Graph")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Difference plot on X-T mode:
ylabel('v_{R} - v_{A} (V)')
title("Voltage Difference Between Phase A and R vs. Time Graph")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% V_A and V_R plot on X-Y mode:
peakVal = 380*sqrt(2)/sqrt(3);
plot([-peakVal peakVal], [-peakVal peakVal] ) % Diagonal Line
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The diagonal line corresponds to the instant when the voltages at A and R are equal. That is, the zero voltage crossings of the
waveform. The diagonal line appears periodically with period 1 second.
function [ph1, ph2, ph3, t] = getThreePhiSinusoid(freq, timeEnd, vllrms)
t = linspace(0, timeEnd, 1e5);
ph2 = vln*sin(theta - 2*pi/3);
ph3 = vln*sin(theta + 2*pi/3);