[vtAArr, vtBArr, vtCArr, tArr] = getThreePhiSinusoid(freq, 40e-3, vll_rms);
threePhiPlot(vtAArr, vtBArr, vtCArr, tArr)
% As seen in the figure, the third harmonic term
% is the same for all the phases
[vtAArr_harm, vtBArr_harm, vtCArr_harm, tArr_harm] = calc3rdHarmonic(freq, 40e-3, vll_rms);
threePhiPlot(vtAArr_harm, vtBArr_harm, vtCArr_harm, tArr_harm)
% Therefore use ph1 harmonic for all phases
harmonicterm = vtAArr_harm;
vtA_harm = vtAArr+harmonicterm; vtB_harm = vtBArr+harmonicterm; vtC_harm = vtCArr+harmonicterm;
threePhiPlot(vtA_harm, vtB_harm, vtC_harm, tArr)
% As seen on figure, the neutral voltage is 0
neutral_wvf_normal = vtAArr + vtBArr + vtCArr;
singlePhiPlot(neutral_wvf_normal, tArr)
% Now the neutral is oscillating
neutral_wvf_harm = vtA_harm + vtB_harm + vtC_harm;
singlePhiPlot(neutral_wvf_harm, tArr)
%The line to line voltages are sinusoidal
threePhiPlot_phph(vtA_harm, vtB_harm, vtC_harm, tArr)
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);
function [ph1 ph2 ph3 t] = calc3rdHarmonic(freq, timeEnd, vllrms)
t = linspace(0, timeEnd, 1e5);
ph1 = (1/3)*vln*sin(3*theta);
ph2 = (1/3)*vln*sin(3*(theta - 2*pi/3));
ph3 = (1/3)*vln*sin(3*(theta + 2*pi/3));
function singlePhiPlot(ph1, t)
ylabel('V_{phase-neutral} (V)')
title("Voltages vs. Time Graph")
function threePhiPlot(ph1, ph2, ph3, t)
legend('v_{t-A}', 'v_{t-B}', 'v_{t-C}')
ylabel('V_{phase-neutral} (V)')
title("Phase to Neutral Line Voltages vs. Time Graph")
function threePhiPlot_phph(ph1, ph2, ph3, t)
legend('v_{t-AB}', 'v_{t-BC}', 'v_{t-CA}')
ylabel('V_{phase-neutral} (V)')
title("Line to Line Voltages vs. Time Graph")