summaryrefslogtreecommitdiff
path: root/42/CH2
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /42/CH2
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '42/CH2')
-rwxr-xr-x42/CH2/EX2.1/sadiku_2_1.sce12
-rwxr-xr-x42/CH2/EX2.2/sadiku_2_2.sce22
-rwxr-xr-x42/CH2/EX2.3/sadiku_2_3.sce15
-rwxr-xr-x42/CH2/EX2.4/sadiku_2_4.sce21
4 files changed, 70 insertions, 0 deletions
diff --git a/42/CH2/EX2.1/sadiku_2_1.sce b/42/CH2/EX2.1/sadiku_2_1.sce
new file mode 100755
index 000000000..fa4b595b5
--- /dev/null
+++ b/42/CH2/EX2.1/sadiku_2_1.sce
@@ -0,0 +1,12 @@
+clear;
+clc;
+format('v',7);
+x=-2;y=6;z=3;
+r=(x^2+y^2)^.5;
+B=atand(y/x);
+R=sqrt(x^2+y^2+z^2);
+X=atand(r/z);
+disp([r B z ],'Cylindrical acordinate of P:');
+disp([R X B],'Spherical Cordinate of P:');
+A=[cosd(B) sind(B) 0;-sind(B) cosd(B) 0;0 0 1]*[y;x+z;0];
+disp (A,'A in cylindrical cordinates') \ No newline at end of file
diff --git a/42/CH2/EX2.2/sadiku_2_2.sce b/42/CH2/EX2.2/sadiku_2_2.sce
new file mode 100755
index 000000000..570296bc9
--- /dev/null
+++ b/42/CH2/EX2.2/sadiku_2_2.sce
@@ -0,0 +1,22 @@
+clear;
+clc;
+format('v',6);
+function [X,Y,Z]=sptocart(x,y,z);
+R=sqrt(x^2+y^2+z^2);r=sqrt(x^2+y^2);
+P=asin(r/R);Q=acos(x/r);
+X=(10/R)*sin(P)*cos(Q)+R*(cos(P))^2 *cos(Q)-sin(Q);
+Y=(10/R)*sin(P)*sin(Q)+R*(cos(P))^2 *sin(Q)+cos(Q);
+Z=(10/R)*cos(P)-R*cos(P)*sin(P);
+disp([X Y Z],'B in cartesian cordinate')
+endfunction
+sptocart(-3,4,0);
+function [r,p,z]=sptocylin(r1,p1,z1);
+R=sqrt(r1^2+z1^2);
+P=acos(z1/R);
+r=(10/R)*sin(P)+R*(cos(P))^2 ;
+p=1;
+z=(10/R)*cos(P)-R*cos(P)*sin(P);
+disp([r p z],'B in cylindrical cordinates');
+endfunction
+sptocylin(5,%pi/2,-2);
+
diff --git a/42/CH2/EX2.3/sadiku_2_3.sce b/42/CH2/EX2.3/sadiku_2_3.sce
new file mode 100755
index 000000000..34676fabb
--- /dev/null
+++ b/42/CH2/EX2.3/sadiku_2_3.sce
@@ -0,0 +1,15 @@
+clear;
+clc;
+E=[-5 10 3];ModE=sqrt((-5)^2+10^2+3^2);
+F=[1 2 -6];
+P=[5,%pi/2,3];
+G1=E(1,2)*F(1,3)-E(1,3)*F(1,2);
+G2=E(1,3)*F(1,1)-E(1,1)*F(1,3);
+G3=E(1,1)*F(1,2)-E(1,2)*F(1,1);
+G=[G1 G2 G3];
+disp(sqrt(G1^2+G2^2+G3^2),'Mod of (E*F)');
+ay=[sin(%pi/2) cos(%pi/2) 0];
+Ey=(E(1,1)*ay(1,1)+E(1,2)*ay(1,2)+E(1,3)*ay(1,3));
+disp(Ey,'Component of E parallel to x=2 & z=3');
+P=acosd(3/ModE);
+disp(90-P,'Angle which make E wid Z=3'); \ No newline at end of file
diff --git a/42/CH2/EX2.4/sadiku_2_4.sce b/42/CH2/EX2.4/sadiku_2_4.sce
new file mode 100755
index 000000000..ff0403987
--- /dev/null
+++ b/42/CH2/EX2.4/sadiku_2_4.sce
@@ -0,0 +1,21 @@
+clear;
+clc;
+format('v',6)
+function [R,P,Q]=Posvec(r,p,q);
+R=r*sind(q);P=-sind(p)*cosd(q)/r;Q=r*r;
+D=[R P Q];
+disp(D,'D at P');
+Dn=[r*sind(q) 0 0];
+Dt=D-Dn;
+disp(Dt, 'Tangential component of D at P');
+endfunction
+Posvec(10,150,330);
+D=[-5 .043 100];
+a=[0 1 0];
+U1=D(1,2)*a(1,3)-D(1,3)*a(1,2);
+U2=D(1,3)*a(1,1)-D(1,1)*a(1,3);
+U3=D(1,1)*a(1,2)-D(1,2)*a(1,1);
+U=[U1 U2 U3];
+det_U=sqrt(U1^2+U2^2+U3^2);
+format('v',7);
+disp(U/det_U,'Unit vector P perpendicular to D');