summaryrefslogtreecommitdiff
path: root/2672/CH1/EX1.50/Ex1_50.sce
diff options
context:
space:
mode:
Diffstat (limited to '2672/CH1/EX1.50/Ex1_50.sce')
-rwxr-xr-x2672/CH1/EX1.50/Ex1_50.sce31
1 files changed, 31 insertions, 0 deletions
diff --git a/2672/CH1/EX1.50/Ex1_50.sce b/2672/CH1/EX1.50/Ex1_50.sce
new file mode 100755
index 000000000..25ec3958c
--- /dev/null
+++ b/2672/CH1/EX1.50/Ex1_50.sce
@@ -0,0 +1,31 @@
+//Example 1_50
+clc;
+clear;
+close;
+format('v',5);
+//given data :
+I=8;//A
+I4=6;//A
+R1=3;//ohm
+R2=2;//ohm
+R3=4;//ohm
+//Applying KCL//I=I1+I2
+//I=V1/R1+V1/R2-V2/R2//eqn(1)
+A1=[1/R1+1/R2 -1/R2];//Coefficient Matrix
+B1=[I];//Coefficient Matrix
+//Applying KCL//I2=I3+I4
+//V1/R2-V2/R2-V2/R3=I4//eqn(2)
+A2=[1/R2 -1/R2-1/R3];//Coefficient Matrix
+B2=[I4];//Coefficient Matrix
+A=[A1;A2];//Coefficient Matrix
+B=[B1;B2];//Coefficient Matrix
+X=A^-1*B;//solution Matrix
+V1=X(1);//V
+V2=X(2);//V
+I1=V1/R1;//A
+I2=V1/R2-V2/R2;//A
+I3=(V2)/R3;//A
+disp("Current in various branches are : ");
+disp(I1,"Current I1(A)");
+disp(I2,"Current I2(A)");
+disp(I3,"Current I3(A)");