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 --- 1523/CH5/EX5.11/5_11.sce | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 1523/CH5/EX5.11/5_11.sce (limited to '1523/CH5/EX5.11/5_11.sce') 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") -- cgit