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/EX5.11/5_11.sce | |
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/EX5.11/5_11.sce')
-rwxr-xr-x | 1523/CH5/EX5.11/5_11.sce | 32 |
1 files changed, 32 insertions, 0 deletions
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")
|