summaryrefslogtreecommitdiff
path: root/608/CH30/EX30.01
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /608/CH30/EX30.01
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 '608/CH30/EX30.01')
-rwxr-xr-x608/CH30/EX30.01/30_01.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/608/CH30/EX30.01/30_01.sce b/608/CH30/EX30.01/30_01.sce
new file mode 100755
index 000000000..8d98d0a0e
--- /dev/null
+++ b/608/CH30/EX30.01/30_01.sce
@@ -0,0 +1,27 @@
+//Problem 30.01: Use Kirchhoff’s laws to find the current flowing in each branch of the network shown in Figure 30.3.
+
+//initializing the variables:
+rv1 = 100; // in volts
+rv2 = 50; // in volts
+thetav1 = 0; // in degrees
+thetav2 = 90; // in degrees
+R1 = 25; // in ohm
+R2 = 20; // in ohm
+R3 = 10; // in ohm
+
+//calculation:
+//voltage
+V1 = rv1*cos(thetav1*%pi/180) + %i*rv1*sin(thetav1*%pi/180)
+V2 = rv2*cos(thetav2*%pi/180) + %i*rv2*sin(thetav2*%pi/180)
+//The branch currents and their directions are labelled as shown in Figure 30.4
+//Two loops are chosen. loop ABEF, and loop BCDE
+//using kirchoff rule in 3 loops
+//two eqns obtained
+//(R1 + R2)*I1 + R2*I2 = V1
+//R2*I1 + (R2 + R3)*I2 = V2
+I1 = (3*V1 - 2*V2)/(3*(R1 + R2) - 2*(R2))
+I2 = (V2 - R2*I1)/(R2 + R3)
+I = I1 + I2
+
+printf("\n\n Result \n\n")
+printf("\n current, I1 is %.2f + (%.2f)i A, current, I2 is %.2f + (%.2f)i A and total current, I is %.2f + (%.2f)i A",real(I1), imag(I1),real(I2), imag(I2),real(I), imag(I)) \ No newline at end of file