summaryrefslogtreecommitdiff
path: root/1319/CH12/EX12.23/i_23.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1319/CH12/EX12.23/i_23.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '1319/CH12/EX12.23/i_23.sce')
-rw-r--r--1319/CH12/EX12.23/i_23.sce35
1 files changed, 35 insertions, 0 deletions
diff --git a/1319/CH12/EX12.23/i_23.sce b/1319/CH12/EX12.23/i_23.sce
new file mode 100644
index 000000000..c4c99e838
--- /dev/null
+++ b/1319/CH12/EX12.23/i_23.sce
@@ -0,0 +1,35 @@
+// Determine the current in the branches of the network using nodal analysis
+
+clc;
+clear;
+
+// Supply voltages
+V1=30;
+V2=40;
+
+// Resistances in the network
+R1=4;
+R2=2;
+R3=4;
+
+Vb=poly([0 1],'Vb','c');
+
+AD=(V1-Vb)/R1;
+BD=(V2-Vb)/R3;
+CD=Vb/R2;
+
+X=AD+BD-CD;
+
+disp('The Characterictic Equation to find Vb is')
+
+disp(CD,'=',AD,' +',BD)
+
+Vb=roots(X);// Stores the numerical value of Vb
+
+i1=(V1-Vb)/R1;
+i2=(V2-Vb)/R3;
+i3=Vb/R2;
+
+disp('amperes',i1,'Current through 4 ohm resistor on the 30V supply side =')
+disp('amperes',i2,'Current through 4 ohm resistor on the 40V supply side =')
+disp('amperes',i3,'Current through 2 ohm resistor =')