diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /503/CH3/EX3.4 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '503/CH3/EX3.4')
-rwxr-xr-x | 503/CH3/EX3.4/ch3_4.sci | 27 |
1 files changed, 27 insertions, 0 deletions
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=');
+
|