summaryrefslogtreecommitdiff
path: root/1445/CH2/EX2.51/Ex2_51.sce
diff options
context:
space:
mode:
Diffstat (limited to '1445/CH2/EX2.51/Ex2_51.sce')
-rw-r--r--1445/CH2/EX2.51/Ex2_51.sce21
1 files changed, 8 insertions, 13 deletions
diff --git a/1445/CH2/EX2.51/Ex2_51.sce b/1445/CH2/EX2.51/Ex2_51.sce
index 85f7d494b..90e9c5273 100644
--- a/1445/CH2/EX2.51/Ex2_51.sce
+++ b/1445/CH2/EX2.51/Ex2_51.sce
@@ -1,30 +1,25 @@
//CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT
//Example 51
+clc;
disp("CHAPTER 2");
disp("EXAMPLE 51");
-//
-//Given
-// admittance of branches are:
-//Y1=0.4+j0.6
-//Y2=0.1+j0.4
-//Y3=0.06+j0.23
-//
+
//VARIABLE INITIALIZATION
Y1=0.4+(%i*0.6); //admittance of 1st branch in Siemens
Y2=0.1+(%i*0.4); //admittance of 2nd branch in Siemens
Y3=0.06+(%i*0.23); //admittance of 3rd branch in Siemens
//SOLUTION
-Y=Y1+Y2+Y3; // total admittance
+Y=Y1+Y2+Y3;
//function to convert from rectangular form to polar form
function [Y,angle]=rect2pol(x,y);
Y=sqrt((x^2)+(y^2));
angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees
endfunction;
-[Y,angle]=rect2pol(real(Y),imag(Y));
-disp(sprintf("The total admittance of the circuit is %.3f S, %.2f degrees",Y,angle));
-z=1/Y;
-disp(sprintf("The impedance of the circuit is %.3f Ω, %.2f degrees",z,-angle));
-//
+[Y1,angle]=rect2pol(real(Y),imag(Y));
+disp(sprintf("The total admittance of the circuit is %f S, %f degrees",Y1,angle));
+z=1/Y1;
+disp(sprintf("The impedance of the circuit is %f Ω, %f degrees",z,-angle));
+
//END