summaryrefslogtreecommitdiff
path: root/1964/CH4/EX4.23/ex4_23.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1964/CH4/EX4.23/ex4_23.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1964/CH4/EX4.23/ex4_23.sce')
-rwxr-xr-x1964/CH4/EX4.23/ex4_23.sce40
1 files changed, 40 insertions, 0 deletions
diff --git a/1964/CH4/EX4.23/ex4_23.sce b/1964/CH4/EX4.23/ex4_23.sce
new file mode 100755
index 000000000..f48d6f0f7
--- /dev/null
+++ b/1964/CH4/EX4.23/ex4_23.sce
@@ -0,0 +1,40 @@
+//Chapter-4, Example 4.23, Page 148
+//=============================================================================
+clc
+clear
+function [polar] = r2p(x,y)//function to convert rectangular to polar
+ polar = ones(1,2)
+ polar(1) = sqrt ((x ^2) +(y^2))
+ polar(2) = atan (y/x)
+ polar(2) =(polar (2)*180)/%pi
+ endfunction
+ function [ rect ] = p2r(r,theta)//function to convert polar to rectangular
+ rect = ones(1 ,2)
+ theta =( theta *%pi) /180
+ rect (1)=r* cos(theta)
+ rect (2)=r* sin(theta)
+ endfunction
+//e1=230*sin(w*t)
+//e2=230*sin(w*t*%pi/6)
+//CALCULATIONS
+E1=p2r(230,0);//impedance in rectangular form
+disp(E1);
+E2=p2r(230,30);
+disp(E2);
+E=E1+E2;
+E=E/sqrt(2);
+E=r2p(E(1),E(2));
+disp(E)
+Z=r2p(8,6);
+disp(Z);
+I1=E(1)/Z(1);
+disp(I1)
+theta=E(2)-Z(2);
+disp(theta);
+phi=cos(theta*%pi/180)
+disp(phi)
+P1=(E(1))*(I1)*(phi);//power supplied in Watts
+mprintf("Thus Rms current and power supplied are %2.1f A and %f W respectively",I1,P1);
+//note here power calculated my vary as we took many decimal values for calculation.Please check the calculations
+//note:here direct functions for converson are not available and hence we defined user defined functions for polar to rect and rect to polar conversions
+//=================================END OF PROGRAM=======================================================================================================