diff options
Diffstat (limited to '1445/CH1/EX1.25/ch1_ex_25.sce')
-rw-r--r-- | 1445/CH1/EX1.25/ch1_ex_25.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/1445/CH1/EX1.25/ch1_ex_25.sce b/1445/CH1/EX1.25/ch1_ex_25.sce new file mode 100644 index 000000000..e1c250c68 --- /dev/null +++ b/1445/CH1/EX1.25/ch1_ex_25.sce @@ -0,0 +1,22 @@ +//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS +//Example 25 + +disp("CHAPTER 1"); +disp("EXAMPLE 25"); + +//SOLUTION +//(1)I1+(0)I2+(0)I3=5.............eq (1) +//(-20)I1+(50)I2+(-20)I3=0........eq (2) +//(0)I1+(1)I2+(-1)I3=5............eq (3) +//solving the equations by matrix mehod +A=[1 0 0;-20 50 -20;0 1 -1]; +b=[5;0;5]; +x=inv(A)*b; +I1=x(1,:); //to access the 1st element of 3X1 matrix +I2=x(2,:); //to access the 2nd element of 3X1 matrix +I3=x(3,:); //to access the 3rd element of 3X1 matrix +I=I2; +disp(sprintf("By Mesh analysis, the value of I is %d A",I)); + +//END + |