summaryrefslogtreecommitdiff
path: root/1319/CH2/EX2.8/2_8.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1319/CH2/EX2.8/2_8.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/CH2/EX2.8/2_8.sce')
-rw-r--r--1319/CH2/EX2.8/2_8.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/1319/CH2/EX2.8/2_8.sce b/1319/CH2/EX2.8/2_8.sce
new file mode 100644
index 000000000..b566d3685
--- /dev/null
+++ b/1319/CH2/EX2.8/2_8.sce
@@ -0,0 +1,26 @@
+// Conversion to current source and nodal analysis
+
+clc;
+clear;
+
+// Nodal Equations
+// 1.5*Va-0.5*Vb+0*Vc=5
+// 0.5*Va-1.5*Vb+0.5*Vc=0
+// 0*Va-0.5*Vb+1*Vc=0
+
+Y=[1.5 -0.5 0;0.5 -1.5 0.5; 0 -0.5 1]; // Admittance matrix
+I=[5;0;0];
+V=inv(Y)*I;
+
+Va=V(1);
+Vb=V(2);
+Vc=V(3);
+
+Vab=Va-Vb;
+
+disp('V',Va,'Voltage at node A =')
+disp('V',Vb,'Voltage at node B =')
+disp('V',Vc,'Voltage at node C =')
+
+disp('V',Vab,'The voltage across AB in the circuit =')
+disp('A',Vab/2,'The current in branch AB in the circuit =')