From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2297/CH2/EX2.2/Ex2_2.sce | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 2297/CH2/EX2.2/Ex2_2.sce (limited to '2297/CH2/EX2.2/Ex2_2.sce') diff --git a/2297/CH2/EX2.2/Ex2_2.sce b/2297/CH2/EX2.2/Ex2_2.sce new file mode 100755 index 000000000..3586610ac --- /dev/null +++ b/2297/CH2/EX2.2/Ex2_2.sce @@ -0,0 +1,23 @@ +// Example 2.2 :current +clc; +close; +clear; +// given : +vs1=72;//voltage in volts +vs2=40;//voltage in volts +R1=36;//resistance in ohm +R2=10;//resistance in ohm +ig=2;//current in amperes +Rx=8;//resistance in ohm +//(va-72)/36+(va-40)/10 -2 +va/8=0 node equation at 1 +va=((R2*Rx*vs1)+(R1*Rx*vs2)+(R1*R2*Rx*ig))/((R2*Rx)+(R1*Rx)+(R1*R2));//voltage in volts +ix1=va/Rx;//current in amperes +//(R1+R2)*I1-R2*I2+vs2=vs1 loop equation 1 +//R2*I2-R2*I1+Ix*Rx=vs2 loop equation 2 +//Ix=I2+2 +A=[R1+R2 -R2;-R2 R2+Rx];//making equations +B=[vs1-vs2;vs2-2*Rx];//making equations +X=A\B;//solving equations +ix2=X(2,1)+ig;//current in amperes +disp(ix1,"current through Rx is(by node voltage method), (A)=") +disp(ix2,"current through Rx is (by loop current method),(A) =") -- cgit