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 /1523/CH2/EX2.26 | |
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 '1523/CH2/EX2.26')
-rwxr-xr-x | 1523/CH2/EX2.26/2_26.sce | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/1523/CH2/EX2.26/2_26.sce b/1523/CH2/EX2.26/2_26.sce new file mode 100755 index 000000000..9044ff37c --- /dev/null +++ b/1523/CH2/EX2.26/2_26.sce @@ -0,0 +1,21 @@ +//Network Theorem 1
+//page no-2.30
+//example2.26
+disp("Applying KCL to node 1:");
+disp("5*V1-2*V2 = -24");....//equation 1
+disp("Applying KCL to node 2:");
+disp("10*V1-31*V2+6*V3 = 300");...//equation 2
+disp("Applying KCL to node 3:");
+disp("-4*V2 +9*V3 = 160");...//equation 3
+disp("Solving equations 1,2 and 3");...//solving equations in matrix form
+A=[5 -2 0;10 -31 6;0 -4 9];
+B=[-24 300 160]'
+X=inv(A)*B;
+disp(X);
+disp("V1= -8.77 V");
+disp("V2= -9.92 V");
+disp("V3= 13.37 V");
+x=13.37;
+y=-9.92;
+z=(x-y)/5;
+printf("\ncurrent through the 5 ohm resistor = V3-V2/5 = %.2f A",z);
|