diff options
Diffstat (limited to '2384/CH4')
30 files changed, 674 insertions, 0 deletions
diff --git a/2384/CH4/EX4.1/ex4_1.sce b/2384/CH4/EX4.1/ex4_1.sce new file mode 100755 index 000000000..d6b7d445a --- /dev/null +++ b/2384/CH4/EX4.1/ex4_1.sce @@ -0,0 +1,20 @@ +// Exa 4.1
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 10;// inohm
+V = 230;// in V
+f = 50;// in Hz
+I = V/R;// in A
+disp(I,"The currrent in A is");
+P =V*I;// in W
+disp(P,"The power consumed in W is");
+Vm = sqrt(2)*V;// in V
+Im =sqrt(2)*I;// in A
+omega = 2*%pi*f;// in rad/sec
+//Equation for voltage: V = Vm*sind(omega*t)
+//Equation for current: i = Im*sind(omega*t)
+disp("Voltage equation : v = "+string(Vm)+" sin ("+string(round(omega))+" t)")
+disp("Current equation : i = "+string(Im)+" sin ("+string(round(omega))+" t)")
diff --git a/2384/CH4/EX4.10/ex4_10.sce b/2384/CH4/EX4.10/ex4_10.sce new file mode 100755 index 000000000..79dae9e00 --- /dev/null +++ b/2384/CH4/EX4.10/ex4_10.sce @@ -0,0 +1,23 @@ +// Exa 4.10
+clc;
+clear;
+close;
+format('v',7)
+// Given data
+R = 120;// in ohm
+XC = 250;// in ohm
+I = 0.9;// in A
+Z= R-%i*XC;// in ohm
+phi= atand(imag(Z),real(Z))
+V=I*Z;// in V
+VR = I*R;// in V
+VC= I*XC;// in V
+P= abs(V)*I*cosd(phi);// in W
+Q= abs(V)*I*sind(phi);// in VAR
+disp(cosd(phi),"The power factor is : ")
+disp("Supply voltage : ")
+disp("Magnitude is : "+string(abs(V))+" V and angle is : "+string(atand(imag(V),real(V)))+" °")
+disp(VR,"The voltage across resistance in V is : ")
+disp(VC,"The voltage across capacitance in V is : ")
+disp(P,"The active power in W is : ")
+disp(Q,"The reactive power in VAR is : ")
diff --git a/2384/CH4/EX4.11/ex4_11.sce b/2384/CH4/EX4.11/ex4_11.sce new file mode 100755 index 000000000..f9dc7b0ec --- /dev/null +++ b/2384/CH4/EX4.11/ex4_11.sce @@ -0,0 +1,25 @@ +// Exa 4.11
+clc;
+clear;
+close;
+format('v',7)
+// Given data
+V = 230;// in V
+f = 50;// in Hz
+L = 0.06;// in H
+R = 2.5;// in ohm
+C = 6.8;// in µF
+C = C * 10^-6;// in F
+X_L = 2*%pi*f*L;// in ohm
+X_C = 1/(2*%pi*f*C);// in ohm
+Z = sqrt( (R^2) + ((X_L-X_C)^2) );// in ohm
+disp(Z,"The impedance in ohm is");
+I = V/Z;// in A
+disp(I,"The current in A is");
+// tan(phi) = (X_L-X_C)/R;
+phi = atand( (X_L-X_C)/R );// in lead
+disp("The phase angle between current and voltage is : "+string(abs(phi))+" lead");
+phi = acosd(R/Z);
+disp("The power factor is : "+string(cosd(phi))+" lead");
+P = V*I*cosd(phi);// in W
+disp(P,"The power consumed in W is");
diff --git a/2384/CH4/EX4.12/ex4_12.sce b/2384/CH4/EX4.12/ex4_12.sce new file mode 100755 index 000000000..e8b8964ad --- /dev/null +++ b/2384/CH4/EX4.12/ex4_12.sce @@ -0,0 +1,28 @@ +// Exa 4.12
+clc;
+clear;
+close;
+format('v',9)
+// GIven data
+R = 100;// in ohm
+L = 100;// in µH
+L = L * 10^-6;// in H
+C = 100;// in pF
+C = C * 10^-12;// in F
+V = 10;// in V
+// The resonant frequency
+f_r = 1/(2*%pi*sqrt(L*C));// in Hz
+disp(f_r,"The resonant frequency in Hz is");
+// current at resonance
+Ir = V/R;// in A
+disp(Ir,"The current at resonance in A is");
+X_L = 2*%pi*f_r*L;// in ohm
+// voltage across L at resonance
+V_L = Ir*X_L;// in V
+disp(V_L,"The voltage across L at resonance in V is");
+X_C = X_L;// in ohm
+// voltage across C at resonance
+V_C = Ir*X_C;// in V
+disp(V_C,"The voltage across C at resonance in V is");
+Q= 1/R*sqrt(L/C);
+disp(Q,"The Q-factor is : ")
diff --git a/2384/CH4/EX4.13/ex4_13.sce b/2384/CH4/EX4.13/ex4_13.sce new file mode 100755 index 000000000..c3010a2b7 --- /dev/null +++ b/2384/CH4/EX4.13/ex4_13.sce @@ -0,0 +1,37 @@ +// Exa 4.13
+clc;
+clear;
+close;
+format('v',7)
+// Given data
+R = 10;// in ohm
+L = 0.2;// in H
+C = 40;// in µF
+C = C * 10^-6;// in F
+V = 100;// in V
+f_r = 1/(2*%pi*sqrt(L*C));// in Hz
+disp(f_r,"The frequency at resonace in Hz is");
+Im = V/R;// in A
+disp(Im,"The current in A is");
+Pm = (Im^2)*R;// in W
+disp(Pm,"The power in W is");
+// voltage across R
+V_R = Im*R;// in V
+disp(V_R,"The voltage across R in V is");
+X_L = 2*%pi*f_r*L;// in ohm
+// voltage across L
+V_L = Im*X_L;// in V
+disp(V_L,"The voltage across L in V is");
+X_C = 1/(2*%pi*f_r*C);// in ohm
+// voltage across C
+V_C = Im*X_C;// in V
+disp(V_C,"The voltage across C in V is");
+omega = 2*%pi*f_r;// in rad/sec
+Q = (omega*L)/R;
+disp(Q,"The quality factor is");
+del_F = R/(4*%pi*L);
+f1 = f_r-del_F;// in Hz
+f2 = f_r+del_F;// in Hz
+disp("The half power frequencies are : "+string(f1)+" Hz and "+string(f2)+" Hz");
+BW = f2-f1;// in Hz
+disp(BW,"The bandwidth in Hz is : ")
diff --git a/2384/CH4/EX4.14/ex4_14.sce b/2384/CH4/EX4.14/ex4_14.sce new file mode 100755 index 000000000..1c20996b3 --- /dev/null +++ b/2384/CH4/EX4.14/ex4_14.sce @@ -0,0 +1,17 @@ +// Exa 4.14
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 10;// in ohm
+L = 15;// in µH
+L = L * 10^-6;// in H
+C = 100;// in pF
+C = C * 10^-12;// in F
+f_r = 1/(2*%pi*sqrt(L*C));// in Hz
+X_L = 2*%pi*f_r*L;// in ohm
+Q = X_L/R;// in ohm
+BW = f_r/Q;// in Hz
+BW = BW * 10^-3;// in kHz
+disp(BW,"The bandwidth in kHz is");
diff --git a/2384/CH4/EX4.15/ex4_15.sce b/2384/CH4/EX4.15/ex4_15.sce new file mode 100755 index 000000000..1b2f5e4b9 --- /dev/null +++ b/2384/CH4/EX4.15/ex4_15.sce @@ -0,0 +1,20 @@ +// Exa 4.15
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 1000;// in ohm
+L = 100;// in mH
+L = L * 10^-3;// in H
+C = 10;// in µµF
+C = C * 10^-12;// in F
+f_r = 1/(2*%pi*sqrt(L*C));// in Hz
+disp(f_r*10^-3,"The resonant frequency in kHz is");
+Q = (1/R)*(sqrt(L/C));
+disp(Q,"The quality factor is");
+f1 = f_r - R/(4*%pi*L);// in Hz
+f1 = f1 * 10^-3;// in kHz
+f2 = f_r + R/(4*%pi*L);// in Hz
+f2 = f2 * 10^-3;// in kHz
+disp("The half point frequencies are : "+string(f1)+" Hz and "+string(f2)+" Hz")
diff --git a/2384/CH4/EX4.16/ex4_16.sce b/2384/CH4/EX4.16/ex4_16.sce new file mode 100755 index 000000000..a3da2aa31 --- /dev/null +++ b/2384/CH4/EX4.16/ex4_16.sce @@ -0,0 +1,20 @@ +// Exa 4.16
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 20;// in ohm
+L = 31.8;// in mH
+L = L * 10^-3;// in H
+V = 230;// in V
+f = 50;// in Hz
+I_R = V/R;// in A
+X_L = 2*%pi*f*L;// in ohm
+I_L = V/X_L;// in A
+I = sqrt( (I_R^2) + (I_L^2) );// in A
+disp(I,"The line current in A is");
+phi= acosd( I_R/I);
+disp("The power factor is : "+string(cosd(phi))+" lag");
+P = V*I*cosd(phi);// in W
+disp(P,"The power consumed in W is");
diff --git a/2384/CH4/EX4.17/ex4_17.sce b/2384/CH4/EX4.17/ex4_17.sce new file mode 100755 index 000000000..978f0b7be --- /dev/null +++ b/2384/CH4/EX4.17/ex4_17.sce @@ -0,0 +1,29 @@ +// Exa 4.17
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+C = 50;// in µF
+C = C * 10^-6;// in F
+R = 20;// in ohm
+L = 0.05;// in H
+V = 200;// in V
+f = 50;// in Hz
+X_C = 1/(2*%pi*f*C);// in ohm
+Z1 = X_C;// in ohm
+I1 = V/X_C;// in A
+X_L = 2*%pi*f*L;// in ohm
+Z2 = sqrt( (R^2) + (X_L^2) );// in ohm
+I2 = V/Z2;// in A
+// tan(phi2) = X_L/R;
+phi2 = atand(X_L/R);// in degree
+phi1 = 90;// in degree
+I_cos_phi = I1*cosd(phi1) + I2*cosd(phi2);// in A
+I_sin_phi = I1*sind(phi1) - I2*sind(phi2);// in A
+phi= atand(I_sin_phi/I_cos_phi);// in °
+I= sqrt(I_cos_phi^2+I_sin_phi^2);// in A
+P= V*I*cosd(phi);// in W
+disp(I,"The line current in A is : ")
+disp("The power factor is : "+string(cosd(phi))+" lag");
+disp(P,"The power consumed in W is : ")
diff --git a/2384/CH4/EX4.18/ex4_18.sce b/2384/CH4/EX4.18/ex4_18.sce new file mode 100755 index 000000000..0be13ad98 --- /dev/null +++ b/2384/CH4/EX4.18/ex4_18.sce @@ -0,0 +1,13 @@ +// Exa 4.18
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+V= 68+154*%i;// in V
+I1= 10+14*%i;// in A
+I2= 2+8*%i;// in A
+I= I1+I2;// in A
+phi= atand(imag(V),real(V))-atand(imag(I),real(I));// in °
+disp(phi,"The phase angle in ° is : ")
+disp("The power factor is : "+string(cosd(phi))+" lag")
diff --git a/2384/CH4/EX4.19/ex4_19.sce b/2384/CH4/EX4.19/ex4_19.sce new file mode 100755 index 000000000..1fbcf37b4 --- /dev/null +++ b/2384/CH4/EX4.19/ex4_19.sce @@ -0,0 +1,26 @@ +// Exa 4.19
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R1 = 50;// in ohm
+L = 318;// in mH
+L = L * 10^-3;// in H
+R2 = 75;// in ohm
+C = 159;// in µF
+C =C * 10^-6;// in F
+V = 230;// in V
+f = 50;// in Hz
+XL= 2*%pi*f*L;// in ohm
+Z1= R1+XL*%i;// in ohm
+I1= V/Z1;// in A
+XC= 1/(2*%pi*f*C);// in ohm
+Z2= R2-%i*XC;// in ohm
+I2= V/Z2;// in A
+I= I1+I2;// in A
+phi= atand(imag(I),real(I));// in °
+disp("Supply current : ")
+disp("Magnitude is : "+string(abs(I))+" A")
+disp("Angle : "+string(phi)+" °")
+disp("Power factor is : "+string(cosd(phi))+" lag")
diff --git a/2384/CH4/EX4.2/ex4_2.sce b/2384/CH4/EX4.2/ex4_2.sce new file mode 100755 index 000000000..871c0b015 --- /dev/null +++ b/2384/CH4/EX4.2/ex4_2.sce @@ -0,0 +1,13 @@ +// Exa 4.2
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 100;// in ohm
+i= '3*cos(omega*t)';// in A
+A= R*3^2;// assumed
+disp("Instantaneous power taken by resistor in watts is : ")
+disp(string(A/2)+" (1+cos(2*omega*t))")
+P= R*3^2/2*(1+cos(%pi/2));// in watts
+disp(P,"The average power in watts is : ")
diff --git a/2384/CH4/EX4.20/ex4_20.sce b/2384/CH4/EX4.20/ex4_20.sce new file mode 100755 index 000000000..c96991c37 --- /dev/null +++ b/2384/CH4/EX4.20/ex4_20.sce @@ -0,0 +1,23 @@ +// Exa 4.20
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+V=250;// in V
+Z1= 70.7+70.7*%i;// in ohm
+Z2= 120+160*%i;// in ohm
+Z3= 120+90*%i;// in ohm
+Y1= 1/Z1;// in S
+Y2= 1/Z2;// in S
+Y3= 1/Z3;// in S
+Y_T= Y1+Y2+Y3;// in S
+phi= atand(imag(Y_T),real(Y_T));// in °
+disp("Total admittance of the circuit : ")
+disp("Magnitude is : "+string(abs(Y_T))+" mho")
+disp("Angle is : "+string(phi)+" °")
+I= V*Y_T;// in A
+disp("The supply current : ")
+disp("Magnitude is : "+string(abs(I))+" A")
+disp("Angle is : "+string(phi)+" °")
+disp("Power factor is : "+string(cosd(phi))+" ° lag")
diff --git a/2384/CH4/EX4.21/ex4_21.sce b/2384/CH4/EX4.21/ex4_21.sce new file mode 100755 index 000000000..205054447 --- /dev/null +++ b/2384/CH4/EX4.21/ex4_21.sce @@ -0,0 +1,22 @@ +// Exa 4.21
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+Vm = 100;// in V
+phi1= 30;// in °
+Im = 15;// in A
+phi2= 60;// in °
+V= Vm/sqrt(2)*expm(phi1*%i*%pi/180);// in V
+I= Im/sqrt(2)*expm(phi2*%i*%pi/180);// in A
+Z= V/I;// in ohm
+R= real(Z);// in ohm
+XC= abs(imag(Z));// in ohm
+phi= atand(imag(Z),real(Z));// in °
+P= abs(V)*abs(I)*cosd(phi);// in W
+disp("The impedance is : "+string(Z)+" Ω")
+disp("The resistance is : "+string(R)+" Ω")
+disp("The reactance is : "+string(XC)+" Ω")
+disp("The power is : "+string(P)+" W")
+disp("The power factor is : "+string(cosd(phi))+" leading")
diff --git a/2384/CH4/EX4.22/ex4_22.sce b/2384/CH4/EX4.22/ex4_22.sce new file mode 100755 index 000000000..d07a1bcf0 --- /dev/null +++ b/2384/CH4/EX4.22/ex4_22.sce @@ -0,0 +1,20 @@ +// Exa 4.22
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+P = 100;// in W
+V = 120;// in V
+f= 50;// in Hz
+I = P/V;// in A
+V = 200;// in V
+V_R = 120;// in V
+V_L = sqrt( (V^2) - (V_R^2) );// in V
+// V_L = I*X_L;
+X_L = V_L/I;// in ohm
+// X_L = 2*%pi*f*L;
+L = X_L/(2*%pi*f);// in H
+disp(L,"The value of pure inductance in H is");
+
+// Note: There is calculation error to find the value of V_L, So the answer in the book is wrong and coding is correct.
diff --git a/2384/CH4/EX4.23/ex4_23.sce b/2384/CH4/EX4.23/ex4_23.sce new file mode 100755 index 000000000..56d82aa21 --- /dev/null +++ b/2384/CH4/EX4.23/ex4_23.sce @@ -0,0 +1,22 @@ +// Exa 4.23
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+V=230;// in V
+f= 50;// in Hz
+Z1= 10*expm(-30*%i*%pi/180);// in ohm
+Z2= 20*expm(60*%i*%pi/180);// in ohm
+Z3= 40*expm(0*%i*%pi/180);// in ohm
+Y1= 1/Z1;// in S
+Y2= 1/Z2;// in S
+Y3= 1/Z3;// in S
+Y= Y1+Y2+Y3;// in S
+phi= atand(imag(Y),real(Y));// in °
+Z=1/Y;// in ohm
+P= V^2*abs(Y);// in W
+disp("The circuit admittance is : "+string(abs(Y))+" mho");
+disp("The circuit impedance is : "+string(abs(Z))+" Ω");
+disp(P,"The power consumed in W is : ")
+disp("The power factor is : "+string(cosd(phi))+" lead")
diff --git a/2384/CH4/EX4.24/ex4_24.sce b/2384/CH4/EX4.24/ex4_24.sce new file mode 100755 index 000000000..0eeace2ad --- /dev/null +++ b/2384/CH4/EX4.24/ex4_24.sce @@ -0,0 +1,17 @@ +// Exa 4.24
+clc;
+clear;
+close;
+format('v',8)
+// Given data
+Z1= 10+15*%i;// in ohm
+Z2= 6-8*%i;// in ohm
+R1= 10;// in ohm
+R2= 6;// in ohm
+I_T= 15;// in A
+I1= I_T*Z2/(Z1+Z2);// in A
+I2= I_T*Z1/(Z1+Z2);// in A
+P1= (abs(I1))^2*R1;// in W
+P2= (abs(I2))^2*R2;// in W
+disp(P1,"The value of P1 in W is : ")
+disp(P2,"The value of P2 in W is : ")
diff --git a/2384/CH4/EX4.25/ex4_25.sce b/2384/CH4/EX4.25/ex4_25.sce new file mode 100755 index 000000000..105bd387e --- /dev/null +++ b/2384/CH4/EX4.25/ex4_25.sce @@ -0,0 +1,29 @@ +// Exa 4.25
+clc;
+clear;
+close;
+format('v',7)
+// Given data
+R = 8;// in ohm
+L = 0.12;// in H
+C = 140;// in µF
+C = C * 10^-6;// in F
+V = 230;// in V
+f = 50;// in Hz
+XL = 2*%pi*f*L;// in ohm
+XC= 1/(2*%pi*f*C);// in ohm
+Z= R+%i*XL-%i*XC;// in ohm
+I= V/Z;// in A
+phi= atand(imag(I),real(I));// in °
+PowerFactor= cosd(phi);
+VC= abs(I)*XC;// in V
+disp("Impedence of the entire circuit : ")
+disp("Magnitude is : "+string(abs(Z))+" Ω");
+disp("Angle is : "+string(atand(imag(Z),real(Z)))+" °")
+disp("Current flowing through the condensor : ")
+disp("Magnitude is : "+string(abs(I))+" Ω");
+disp("Angle is : "+string(atand(imag(I),real(I)))+" °")
+disp("Power factor of the circuit is : "+string(cosd(phi))+" lag")
+disp(VC,"The voltage across the condensor in V is : ")
+
+
diff --git a/2384/CH4/EX4.26/ex4_26.sce b/2384/CH4/EX4.26/ex4_26.sce new file mode 100755 index 000000000..4d6202cf6 --- /dev/null +++ b/2384/CH4/EX4.26/ex4_26.sce @@ -0,0 +1,17 @@ +// Exa 4.26
+clc;
+clear;
+close;
+format('v',8)
+// Given data
+R = 10;// in ohm
+L = 0.1;// in H
+C = 8;// in µF
+C = C * 10^-6;// in F
+f_r = 1/(2*%pi*sqrt(L*C));// in Hz
+Q = (1/R) * (sqrt(L/C));
+del_F = R/(4*%pi*L);
+// The half power frequencies
+f1 = f_r - del_F;// in Hz
+f2 = f_r+del_F;// in Hz
+disp("The half power frequencies are : "+string(f1)+" Hz and "+string(f2)+" Hz")
diff --git a/2384/CH4/EX4.27/ex4_27.sce b/2384/CH4/EX4.27/ex4_27.sce new file mode 100755 index 000000000..783f9eff2 --- /dev/null +++ b/2384/CH4/EX4.27/ex4_27.sce @@ -0,0 +1,15 @@ +// Exa 4.27
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 15;// in ohm
+X_L = 10;// in ohm
+f_r = 50;// in Hz
+// X_L = 2*%pi*f_r*L;
+L = X_L/(2*%pi*f_r);// in H
+// value of capacitance
+C = 1/( L*( ((f_r*2*%pi)^2)+((R^2)/(L^2)) ));// in F
+C = C*10^6;// in µF
+disp(C,"The value of capacitance in µF is");
diff --git a/2384/CH4/EX4.28/ex4_28.sce b/2384/CH4/EX4.28/ex4_28.sce new file mode 100755 index 000000000..66eae8443 --- /dev/null +++ b/2384/CH4/EX4.28/ex4_28.sce @@ -0,0 +1,18 @@ +// Exa 4.28
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+Z1= 3+4*%i;// in ohm
+Z2= 6+8*%i;// in ohm
+V= 230;// in V
+I1= V/Z1;// in A
+I2= V/Z2;// in A
+I_T= I1+I2;// in A
+phi= atand(imag(I_T),real(I_T));// in °
+P= V*abs(I_T)*cosd(phi);//in V
+disp("The value of current : ")
+disp(abs(I_T),"The magnitude in A is : ")
+disp(phi,"The phase angle in degree is : ")
+disp(P,"The power drawn from the source in W is : ")
diff --git a/2384/CH4/EX4.29/ex4_29.sce b/2384/CH4/EX4.29/ex4_29.sce new file mode 100755 index 000000000..98dd93b34 --- /dev/null +++ b/2384/CH4/EX4.29/ex4_29.sce @@ -0,0 +1,22 @@ +// Exa 4.29
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+Z1= 1.6+%i*7.2;// in ohm
+Z2= 4+%i*3;// in ohm
+Z3= 6-%i*8;// in ohm
+V= 100;// in V
+Y2= 1/Z2;// in mho
+disp(Y2,"The admittance in mho is : ")
+Y3= 1/Z3;// in mho
+disp(Y3,"The admittance in mho is : ")
+ZT= Z1+1/(Y2+Y3);
+phi= atand(imag(ZT),real(ZT));
+disp("Total circuit impedance : ")
+disp("Magnitude : "+string(abs(ZT))+" Ω")
+disp("Angle : "+string(phi)+" °");
+IT= V/ZT;// in A
+PT= V*abs(IT)*cosd(phi);// in W
+disp(PT,"The total power supplied in W is : ")
diff --git a/2384/CH4/EX4.3/ex4_3.sce b/2384/CH4/EX4.3/ex4_3.sce new file mode 100755 index 000000000..67bc330b6 --- /dev/null +++ b/2384/CH4/EX4.3/ex4_3.sce @@ -0,0 +1,23 @@ +// Exa 4.3
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+I = 10;// in A
+V = 230;// in V
+f = 50;// in Hz
+X_L = V/I;// in ohm
+disp(X_L,"Inductive reactance in ohm is");
+// X_L = 2*%pi*f*L;
+L = X_L/(2*%pi*f);// in H
+disp(L,"Inductance of the coil in H is");
+Vrms = V;// in V
+Irms = I;// in A
+Vm = Vrms*sqrt(2);// in V
+Im = Irms*sqrt(2);// in A
+omega = 2*%pi*f;// in rad/sec
+//Equation for voltage: V = Vm*sind(omega*t)
+//Equation for current: i = Im*sind(omega*t)
+disp("Voltage equation : v = "+string(Vm)+" sin ("+string(round(omega))+" t)")
+disp("Current equation : i = "+string(Im)+" sin ("+string(round(omega))+" t - %pi/2)")
diff --git a/2384/CH4/EX4.30/ex4_30.sce b/2384/CH4/EX4.30/ex4_30.sce new file mode 100755 index 000000000..78674001e --- /dev/null +++ b/2384/CH4/EX4.30/ex4_30.sce @@ -0,0 +1,22 @@ +// Exa 4.30
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 4;// in ohm
+L = 0.5;// in H
+V = 100;// in V
+f = 50;// in Hz
+X_L = 2*%pi*f*L;// in ohm
+X_C = X_L;// in ohm
+// X_C = 1/(2*%pi*f*C);
+C = 1/(X_C*2*%pi*f);// in F
+C = C * 10^6;// in F
+disp(C,"The value of capacitance in µF is");
+I = V/R;// in A]
+V_C = I*X_C;// in V
+disp(V_C,"The voltage across the capacitance in V");
+omega = 2*%pi*f;// in rad/sec
+Q = (omega*L)/R;
+disp(Q,"The Q factor of the circuit is");
diff --git a/2384/CH4/EX4.4/ex4_4.sce b/2384/CH4/EX4.4/ex4_4.sce new file mode 100755 index 000000000..1cb8a4968 --- /dev/null +++ b/2384/CH4/EX4.4/ex4_4.sce @@ -0,0 +1,25 @@ +// Exa 4.4
+clc;
+clear;
+close;
+format('v',6)
+// GIven data
+C = 318;// in µF
+C = C * 10^-6;// in F
+V = 230;// in V
+f = 50;// in Hz
+X_C = 1/(2*%pi*f*C);// in ohm
+disp(X_C,"The capacitive reactance in ohm is");
+I = V/X_C;// in A
+disp(I,"The R.M.S value of current in A is");
+Vrms = V;// in V
+Irms = I;// in A
+Vm = Vrms*sqrt(2);// in V
+Im = Irms*sqrt(2);// in A
+omega = 2*%pi*f;// in rad/sec
+// V = Vm*sind(omega*t);
+// i = Im*sind((omega*t)+(%pi/2));
+//Equation for voltage: V = Vm*sind(omega*t)
+//Equation for current: i = Im*sind(omega*t)
+disp("Voltage equation : v = "+string(Vm)+" sin ("+string(round(omega))+" t)")
+disp("Current equation : i = "+string(Im)+" sin ("+string(round(omega))+" t + %pi/2)")
diff --git a/2384/CH4/EX4.5/ex4_5.sce b/2384/CH4/EX4.5/ex4_5.sce new file mode 100755 index 000000000..a2d6a060e --- /dev/null +++ b/2384/CH4/EX4.5/ex4_5.sce @@ -0,0 +1,24 @@ +// Exa 4.5
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 7;// in ohm
+L = 31.8;// in mH
+L = L * 10^-3;// in H
+V = 230;// in V
+f = 50;// in Hz
+X_L = 2*%pi*f*L;// in ohm
+Z = sqrt( (R^2)+(X_L^2) );// in ohm
+I = V/Z;// in A
+disp(I,"The circuit current in A is");
+// tand(phi) = X_L/R;
+phi = atand(X_L/R);// in degree lag
+disp(phi,"The phase angle in degree is");
+// Power factor
+powerfactor = cosd(phi);// in lag
+disp(powerfactor,"The power factor is");
+P = V*I*cosd(phi);// in W
+disp(P,"The power consumed in W is");
+
diff --git a/2384/CH4/EX4.6/ex4_6.sce b/2384/CH4/EX4.6/ex4_6.sce new file mode 100755 index 000000000..f72ac5dc0 --- /dev/null +++ b/2384/CH4/EX4.6/ex4_6.sce @@ -0,0 +1,22 @@ +// Exa 4.6
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+P = 400;// in W
+f = 50;// in Hz
+V = 120;// in V
+phi= acosd(0.8);// in °
+// P =V*I*cos(phi);
+I = P/(V*cosd(phi));// in A
+Z= V/I;// in ohm
+Z= Z*expm(%i*phi*%pi/180);// ohm
+R= real(Z);// in ohm
+XL= imag(Z);// in ohm
+// Formula XL= 2*%pi*f*L
+L= XL/(2*%pi*f);// in H
+disp(R,"The value of R in Ω is : ")
+disp(L,"The value of L in H is : ")
+
+
diff --git a/2384/CH4/EX4.7/ex4_7.sce b/2384/CH4/EX4.7/ex4_7.sce new file mode 100755 index 000000000..b68143fe7 --- /dev/null +++ b/2384/CH4/EX4.7/ex4_7.sce @@ -0,0 +1,25 @@ +// Exa 4.7
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+R = 17.32;// in ohm
+L = 31.8;// in mH
+L = L * 10^-3;// in H
+V = 200;// in V
+f = 50;// in Hz
+X_L = 2*%pi*f*L;// in ohm
+Z = sqrt( (R^2) + (X_L^2) );// in ohm
+I = V/Z;// in A
+phi =acosd( R/Z);// in °
+ActiveCom= I*cosd(phi);// in A
+ReactiveCom= I*sind(phi);// in A
+disp(ActiveCom,"The active component of current in A is : ")
+disp(ReactiveCom,"The reactive component of current in A is : ")
+P= V*I*cosd(phi);// in W
+disp(P,"The active power in W is : ")
+Q= V*I*sind(phi);// in VAR
+disp(Q,"The reactive power in VAR is : ")
+
+// Note: There is calculation error to evaluate the value of P, so the answer in the book is wrong.
diff --git a/2384/CH4/EX4.8/ex4_8.sce b/2384/CH4/EX4.8/ex4_8.sce new file mode 100755 index 000000000..389e661bd --- /dev/null +++ b/2384/CH4/EX4.8/ex4_8.sce @@ -0,0 +1,21 @@ +// Exa 4.8
+clc;
+clear;
+close;
+format('v',7)
+// Given data
+R = 20;// in ohm
+C = 200;// in µF
+C=C*10^-6
+f =50;// in Hz
+//I = 10.8 sin(314*t)
+Im = 10.8;// in A
+I = Im/sqrt(2);// in A
+V_R = I*R;// in V
+disp(V_R,"The voltage across 20Ω resistor in V is : ")
+//Vc = I*X_C and X_C = 1/omega*C;
+omega = 2*%pi*f;// in rad/sec
+Vc = I * 1/(omega*C);// in V
+disp(Vc,"The voltage across 200 µF capacitor in V is");
+V = sqrt( (V_R^2) + (Vc^2) );// in V
+disp(V,"The voltage across the circuit in V is");
diff --git a/2384/CH4/EX4.9/ex4_9.sce b/2384/CH4/EX4.9/ex4_9.sce new file mode 100755 index 000000000..713178442 --- /dev/null +++ b/2384/CH4/EX4.9/ex4_9.sce @@ -0,0 +1,36 @@ +// Exa 4.9
+clc;
+clear;
+close;
+format('v',6)
+// Given data
+f= 60;// in Hz
+disp("Part (a)")
+Z= 12+30*%i;
+R= real(Z);// in ohm
+XL= imag(Z);// in ohm
+// Formula XL= 2*%pi*f*L
+L= XL/(2*%pi*f);// in H
+L= L*10^3;// in mH
+disp(R,"The value of resistance in Ω is : ")
+disp(L,"The value of inductance in mH is : ")
+L= L*10^-3;// in H
+disp("Part (b)")
+Z= 0-60*%i;
+R= real(Z);// in ohm
+XC= (abs(imag(Z)));// in ohm
+// Formula XC= 1/(2*%pi*f*C)
+C= 1/(2*%pi*XC*f);// in H
+C= C*10^6;// in µF
+disp(R,"The value of resistance in Ω is : ")
+disp(C,"The value of inductance in µF is : ")
+C= C*10^-6;// in F
+disp("Part (c)")
+Z= 20*expm(60*%i*%pi/180)
+R= real(Z);// in ohm
+XL= imag(Z);// in ohm
+// Formula XL= 2*%pi*f*L
+L= XL/(2*%pi*f);// in H
+L= L*10^3;// in mH
+disp(R,"The value of resistance in Ω is : ")
+disp(L,"The value of inductance in mH is : ")
|