diff options
Diffstat (limited to '608/CH23')
-rwxr-xr-x | 608/CH23/EX23.01/23_01.sce | 14 | ||||
-rwxr-xr-x | 608/CH23/EX23.02/23_02.sce | 26 | ||||
-rwxr-xr-x | 608/CH23/EX23.03/23_03.sce | 25 | ||||
-rwxr-xr-x | 608/CH23/EX23.05/23_05.sce | 13 | ||||
-rwxr-xr-x | 608/CH23/EX23.06/23_06.sce | 23 | ||||
-rwxr-xr-x | 608/CH23/EX23.07/23_07.sce | 20 | ||||
-rwxr-xr-x | 608/CH23/EX23.08/23_08.sce | 34 |
7 files changed, 155 insertions, 0 deletions
diff --git a/608/CH23/EX23.01/23_01.sce b/608/CH23/EX23.01/23_01.sce new file mode 100755 index 000000000..0bf483fa0 --- /dev/null +++ b/608/CH23/EX23.01/23_01.sce @@ -0,0 +1,14 @@ +//Problem 23.01: In an electrical circuit the total impedance ZT is given by ZT = (Z1*Z2/(Z1 + Z2))+ Z3. Determine ZT in (a + jb) form, correct to two decimal places, when Z1 = 5 - j3, Z2 = 4 - i7 and Z3 = 3.9 - i6.7.
+
+//initializing the variables:
+Z1 = 5 - 3*%i;
+Z2 = 4 + 7*%i;
+Z3 = 3.9 - 6.7*%i;
+
+//calculation:
+ZT = (Z1*Z2/(Z1 + Z2))+ Z3
+y = imag(ZT)
+x = real(ZT)
+
+printf("\n\n Result \n\n")
+printf("\n ZT is %.2f + (%.2f)i", x,y)
\ No newline at end of file diff --git a/608/CH23/EX23.02/23_02.sce b/608/CH23/EX23.02/23_02.sce new file mode 100755 index 000000000..d0dfaac72 --- /dev/null +++ b/608/CH23/EX23.02/23_02.sce @@ -0,0 +1,26 @@ +//Problem 23.02: Given Z1 = 3 + i4, Z2 = 2 - i5 determine in cartesian form correct to three decimal places:
+//(a)1/Z1, (b)1/Z2, (c)1/Z1 + 1/Z2, (d)1/(1/Z1 + 1/Z2)
+
+//initializing the variables:
+Z1 = 3 + 4*%i;
+Z2 = 2 - 5*%i;
+
+//calculation:
+za = 1/Z1
+zb = 1/Z2
+zc = za + zb
+zd = 1/zc
+zax = real(za)
+zay = imag(za)
+zbx = real(zb)
+zby = imag(zb)
+zcx = real(zc)
+zcy = imag(zc)
+zdx = real(zd)
+zdy = imag(zd)
+
+printf("\n\n Result \n\n")
+printf("\n (a)1/Z1 is %.3f + (%.3f)i", zax,zay)
+printf("\n (b)1/Z2 is %.3f + (%.3f)i", zbx,zby)
+printf("\n (c)1/Z1 + 1/Z2 is %.3f + (%.3f)i", zcx,zcy)
+printf("\n (d)1/(1/Z1 + 1/Z2) is %.3f + (%.3f)i", zdx,zdy)
\ No newline at end of file diff --git a/608/CH23/EX23.03/23_03.sce b/608/CH23/EX23.03/23_03.sce new file mode 100755 index 000000000..b2e71a6e1 --- /dev/null +++ b/608/CH23/EX23.03/23_03.sce @@ -0,0 +1,25 @@ +//Problem 23.03: Solve the following complex equations:
+//(a) 3(a + ib) = 9-i2
+//(b) (2+i)(-2+i) = x+iy
+//(c) (a-i(2b))+(b-i3a) = 5+i2
+
+//initializing the variables:
+Z1 = 9 - 2*%i;
+Z2 = 2 + 1*%i;
+Z3 = -2 + 1*%i;
+Z4 = 5 + 2*%i;
+
+//calculation:
+za = Z1/3
+zb = Z2*Z3
+zca = (2*real(Z4) + imag(Z4))/-1
+zcb = real(Z4) - zca
+zaa = real(za)
+zab = imag(za)
+zbx = real(zb)
+zby = imag(zb)
+
+printf("\n\n Result \n\n")
+printf("\n (a)a and b are %.0f and %.2f resp.", zaa,zab)
+printf("\n (b)x and y are %.0f and %.0f resp.", zbx,zby)
+printf("\n (c)a and b are %.0f and %.0f resp.", zca,zcb)
\ No newline at end of file diff --git a/608/CH23/EX23.05/23_05.sce b/608/CH23/EX23.05/23_05.sce new file mode 100755 index 000000000..d2a7ea51a --- /dev/null +++ b/608/CH23/EX23.05/23_05.sce @@ -0,0 +1,13 @@ +//Problem 23.05: Convert (5,-132°) into a + ib form correct to four significant figures.
+
+//initializing the variables:
+r = 5; // magnitude
+theta = -132; // in degree
+
+//calculation:
+x = r*sin(theta*%pi/180)
+y = r*cos(theta*%pi/180)
+z = x+%i*y
+
+printf("\n\n Result \n\n")
+printf("\n Z is %.3f + (%.3f)i", x,y)
\ No newline at end of file diff --git a/608/CH23/EX23.06/23_06.sce b/608/CH23/EX23.06/23_06.sce new file mode 100755 index 000000000..5f5e3a34b --- /dev/null +++ b/608/CH23/EX23.06/23_06.sce @@ -0,0 +1,23 @@ +//Problem 23.06: Two impedances in an electrical network are given by Z1 = (4.7,35°) and Z2 = (7.3, -48)°. Determine in polar form the total impedance ZT given that ZT = Z1*Z2/(Z1 + Z2)
+
+//initializing the variables:
+r1 = 4.7; // magnitude
+theta1 = 35; // in degree
+r2 = 7.3; // magnitude
+theta2 = -48; // in degree
+
+//calculation:
+x1 = r1*cos(theta1*%pi/180)
+y1 = r1*sin(theta1*%pi/180)
+z1 = x1+%i*y1
+x2 = r2*cos(theta2*%pi/180)
+y2 = r2*sin(theta2*%pi/180)
+z2 = x2+%i*y2
+z3 = z1*z2/(z1 + z2)
+x3 = real(z3)
+y3 = imag(z3)
+r3 = (x3^2 + y3^2)^0.5
+theta3 = atan(y3/x3)*180/%pi
+
+printf("\n\n Result \n\n")
+printf("\n ZT is (%.2f/_%.2f°)", r3,theta3)
\ No newline at end of file diff --git a/608/CH23/EX23.07/23_07.sce b/608/CH23/EX23.07/23_07.sce new file mode 100755 index 000000000..3788919c9 --- /dev/null +++ b/608/CH23/EX23.07/23_07.sce @@ -0,0 +1,20 @@ +//Problem 23.07: Determine (-2 + i3)^5 in polar and in cartesian form.
+
+//initializing the variables:
+z = -2 + %i*3;
+
+//calculation:
+zc = z^5
+x = real(zc)
+y = imag(zc)
+r = (x^2 + y^2)^0.5
+theta = atan(y/x)*180/%pi
+if ((x<0)&(y<0)) then
+ theta = theta -180;
+elseif ((x<0)&(y>0)) then
+ theta = theta +180;
+end
+
+printf("\n\n Result \n\n")
+printf("\n Z is %.0f + (%.0f)i", x,y)
+printf("\n ZT is (%.1f/_%.2f°)", r,theta)
\ No newline at end of file diff --git a/608/CH23/EX23.08/23_08.sce b/608/CH23/EX23.08/23_08.sce new file mode 100755 index 000000000..505867360 --- /dev/null +++ b/608/CH23/EX23.08/23_08.sce @@ -0,0 +1,34 @@ +//Problem 23.08: Determine the two square roots of the complex number (12 + i5) in cartesian and polar form, correct to three significant figures. Show the roots on an Argand diagram.
+
+//initializing the variables:
+z = 12 + %i*5;
+
+//calculation:
+x = real(z)
+y = imag(z)
+r = (x^2 + y^2)^0.5
+theta1 = atan(y/x)*180/%pi
+if ((x<0)&(y<0)) then
+ theta1 = theta1 -180;
+elseif ((x<0)&(y>0)) then
+ theta1 = theta1 +180;
+end
+theta2 = theta1 + 360
+rtheta1 = theta1/2
+rtheta2 = theta2/2
+if (rtheta2 > 180) then
+ rtheta2 = rtheta2 -360;
+elseif ((x<0)&(y>0)) then
+ rtheta2 = rtheta2 +360;
+end
+rr = r^0.5
+x1 = rr*cos(rtheta1*%pi/180)
+y1 = rr*sin(rtheta1*%pi/180)
+z1 = x1 + %i*y1
+x2 = rr*cos(rtheta2*%pi/180)
+y2 = rr*sin(rtheta2*%pi/180)
+z2 = x2 + %i*y2
+
+printf("\n\n Result \n\n")
+printf("\n two roots are (%.2f + (%.2f)i) and (%.2f + (%.2f)i)", x1,y1,x2,y2)
+printf("\n two roots are (%.1f/_%.2f°) and (%.1f/_%.2f°)", rr,rtheta1, rr,rtheta2)
\ No newline at end of file |