diff options
author | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
commit | f35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch) | |
tree | eb72842d800ac1233e9d890e020eac5fd41b0b1b /854/CH2/EX2.1/Example2_1.sce | |
parent | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff) | |
download | Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2 Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip |
updated the code
Diffstat (limited to '854/CH2/EX2.1/Example2_1.sce')
-rwxr-xr-x | 854/CH2/EX2.1/Example2_1.sce | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/854/CH2/EX2.1/Example2_1.sce b/854/CH2/EX2.1/Example2_1.sce index cb73e86e4..895c5274a 100755 --- a/854/CH2/EX2.1/Example2_1.sce +++ b/854/CH2/EX2.1/Example2_1.sce @@ -1,27 +1,27 @@ -//clear//
-//Caption:Program to Caculate force exerted on Q2 by Q1
-//Example2.1
-//page 29
-clc;
-r2 = [2,0,5];
-r1 = [1,2,3];
-R12 = norm(r2-r1);
-aR12 = UnitVector(r2-r1);
-disp(R12,'R12=')
-disp(aR12,'aR12=')
-Q1 = 3e-04; //charge 1 in Coulombs
-Q2 = -1e-04; //charge 2 in Coulombs
-Eps = 8.854e-12; //free space permittivity
-F2 = ((Q1*Q2)/(4*%pi*Eps*R12^2))*aR12;
-F1 = -F2;
-disp(F2,'Force exerted on Q2 by Q1 in N/m F2 =')
-disp(F1,'Force exerted on Q1 by Q2 in N/m F1 =')
-//Result
-//R12=
-// 3.
-//aR12=
-// 0.3333333 - 0.6666667 0.6666667
-//Force exerted on Q2 by Q1 in N/m F2 =
-// - 9.9863805 19.972761 - 19.972761
-//Force exerted on Q1 by Q2 in N/m F1 =
-// 9.9863805 - 19.972761 19.972761
+clear +//Caption:Program to Caculate force exerted on Q2 by Q1 +//Example2.1 +//page 29 +clc; +r2 = [2,0,5]; +r1 = [1,2,3]; +R12 = norm(r2-r1); +aR12 = (r2-r1)/R12; +disp(R12,'R12=') +disp(aR12,'aR12=') +Q1 = 3e-04; //charge 1 in Coulombs +Q2 = -1e-04; //charge 2 in Coulombs +Eps = 8.854e-12; //free space permittivity +F2 = ((Q1*Q2)/(4*%pi*Eps*R12^2))*aR12; +F1 = -F2; +disp(F2,'Force exerted on Q2 by Q1 in N/m F2 =') +disp(F1,'Force exerted on Q1 by Q2 in N/m F1 =') +//Result +//R12= +// 3. +//aR12= +// 0.3333333 - 0.6666667 0.6666667 +//Force exerted on Q2 by Q1 in N/m F2 = +// - 9.9863805 19.972761 - 19.972761 +//Force exerted on Q1 by Q2 in N/m F1 = +// 9.9863805 - 19.972761 19.972761
\ No newline at end of file |