diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1523/CH5 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1523/CH5')
-rwxr-xr-x | 1523/CH5/EX5.1/5_1.sce | 37 | ||||
-rwxr-xr-x | 1523/CH5/EX5.11/5_11.sce | 32 | ||||
-rwxr-xr-x | 1523/CH5/EX5.2/5_2.sce | 31 |
3 files changed, 100 insertions, 0 deletions
diff --git a/1523/CH5/EX5.1/5_1.sce b/1523/CH5/EX5.1/5_1.sce new file mode 100755 index 000000000..472175bad --- /dev/null +++ b/1523/CH5/EX5.1/5_1.sce @@ -0,0 +1,37 @@ +//Steady-State AC Analysis
+//page no - 5.1
+//example 5.1
+// A = p2z(R,Theta) - Convert from polar to complex form.
+// R is a matrix containing the magnitudes
+// Theta is a matrix containing the phase angles (in degrees).
+function [A] = p2z(R,Theta)
+ if argn(2) <> 2 then
+ error("incorrect number of arguments.");
+ end
+ if ~and(size(R) == size(Theta)) then
+ error("arguments must be of the same dimension.");
+ end
+ A = R.*exp(%i*%pi*Theta/180.);
+endfunction
+
+A=p2z(100,45);//converting from polar to rectangular
+disp(A);
+disp("Applying KVL to Mesh 1 we get :");
+disp("(3+j14)I1-j10I2=70.710678+j70.710678");//Equation 1
+disp("Applying KVL to Mesh 2 we get :");
+disp("I1=0")//equation 2
+disp("putting equation 2 in equation 1:")//putting equation 2 in equation 1
+disp("I2=(70.710678+j70.710678)/-j10");
+I2=A/10*%i;
+disp(I2);
+function [r,th]=rect2pol(x,y)
+//rectangle to polar coordinate conversion
+//based on "Scilab from a Matlab User's Point of View", Eike Rietsch,
+2002
+ r=sqrt(x^2+y^2);
+ th = atan(y,x)*180/%pi;
+endfunction
+[r,th]=rect2pol(- 7.0710678,7.0710678)//converting back to polar form
+disp(r);
+disp(th);
+disp("I2= mag - 10 ang - 135 A");
diff --git a/1523/CH5/EX5.11/5_11.sce b/1523/CH5/EX5.11/5_11.sce new file mode 100755 index 000000000..70b20db3e --- /dev/null +++ b/1523/CH5/EX5.11/5_11.sce @@ -0,0 +1,32 @@ +//Steady-State AC Analysis
+//page no - 5.10
+//example 5.11
+disp("when mag-50 ang-0 source is acting alone :");
+function [A] = p2z(R,Theta)
+ if argn(2) <> 2 then
+ error("incorrect number of arguments.");
+ end
+ if ~and(size(R) == size(Theta)) then
+ error("arguments must be of the same dimension.");
+ end
+ A = R.*exp(%i*%pi*Theta/180.);
+endfunction
+A=p2z(50,0); //converting polar to rec
+disp(A);
+disp("when mag-4 ang-0 source is acting alone :");
+Vab2=0;
+disp("By Super-position theorem :")
+disp("Vab=Vab1+Vab2");
+Vab=A+Vab2;
+printf("Vab = %.f", Vab);
+function [r,th]=rect2pol(x,y)
+//rectangle to polar coordinate conversion
+//based on "Scilab from a Matlab User's Point of View", Eike Rietsch,
+2002
+ r=sqrt(x^2+y^2);
+ th = atan(y,x)*180/%pi;
+endfunction
+[r,th]=rect2pol(50,0) //converting back to polar form
+disp(r);
+disp(th);
+disp("Vab= mag-50 ang-0 V")
diff --git a/1523/CH5/EX5.2/5_2.sce b/1523/CH5/EX5.2/5_2.sce new file mode 100755 index 000000000..2a60d2f65 --- /dev/null +++ b/1523/CH5/EX5.2/5_2.sce @@ -0,0 +1,31 @@ +//Steady-State AC Analysis
+//page no - 5.1
+//example 5.1
+// A = p2z(R,Theta) - Convert from polar to complex form.
+// R is a matrix containing the magnitudes
+// Theta is a matrix containing the phase angles (in degrees).
+function [A] = p2z(R,Theta)
+ if argn(2) <> 2 then
+ error("incorrect number of arguments.");
+ end
+ if ~and(size(R) == size(Theta)) then
+ error("arguments must be of the same dimension.");
+ end
+ A = R.*exp(%i*%pi*Theta/180.);
+endfunction
+A=p2z(10,30);
+disp(A); //converting to rectangular form
+M=[8-2*%i, -3, 0; -3, 8+5*%i, -5; 0, -5 7-2*%i];
+N=[A, 0, 0]'
+O=inv(M);
+X=O*N;
+disp(X);
+function [r,th]=rect2pol(x,y)
+//rectangle to polar coordinate conversion
+//based on "Scilab from a Matlab User's Point of View", Eike Rietsch,
+2002
+ r=sqrt(x^2+y^2);
+ th = atan(y,x)*180/%pi;
+endfunction
+[r,th]=rect2pol(1.3340761,- 0.5209699)//converting back to polar form
+
|