From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 503/CH3/EX3.4/ch3_4.sci | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 503/CH3/EX3.4/ch3_4.sci (limited to '503/CH3/EX3.4') diff --git a/503/CH3/EX3.4/ch3_4.sci b/503/CH3/EX3.4/ch3_4.sci new file mode 100755 index 000000000..4df207dbb --- /dev/null +++ b/503/CH3/EX3.4/ch3_4.sci @@ -0,0 +1,27 @@ +// To calculate primary current and its pf + +clc; + +function [x,y]=polar2rect(r,theta) + x=r*cosd(theta); + y=r*sind(theta); +endfunction + +function [r,theta]=rect2polar(x,y) + r=sqrt(x^2+y^2); + theta=atand(y/x); +endfunction + +I_2=[10 -30]; +[I_2r(1),I_2r(2)]=polar2rect(I_2(1),I_2(2)); + +I_0=[1.62 -71.5]; +[I_0r(1),I_0r(2)]=polar2rect(I_0(1),I_0(2)); + +I_1r=I_0r+I_2r; + +[I_1(1),I_1(2)]=rect2polar(I_1r(1),I_1r(2)); +disp(I_1(1),'primary current(A)='); +pf=cosd(I_1(2)); +disp(pf,'power factor='); + -- cgit