summaryrefslogtreecommitdiff
path: root/1445/CH1/EX1.7/Ex1_7.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1445/CH1/EX1.7/Ex1_7.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 '1445/CH1/EX1.7/Ex1_7.sce')
-rw-r--r--1445/CH1/EX1.7/Ex1_7.sce43
1 files changed, 43 insertions, 0 deletions
diff --git a/1445/CH1/EX1.7/Ex1_7.sce b/1445/CH1/EX1.7/Ex1_7.sce
new file mode 100644
index 000000000..0d1f19f9b
--- /dev/null
+++ b/1445/CH1/EX1.7/Ex1_7.sce
@@ -0,0 +1,43 @@
+//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS
+//Example 7
+
+disp("CHAPTER 1");
+disp("EXAMPLE 7");
+
+//VARIABLE INITIALIZATION
+I1=1; //current source in Amperes
+v1=4; //voltage source in Volts
+v2=3; //voltage source in Volts
+v3=6; //voltage source in Volts
+r1=2; //resistance in Ohms
+r2=2; //resistance in Ohms
+r3=1; //resistance in Ohms
+r4=3; //resistance in Ohms
+
+//SOLUTION
+//converting all the voltage sources into current sources
+I2=v1/r1;
+I3=v2/r3;
+I4=v3/r4;
+disp(sprintf("The four current sources are %d A, %d A, %d A and %d A",I1,I2,I3,I4));
+
+req1=(r1*r2)/(r1+r2); //parallel combination of resistors
+req2=(r3*r4)/(r3+r4);
+v2=(I1+I4)*req1;
+v3=(I3-I2)*req2;
+req=req1+req2;
+v=v2+v3;
+I=v/req;
+disp("VOLTAGE EQUIVALENT CIRCUIT:");
+disp(sprintf(" Voltage source= %.2f V",v));
+disp(sprintf(" Equivalent resistance(in series)= %.2f Ω",req));
+disp("CURRENT EQUIVALENT CIRCUIT:");
+disp(sprintf(" Current source= %.2f A",I));
+disp(sprintf(" Equivalent resistance(in parallel)= %.2f Ω",req));
+
+//END
+
+
+
+
+