From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 1319/CH2/EX2.3/2_3.sce | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 1319/CH2/EX2.3/2_3.sce (limited to '1319/CH2/EX2.3') diff --git a/1319/CH2/EX2.3/2_3.sce b/1319/CH2/EX2.3/2_3.sce new file mode 100644 index 000000000..d2e6cfa8e --- /dev/null +++ b/1319/CH2/EX2.3/2_3.sce @@ -0,0 +1,66 @@ +// To calculate current in each branch using loop analysis and point voltages in a given network. + +clc; +clear; + +// MESH Equations for the given network. +//3.95*i1-3.75*i2+0*i3=120 +//-3.75*i1+9.5*i2-5.45*i3=0 +//0*i1-5.45*i2+5.55*i3=-110 + +// Positive of 120V DC supply connected to 0.2 ohm resistor +// Positive of 110 DC supply connected to 0.1 ohm resistor + +//Voltage supplies are 120V and 110V + +R=[3.95 -3.75 0;-3.75 9.5 -5.45; 0 -5.45 5.55]; +E=[120;0;-110]; + +R1=abs(R(2)); // Resistor carrying ia +R2=abs(R(8)); // Resistor carrying ib + +// Loop Currents + +I=inv(R)*E; + +i1=I(1); +i2=I(2); +i3=I(3); + +ia=i1-i2; // Assumed direction from Mesh 1 +ib=i2-i3; // Assumed direction from Mesh 2 + +// Using Nodal Analysis to find V1 and V2. +V1=R1*ia; +V2=R2*ib; + +disp('A',ib,'ib (through 2 resistor between 7 ohm and 3 ohm resistor) =','A',ia,'ia(through 1 ohm resistor) =','A',i3,'i3 =','A',i2,'i2 =','A',i1,'i1 =','The Calculated Loop Currents are') + +disp('The Negative sign indicates that the assumed direction of flow of current should be reveresed') + +// To obtain the magnitude of direction. + +if(i1<0) + i1=abs(i1); +end +if(i2<0) + i2=abs(i2); +end +if(i3<0) + i3=abs(i3); +end +if(ia<0) + ia=abs(ia); +end +if(ib<0) + ib=abs(ib); +end + +disp('A',i1,'The Current through 0.2 ohm resistor on the 120V side =') +disp('A',i2,'The Current through 0.3 ohm resistor =') +disp('A',i3,'The Current through 0.1 ohm resistor on the 110V side =') +disp('A',ia,'The Current through 3.75 ohm resistor =') +disp('A',ib,'The Current through 5.45 ohm resistor =') + +disp('V',V1,'The voltage V1 =') +disp('V',V2,'The voltage V2 =') -- cgit