summaryrefslogtreecommitdiff
path: root/854/CH3/EX3.3/Example3_3.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /854/CH3/EX3.3/Example3_3.sce
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 '854/CH3/EX3.3/Example3_3.sce')
-rwxr-xr-x854/CH3/EX3.3/Example3_3.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/854/CH3/EX3.3/Example3_3.sce b/854/CH3/EX3.3/Example3_3.sce
new file mode 100755
index 000000000..1cda28ca9
--- /dev/null
+++ b/854/CH3/EX3.3/Example3_3.sce
@@ -0,0 +1,29 @@
+//clear//
+//Caption: Program to calculate the total charge enclosed in a volume at the origin
+//Example3.3
+//page 67
+clc;
+V = 1e-09; //volume in cubic metre
+x = sym('x');
+y = sym('y');
+z = sym('z');
+//Components of Electric Flux Density in cartesian coordinate system
+Dx = exp(-x)*sin(y);
+Dy = -exp(-x)*cos(y);
+Dz = 2*z;
+//Divergence of electric flux density 'D'
+dDx = diff(Dx,x);
+dDy = diff(Dy,y);
+dDz = diff(Dz,z);
+//Total charge enclosed in a given volume
+del_Q = (dDx+dDy+dDz)*V;
+disp(del_Q,'Total charge enclosed in an incremental volume in coulombs, del_Q =')
+//Total Charge enclosed in a given volume at origin (0,0,0)
+del_Q = limit(del_Q,x,0);
+del_Q = limit(del_Q,y,0);
+del_Q = limit(del_Q,z,0);
+disp(del_Q*1e09,'Total charge enclosed in an incremental volume in nano coulombs at origin, del_Q =')
+//Result
+//Total charge enclosed in an incremental volume in coulombs, del_Q = 2.0000000000000001E-9
+//Total charge enclosed in an incremental volume in nano coulombs at origin, del_Q =
+// 2.0