summaryrefslogtreecommitdiff
path: root/1544/CH1/EX1.10/Ch01Ex10.sce
diff options
context:
space:
mode:
Diffstat (limited to '1544/CH1/EX1.10/Ch01Ex10.sce')
-rwxr-xr-x1544/CH1/EX1.10/Ch01Ex10.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/1544/CH1/EX1.10/Ch01Ex10.sce b/1544/CH1/EX1.10/Ch01Ex10.sce
new file mode 100755
index 000000000..d6d1b4921
--- /dev/null
+++ b/1544/CH1/EX1.10/Ch01Ex10.sce
@@ -0,0 +1,15 @@
+// Scilab code Ex1.10: Pg 16 (2008)
+clc; clear;
+E = 12; // E.m.f, V
+I = 5; // Electric current, A
+V = 11.5; // Terminal potential difference, V
+// Using relation V = E - I*r, solving for r
+r = ( E - V )/I; // Internal resistance of battery, ohm
+// From Ohm's law, V = I*R, then solving for R
+R = V/I; // Resistance, ohms
+printf("\nThe internal resistance of battery = %3.1f ohm", r)
+printf("\nThe resistance of external circuit = %3.1f ohm", R)
+
+// Result
+// The internal resistance of battery = 0.1 ohm
+// The resistance of external circuit = 2.3 ohm