m_v=230; f=60; p_out=1.5*746; pf=0.8; eff=0.75; disp("Part a"); p_in=p_out/eff; m_i1=p_in/(m_v*pf); deg_i1=acos(pf); m_p1=m_v*m_i1; deg_v=0; deg_p1=deg_v+deg_i1*180/%pi; p1=m_p1*(cos(deg_p1*%pi/180)+%i*sin(deg_p1*%pi/180)); p=real(p1); p2=p-p1; qc=-imag(p2); x_c=m_v^2/qc; c=1/(2*%pi*f*x_c); disp("the size of the capacitor (in μF) is"); disp(c*10^6); i2=p/m_v; disp("the new in-line current (in A) is"); disp(i2); disp("Part b"); pf0=0.95; m_i20=p/(m_v*pf0); disp("the new in-line current (in A) is"); disp(m_i20); deg_i20=acos(0.95); m_p0=m_v*m_i20; deg_p0=deg_v+deg_i20; p0=m_p0*(cos(deg_p0)+%i*sin(deg_p0)); p20=p0-p1; q0=-imag(p20); x_c0=m_v^2/q0; c0=1/(2*%pi*f*x_c0); disp("size of the capacitor (in μ) is"); disp(c0*10^6);