summaryrefslogtreecommitdiff
path: root/1523/CH2/EX2.20/2_20.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1523/CH2/EX2.20/2_20.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 '1523/CH2/EX2.20/2_20.sce')
-rwxr-xr-x1523/CH2/EX2.20/2_20.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/1523/CH2/EX2.20/2_20.sce b/1523/CH2/EX2.20/2_20.sce
new file mode 100755
index 000000000..a56942a9c
--- /dev/null
+++ b/1523/CH2/EX2.20/2_20.sce
@@ -0,0 +1,21 @@
+//Network Theorem 1
+//page no-2.26
+//example2.20
+disp("writing equation for supermesh,");
+disp("I1-I3=7");....//equation 1
+disp("Applying Kvl to the outer path of the supermesh:");
+disp("-I1+4*I2-4*I3 = -7");....//equation 2
+disp("Applying Kvl to mesh 2:");
+disp("I1-6*I2+3*I3 = 0");...//equation 3
+disp("Solving equations 1 ,2 and 3");...//solving equations in matrix form
+A=[1 0 -1;-1 4 -4;1 -6 3];
+B=[7 -7 0]'
+X=inv(A)*B;
+disp(X);
+disp("I1=9 A");
+disp("I2=-2.5 A");
+disp("I3=-2 A");
+x=2.5;
+y=2;
+z=x-y;
+mprintf("\nCurrent through the 3-Ohm resistor = I2-I3 =%.1f A",z);