summaryrefslogtreecommitdiff
path: root/887/CH2/EX2.4/2_4.sce
diff options
context:
space:
mode:
Diffstat (limited to '887/CH2/EX2.4/2_4.sce')
-rwxr-xr-x887/CH2/EX2.4/2_4.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/887/CH2/EX2.4/2_4.sce b/887/CH2/EX2.4/2_4.sce
new file mode 100755
index 000000000..8e776d5c9
--- /dev/null
+++ b/887/CH2/EX2.4/2_4.sce
@@ -0,0 +1,14 @@
+clc
+//ex2.4
+V_s=100; //source current
+R_1=60;
+R_2=30;
+R_3=60;
+R_x=1/((1/R_2)+(1/R_3)); //R_2 and R_3 parallel
+V_x=R_x*V_s/(R_1+R_x); //voltage across R_x(voltage-division principle)
+i_s=V_s/(R_1+R_x); //ohm's law
+i_3=R_2*i_s/(R_2+R_3); //current through R_3(current-division principle)
+printf(" All the values in the textbook are approximated, hence the values in this code differ from those of Textbook")
+disp(V_x,'voltage across R2 or R3 in volts')
+disp(i_s,'source current in amperes')
+disp(i_3,'current through R3 in amperes')