summaryrefslogtreecommitdiff
path: root/1319/CH2/EX2.24/2_24.sce
diff options
context:
space:
mode:
Diffstat (limited to '1319/CH2/EX2.24/2_24.sce')
-rw-r--r--1319/CH2/EX2.24/2_24.sce38
1 files changed, 38 insertions, 0 deletions
diff --git a/1319/CH2/EX2.24/2_24.sce b/1319/CH2/EX2.24/2_24.sce
new file mode 100644
index 000000000..aaeac56b0
--- /dev/null
+++ b/1319/CH2/EX2.24/2_24.sce
@@ -0,0 +1,38 @@
+// Determine the current through 10 ohm resistor using thevenins circuit
+
+clc;
+clear;
+
+//Source Voltages
+V1=10;
+V2=2;
+
+// Resistances of upper limb
+R1=15;
+R2=25;
+
+//Resistances of lower limb
+
+R3=30;
+R4=20;
+
+//For a thevenin circuit
+i1=(V1-V2)/(R1+R2); // Current in upper limb
+i2=V1/(R3+R4); // Current in lower limb
+
+Vac=(i1*R2)+2;
+Vbc=(i2*R4);
+
+Vab=Vac-Vbc; // Thevenin Voltage
+
+Vth=Vab;
+Zl=10; // Load resistance
+
+Reff1=(R1*R2/(R2+R1));
+Reff2=(R3*R4/(R3+R4));
+
+Zth=Reff1+Reff2;
+
+I=Vth/(Zl+Zth); // Curent through AB
+
+printf('The current through the 10 ohm resistor = %g mA\n',I*1000)