summaryrefslogtreecommitdiff
path: root/3802/CH2/EX2.4/Ex2_4.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3802/CH2/EX2.4/Ex2_4.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 '3802/CH2/EX2.4/Ex2_4.sce')
-rw-r--r--3802/CH2/EX2.4/Ex2_4.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/3802/CH2/EX2.4/Ex2_4.sce b/3802/CH2/EX2.4/Ex2_4.sce
new file mode 100644
index 000000000..967a5c8c9
--- /dev/null
+++ b/3802/CH2/EX2.4/Ex2_4.sce
@@ -0,0 +1,27 @@
+//Book Name:Fundamentals of Electrical Engineering
+//Author:Rajendra Prasad
+//Publisher: PHI Learning Private Limited
+//Edition:Third ,2014
+
+//Ex2_4.sce.
+
+clc;
+clear;
+R5=60;
+a1=9;b1=-5;c1=0;d1=80; //these are the coefficient values of VA,VB,VC and the source obtained from node A in the given circuit
+a2=-1;b2=7;c2=-2;d2=24; //these are the coefficient values of VA,VB,VC and the source obtained from node B in the given circuit
+a3=0;b3=-3;c3=4;d3=36; //these are the coefficient values of VA,VB,VC and the source obtained from node C in the given circuit
+
+del=det([a1 b1 c1;a2 b2 c2;a3 b3 c3]);
+del1=det([d1 b1 c1;d2 b2 c2;d3 b3 c3]);
+del2=det([a1 d1 c1;a2 d2 c2;a3 d3 c3]);
+del3=det([a1 b1 d1;a2 b2 d2;a3 b3 d3]);
+
+VA=del1/del; //Using Cramer's rule
+VB=del2/del; //Using Cramer's rule
+VC=del3/del; //Using Cramer's rule
+Vba=VA-VB;
+I5=VC/R5; // from Ohm's law
+printf("\n Vba=%1.3f V \n",Vba)
+//Answer vary dueto round off error
+printf("\n Current through the 60 ohm resistor=%1.3f A \n",I5)